Friday, December 30, 2016

Restriction of updation when modifying field value in Header(Purchase/Sales)

//Restriction of updation when modifying field value in Header(Purchase/Sales)'

Requirement: Need to restrict Warehouse updation from Header to line level

SalesPurchTableToLineUpdatePrompt - Dialog(method)
intiailize variable in method
update = false;
code:
Standard: line num -51
if (salesPurchTableToLineField.parmTableToLineUpdate() == TradeTable2LineUpdate::Prompt)
{
                refreshable = true;
Replace with :
if (salesPurchTableToLineField.parmTableToLineUpdate() == TradeTable2LineUpdate::Prompt
&& salesPurchTableToLineField.parmFieldId() != fieldNum("Field id "))
{
update = true;
refreshable = true;
}

Code:
Standard: Line Num(97)
return dialog;
Replace with:
if(update)
{
return dialog;
}
else
{
return null;   
}
//Related class list
//Common for purch and Sales
SalesPurchTableToLineUpdatePrompt
SalesPurchTableToLineField
SalesPurchTableToLineParametersForm
//Purchase
PurchTable2LineField
PurchTable2LineParametersForm
PurchTable2LineUpdate
PurchTable2LineUpdatePrompt
//Sales
SalesTable2LineField
SalesTable2LineParametersForm
SalesTable2LineUpdate
SalesTable2LineUpdatePrompt

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...