Move UDF through code
Paul Witmond
Hi,I'm trying to move an udf to the main screen through code but it's not working.
This is the current code (VB)
Dim UDF1 As SwissAddonFramework.UI.Components.TextEdit
UDF1 = TextEdit.CreateNew("UDF1")
UDF1.FromPane = 76
UDF1.toPane = 76
UDF1.Top = 190
UDF1.Left = 120
UDF1.width = 250
UDF1.DataBind = DataBind.CreateNew("U_UDF1")
UDF1.DataBind.DataBound = True
UDF1.DataBind.Alias = "U_UDF1"
UDF1.DataBind.TableName = "OPOR"
pVal.Form.AddItem(UDF1)
pVal.Form.Update()
When stepping through the current record all I see is a record counter on the screen but not the actual content of the UDF.
What am I doing wrong ?
Paul
Paolo Manfrin
Hi Paul,assuming that I have an UDF called U_SWA_CT_Progress defined in "OPOR", I use the following code to display it on the main form:
TextEdit oTextEdit = TextEdit.CreateNew("myUDF");
oTextEdit.Top = TextEdit.GetFromUID(pVal.Form, "29").Top + 30;
oTextEdit.Left = TextEdit.GetFromUID(pVal.Form, "29").Left;
oTextEdit.DataBind = DataBind.CreateNew("UDFProg");
oTextEdit.DataBind.TableName = "OPOR";
oTextEdit.DataBind.Alias = "U_SWA_CT_Progress";
oTextEdit.DataBind.DataBound = true;
pVal.Form.AddItem(oTextEdit);
pVal.Form.Update();
return true;
I set the event on OnFormLoad
Cheers,
paolo
0
Please sign in to leave a comment.
Comments
0 comments