I knew that the following could work:
...
FormControl control;
;
control = element.design().controlName('PurchTable_OrderDate'));
control.Text = DateTimeUtil::ToStr(purchTable_ds.Object(fieldnum(PurchTable, CretationDateTime);
...
However, I wanted to create a solution that would not be so dependant on the Form object as this can bring headaches when upgrading. Therefore, I decided to do it at the data source level as follow:
purchTable_ds.object(fieldnum(PurchTable, OrderDate)).setValue(DateTimeUtil::date(purchTable.createdDateTime));
The above code is far more efficient and it needs to be set either in the Data Source (PurchTable) of the PurchTable form Init() or Active() method.
No comments:
Post a Comment
Thank you for your thoughts. Your comment will appear in my blog shortly after review.
Have a great day!