Hi guys,
If in original form, there is a method Init() which is using element.args().dataset(), can we use the same in CoC of this form ?
Take example in the original form, the method init() has this code :
public void init()
{
LedgerJournalTable ledgerJournalTableCheck;
LedgerJournalTrans ledgerJournalTransCheck;
switch (element.args().dataset())
{
case tableNum(SalesLine):
salesLine SalesLineItemReq = salesLine::findRecId(element.args().record().RecId);
if (SalesLineItemReq.SalesType == SalesType::ItemReq)
{
curTransactionType = SubBillDeferralTransactionType::ItemReq;
}
else
{
curTransactionType = SubBillDeferralTransactionType::SalesOrder;
}
curSourceRecType = SubBillDeferralSourceRecType::SalesLine;
break;
}
}
I want to create CoC for this method init(), and still want to check whether the caller record is SalesLine
So I'm creating my CoC like this :
[ExtensionOf(formStr(SubBillDeferralTransactionDeferral))]
final class My_SubBillDeferralTransactionDeferralForm_Extension
{
public void init()
{
next init();
if (element.args().dataset() == tableNum(SalesLine))
{
}
}
}
But I have errors saying "element not declared", What is the correct way of doing it ?
Thanks,