Business Requirement: Supplementary items functionality on Project Item Requirements
In standard Dynamics AX, the Supplementary Items functionality to calculate the number of supplementary items to be added to an order line is not available for item requirements. It can be added however easily to Project Item Requirements.
Solution: add the Supplementary Items functionality to Project Item Requirements
- Add a new MenuItemButton to the MenuButton control ButtonLinePriceCalc on the ProjSalesItemReq form.
- Set following properties on the newly added control:
MenuItemType: Action
MenuItemName: SuppItemCalc_Sales
DataSource: SalesTable - Override the clicked method of the newly added control and add following code:
void clicked()
{
Args _args = new Args();
;
_args.record(SalesTable::find(salesLine.SalesId));
SuppItemCreate::main(_args);
salesLine_ds.reread();
salesLine_ds.refresh();
salesLine_ds.executeQuery();
}
Do the necessary setup of a trade agreement of the supplementary items kind for a specific item. Add an item requirement for that item. Execute the Calculation of Supplementary Items: you’ll see the results according to your created trade agreement.
Continue reading......