Sales Order classes and Tables:
SalesOrder Creating:-
Tables:-salesTable, SalesLine, LogosticsPostalAddress, CustTable, MCRPrimaryAddressCust.
SalesOrder Confirmation:-
Tables:- SalesParmTable, SalesParmLine Table,
SalesOrder confirms data will be stored in these 2 tables
CustConfirmJour Table, CustConfirmTrans Table.
Picking List:-
Tables :- SalesTable, SalesParm Tables.
Packing List:-
Tables:-SalesTable, Salesparm Tables, CustPackingSlipJour, CustPackingSlipTrans when a packing slip is posted
invoice:-
Tables:-CustInvoiceTable, CustInvoiceTrans when invoice is posted.
SalesOrder Creating:-
Classes:-SalesTableType and SaleslineType classes will get called while creating the orders.
SalesOrder Confirmation:-
Classes:-SalesFormLetter
Picking List:-
Classes:-SalesFormLetter_PickingList
Packing List:-
Classes:-SalesFormLetter_Packingslip
invoice:-
Classes:-SalesFormLetter_Invoice
Purchase Order classes and Tables:
PurchTableType and PurchTableLine classes will get called while creating the PurchaseOrders.
PurchFormLetter_PurchOrder
PurchFormLetter_ApproveJournal
PurchFormLetter_Invoice
PurchFormLetter_PackingSlip
PurchFormLetter_ReceiptsList
My requirement is to display a confirmation popup before confirming a Sales Order
[ExtensionOf(classStr(SalesFormLetter))]
public final class SalesFormLetter_Extension
{
protected static boolean validateArgs(Args _args)
{
boolean ret = next validateArgs(_args);
if (ret)
{
SalesTable salesTable = _args.record();
ret = InterCompanyValidationHelper::validateCustomer(
salesTable.CustAccount);
}
return ret;
}
}
Helper class for validate to customer
public static boolean validateCustomer(CustAccount _custAccount)
{
CustTable custTable;
InterCompanyTradingPartner tradingPartner;
InterCompanyTradingRelation tradingRelation;
if (!_custAccount)
{
return true;
}
custTable = CustTable::find(_custAccount);
if (!custTable)
{
return true;
}
select firstOnly tradingPartner
where tradingPartner.CustomerParty == custTable.Party
&& tradingPartner.CustomerDataAreaId == custTable.DataAreaId;
if (tradingPartner)
{
select firstOnly tradingRelation
where tradingRelation.InterCompanyTradingCustomer == tradingPartner.RecId
&& tradingRelation.Active == NoYes::Yes;
if (tradingRelation)
{
if (Box::yesNo(
"You are trying to post a transaction for an intercompany customer. Do you want to continue?",
DialogButton::No) == DialogButton::No)
{
return false;
}
}
}
return true;
}
No comments:
Post a Comment