Thursday, January 9, 2020

How to display warehouse based on the Site selected using X++ in D365FO

[FormControlEventHandler(formControlStr(EcoResProductParameters, KMTWarehousePlaceholder), FormControlEventType::Lookup)]
    public static void KMTWarehousePlaceholder_OnLookup(FormControl sender, FormControlEventArgs e)
    {
        FormControlCancelableSuperEventArgs formControlCancelSuper = e as FormControlCancelableSuperEventArgs;

        EcoResProductParameters ecoResProductParameters = sender.formRun().dataSource(formDataSourceStr(EcoResProductParameters,EcoResProductParameters)).cursor();

        if (ecoResProductParameters.KMTSitePlaceholder)
        {
            InventLocation::lookupBySiteIdAllTypes(sender, ecoResProductParameters.KMTSitePlaceholder);
        }

        formControlCancelSuper.CancelSuperCall();
    }

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...