web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

How to create Form Control extension class in D365. #x++ #D365 #Dynamics

Krishna Bhardwaj Profile Picture Krishna Bhardwaj 97
Here is an example that shows how you can create a Form Control extension class. I was required to change the data source field value based on the display field's value.


[ExtensionOf(formControlStr(MainAccount, Administration_IsSuspended))]
final class MainAccount_Administration_IsSuspended_Extension
{
    public boolean modified()
    {
        boolean ret = next modified();
        FormRun formRun = this.formRun();
        MainAccount mainaAcount = formRun.dataSource(formdatasourcestr(MainAccount, MainAccount)).cursor();
        if (this.valueStr() == 'Yes')
        {
            mainaAcount.SuspendedDate = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());
        }
        else
        {
            mainaAcount.SuspendedDate = dateNull();
        }
        return ret;
    }
}

Comments

*This post is locked for comments