Try Microsoft Edge
A fast and secure browser that's designed for Windows 10
I have added two form controls to a form extension; one drop-down(Field01) and another a text box(Field02). Based on the selection made in drop down the text box gets populated with some description. Now, all this is done in an edit() method in a class (for the form extension). Field02 is not associated to any table, it is just a display of the description. How can I access the text box form control and set a value for it?
Note:- I did not create the edit() in table extension class because of the need to access form control Field02.
e.g. Form extension = PurchTable.Extension
[ExtensionOf(formStr(PurchTable))]final class PurchTable_Extension
public static edit Description editField01(PurchTable _this, boolean _set = false, Str60 _recid = "0")
_this.Field01 = str2int64(_recid);
//Some more code
// This is where I am trying to access Field02 to set some value to it.
If Field02 is bound to a field on PurchTable, you can ignore the control and simply look at the field.
If it's an unbound control, a solution may be getting a datasource from _this and than a form reference from the form datasource. Then you'll access the control on the form.
Field02 is unbound. I got the FormRun object from _this.datasource(). Thanks!
Business Applications communities