Hi,
please have a look inside DocuView form, doReSearch method, around line number 160 and below. Hopefully you will see that there is already some code there that sets variable called 'allowEditBasedOnActualForm'.
In my installation there is even some code for Norway, which checks the calling table and sets the variable based on some fields - looks like exactly what you need ?
if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoNO]) &&
(testCursor.TableId == tablenum(CustInvoiceJour) || testCursor.TableId == tablenum(ProjInvoiceJour)))
{
switch (testCursor.TableId)
{
case tablenum(CustInvoiceJour):
custTable = CustTable::find(CustInvoiceJour::findRecId(testCursor.RecId).InvoiceAccount, false);
break;
case tablenum(ProjInvoiceJour):
custTable = CustTable::find(ProjInvoiceJour::findRecId(testCursor.RecId).InvoiceAccount, false);
break;
}
if (custTable.EInvoice)
{
allowEditBasedOnActualForm = true;
}
}
Thanks,
Maciej
Tidak ada komentar:
Posting Komentar