Problem:
The data that is to be shown on form is a calculated value and is not directly saved in database. It is displayed after the running of a certain code chunk.
Solution:
I will show you how you can use display method to show a calculated value on a form control step by step with an example. Let's begin.
Example:
Consider the example of customer service form, the control of "Allow on Account" is a displayed field of value YESNO. its value is not stored in database but it only displays value according to the sales order searched.Step 1:
Define the display method. It can be defined as table methods, form methods, form data source methods, report methods and report design methods. In my case I am defining it as table method on custtable, it checks the value of "Allow on Account" on MCRCusttable and displays the respected value on customer service form.
public display NOYesId AllowOnAccount()
{
MCRCustTable mcrcusttable;
select AllowOnAccount from mcrcusttable
where mcrcusttable.CustTable == this.RecId;
return mcrcusttable.AllowOnAccount;
}
Step 2:
public display NOYesId AllowOnAccount()
{
MCRCustTable mcrcusttable;
select AllowOnAccount from mcrcusttable
where mcrcusttable.CustTable == this.RecId;
return mcrcusttable.AllowOnAccount;
}
Add the defined display method on form control as data method shown below:
First add the control on form.
what if we have to create a display method of extended objects?
ReplyDeletePost a Comment