Thursday, March 15, 2018

How to read the value from Unbound(Checkbox) control in D365

/// <summary>
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

[FormControlEventHandler(formControlStr(VendTable, DIPL_VendorBlocking), FormControlEventType::Modified)]

public static void DIPL_VendorBlocking(FormControl sender, FormControlEventArgs e)
        FormCheckBoxControl  callerButton = sender as FormCheckBoxControl ;  //Retrieves the button that we're reacting to
        FormRun element = callerButton.formRun();

             VendTable vendTable = sender.formRun.datasource(1).cursor(); // this will read the current record from the table.
             vendTable.Blocked   = custVendorBlocked::ALL; // updating table field.

Helpfull reference :

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...