Wednesday, 15 March 2017

Disable (alt + f 9 button from the list of purchase order list page

Some times we need to enable or disable certain button based  on certain criteria

class >> PurchTableListPageInteraction>>
method name >> public void selectionChanged()

declare

FormDataSource      purchTable_ds;



    super();


     purchTable_ds = this.currentPurchTable().dataSource();
    //PurchTable.DmsIsIntegrate == DmsIsIntegrate::None &&
    if(PurchTable.PurchStatus != PurchStatus::Invoiced || PurchTable.PurchStatus != PurchStatus::Backorder)
    {
        this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),true);

     

        if(PurchTable.InterCompanySalesId != "")
        {
            purchTable_ds.allowDelete(false);
        }
        else
        {
            purchTable_ds.allowDelete(true);
        }
        purchTable_ds.allowEdit(true);
    }
    else
    {
        this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),false);
        purchTable_ds.allowDelete(false);
        purchTable_ds.allowEdit(false);
    }

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...