Non Editable EDIT button and all record in Grid of SalesTable form (Sales Orde Approval Workflow)

Hi Friends,

I have a problem in my sales order approval workflow. The Edit button and fields in the grid of salestable form is editable should be non editable. I tried to modify using active method in salestable and salesline datasource and override the clicked method in EDIT buttom, but still nothings happen.Please help me :frowning:

Thanks…

Chris.

Hi Chris,

Go to SalesTableInteraction class and do the modification for the specific button control becoz in Ax 2012 for each action they have given separate class called suffix with Interaction class.

Regards,

Abbas

Hi Chris ,

In AX 2012 , Each List Page form handled by the “Interaction class” .

So for Sales order list page you have to add the below code in class SalesTableListPageInteraction / setButtonSalesOrder method for making non editable .

///

/// Enables or disables Sales order action pane tab menu items.

///

protected void setButtonSalesOrder()

{

this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, SalesCopyAllHeader), !salesTableInteractionHelper.parmReturnItem());

this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, SalesCopyJournalHeader), !salesTableInteractionHelper.parmReturnItem());

this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonCreateDropShipment), salesTableInteractionHelper.parmCanCreateDropShipment());

this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EditButton),false);

this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EditInGridButton),false);

}

based on current record If you want to make enable/disable then you have to add the parm method in salesTableInteractionHelper. see the above method for reference.

Thanks,

Azeez

Hi Azzez and Abbas,

I add parm method in salesTableInteractionHelper but still no luck…

Thanks,

Chris.

Hi Chris,

In SalesTableListPageInteraction check the setButtonSell method where in the third line allowupdate field controls the editing and deleting option of the form. and this field is initialized by salesTableType.checkUpdate(false, false) method. so if make this method return false it will disable the edit and delete option in the Sales Table form.

Thanks and Regards,

Kiran.S

Hi Kiran,

Sorry for the late reply.I checked the SalesTableListPageInteraction.setButton

boolean allowUpdate = salesTableType.checkUpdate(false, false);

and in SalesTableType.checkUpdate

I add this codes in the button:

//WORX COSTUMIZATION \
if (salesTable.wiz_SalesApprWorkflowState == WIZSalesApprWorkflowState::NotSubmitted)
{
ok = true; /return true;/
}
else
{
if (SalesTable.wiz_SalesApprWorkflowState == WIZSalesApprWorkflowState::NotSubmitted ||
(SalesTable.wiz_SalesApprWorkflowState == WIZSalesApprWorkflowState::Submitted) ||
(SalesTable.wiz_SalesApprWorkflowState == WIZSalesApprWorkflowState::PendingCancellation) ||
(SalesTable.wiz_SalesApprWorkflowState == WIZSalesApprWorkflowState::ChangeRequest))
{
ok = false; /return false;/
}
//WORX COSTUMIZATION \
}
}

return false;
}

all the status is non editable, the NotSubmitted status should be Editable.

Thanks,

Chris.