Tuesday, January 24, 2023

Dimension lookup using x++

 Dimension lookup using x++.

public static void DimensionMaster_Region_OnLookup(FormControl sender, FormControlEventArgs e)
{
    FormStringControl   ctrl = sender as FormStringControl;
    Args                args;
    FormRun             formRun;
    DimensionAttribute  dimensionAttribute;

    select dimensionAttribute
	where dimensionAttribute.Name == 'Region';// you can mention your dimesion

    args = new Args();
    args.record(dimensionAttribute);
    args.caller(sender);
    args.name(formstr(DimensionLookup));

    formRun = classfactory.formRunClass(args);
    formRun.init();

    ctrl.performFormLookup(formRun);
}


Keep Daxing!!


No comments:

Post a Comment