D365F&O - X++ - Get form control in coc method in form extension

[ExtensionOf(formControlStr(SalesUpdateRemain, ButtonCancelLine))]
final class SalesUpdateRemainButtonCancel_Extension
{
    void clicked()
    {
        next clicked();

        #define.SalesPhysical('remainSalesPhysical')

        FormControl formButtonControl = any2Object(this) as FormControl;
        FormRealControl remainSalesPhysicalControl = formButtonControl.formRun().
control(formButtonControl.formRun().controlId(
         (formcontrolstr(SalesUpdateRemain, remainSalesPhysical )) ));
       
        remainSalesPhysicalControl.realValue(500);
    }
}

Comments

Popular posts from this blog

D365F&O - X++ - Best Practice Warning BP Rule: [BPErrorUnknownLabel]: Path:

D365F&O - X++ - How to Enable/Disable button on form based on a condition in D365F&O using Event handlers.

D365FO - X++ - Generate CAR (Customized Analysis Report) report of custom model