Add linkbutton to system matrix
Paul Witmond
Hi,Can anybody show me the code to add a linkbutton to a system MATRIX ?
I've added an udf to the sales order and now I want a link button for that new column.
Thanks,
Paul
Anders Olsson
Hi Paul,Unfortunately you cannot change column type in a loaded matrix (e.g. from TextEdit to LinkedButton) so you will have to implement some kind of workaround. For example, on FormLoad you can add a new column of type LinkedButton and hide the actual udf column. In this case you will have to make sure the two columns are in sync: populate it on FormDataLoad and update the other column on ValueChanged.
Here is how to add a new column in FormLoad:
Matrix matrix = Matrix.GetFromUID(pVal.Form, "38");
matrix.Rows.Clear();
MatrixColumn newCol = MatrixColumn.CreateNew("LINKBTN");
newCol.Type = MatrixColumn.MatrixItemType.LinkedButton;
matrix.Columns.Add(newCol);
This would probably only work if you open the form from the menu, not from another linkedbutton because FormDataLoad occurs before FormLoad and in that case you end up removing the actual data from the matrix.
Another workaround possibility would be to open the related document when double clicking on the UDF.
Regards,
Anders
0
Please sign in to leave a comment.
Comments
0 comments