Optimizer, C# code to edit a colom of a matrix
Rene Jansen
Hi,We must update the field "Adres-ID" (item=178; Column=1 on the BP master data form) with the data from "CardName" (item=7).
To get the cardname is no problem, is uses this code:
string name = SwissAddonFramework.UI.Components.TextEdit.GetFromUID(pVal.Form, "7").Value;
But to update the "Adres-ID" field i have no idea, I have tried with this code to update a 'normal' not matrix field and that works good.
((SwissAddonFramework.UI.Components.TextEdit)pVal.Form.Items["128"]).Value = naam;
Who can help me to update a colomn of a matrix.
Many thanks.
Rene Jansen
Michael Egloff
Hello,to update a field in a matrix, try it like this:
string message = TextEdit.GetFromUID(pVal.Form, "7").Value;
Matrix.GetFromUID(pVal.Form, "178").SetValue("1", 0, message);
where SetValue() is the method to fill a value into a field.
"1" is the column.
0 the row.
message the value you want to fill.
Hope this helps!
Michael
Rene Jansen
many thanks, it works very well.Michael Egloff
Great!Please remember to mark the thread as 'solved' when you get the answer you wanted, thanks!
Michael
0
Please sign in to leave a comment.
Comments
0 comments