acumaticaacumatica-kb

How do you add an unbound 'select' button to an existing DAC for a custom process screen?


I have a custom process screen using the POOrder DAC as a filtered list of records to process. The issue I'm having is how to add the 'Select' checkbox to an existing DAC? Is that just a standard DAC extension?

If so, how would that would work when specifying the Detail View for the grid... I can't seem to find any examples online - the training just specifies adding the unbound (PXBool) 'Select' field directly to the existing DAC, but that's a DAC that is created in the training and not an existing stock Acumatica DAC like POOrder.


Solution

  • You can declare an unbound boolean DAC field named Selected as instructed.

    #region Selected
    public abstract class selected : PX.Data.BQL.BqlBool.Field<selected> { }
    
    protected bool? _Selected = false;
    [PXBool]
    [PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)]
    [PXUIField(DisplayName = "Selected")]
    public virtual bool? Selected
    {
        get
        {
            return _Selected;
        }
        set
        {
            _Selected = value;
        }
    }
    #endregion
    

    By naming convention Acumatica processing delegate will detect the column named Selected and will apply different behavior to it. It is possible to use a different column name by calling the processing data view SetSelected method.

    public PXProcessing<DAC> ProcessingDataView;
    
    public GraphConstructor()
    {
        ProcessingDataView.SetSelected<DAC.columnName>();
        ProcessingDataView.SetProcessDelegate(ProcessingDelegateMethod);
    }
    

    Reference: https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=18ee8457-e989-4bf0-a400-88c8fff3dfea

    Selected is the default name for the data field for this specific check box; you can define the data field with any name and override the default Selected name in the graph constructor with the SetSelected() method of the PXProcessing class.