Important form methods in Dynamics 365 for Finance and Operations


[Form]
public class POLMobileServiceTable extends FormRun
{
    [DataSource]
    class POLMobileServiceTable
    {
        /// 
        ///
        /// 
        public void executeQuery()
        {
            //Before the query executes
            //(select * from POLMobileServiceTable where ServiceStatus = InReview

            this.query().dataSourceTable(tableNum(POLMobileServiceTable)).addRange(
                fieldNum(POLMobileServiceTable, ServiceStatus)).value(queryValue(POLServiceStatus::InReview));

            super(); //Actual query execution (select * from POLMobileServiceTable)
            //After the query executes
        }

    }

    [DataSource]
    class POLMobileServiceTable
    {
        /// 
        ///
        /// 
        /// 
        public int active()
        {
            int ret;
        
            ret = super();

            POLUpdateAsDelivered.enabled(POLMobileServiceTable.ServiceStatus == POLServiceStatus::Repaired);
        
            return ret;
        }
    } 

}