Hi All.
I have requirement to display new field Settlement id from LedgerTransSettlement on LedgerTransAccount form Overview tab depends on ShowOpen checkbox of this form. If checkBox is selected, the value in settle id should be empty, otherwise, LedgerTransSettlement.SettleId.
I have added class extenstension:
[ExtensionOf(formStr(LedgerTransAccount))] final class LedgerTransAccount_FRM_Extension { [SysClientCacheDataMethodAttribute(true)] public static display Num settleId(GeneralJournalAccountEntry _generalJournalAccountEntry) { return LedgerTransSettlement::findTransRecId(_generalJournalAccountEntry.RecId).SettleId; }
}
Also i have created form extension and added new string control Settle id with next properties:
Data Source: GeneralJournalAccountEntry
Data Method: LedgerTransAccount_FRM_Extension::settleId
It works ok, but the next step is how to get value of form CheckBox control in display method? I could not find solution for this approach.
Also i have tried another approach:
[ExtensionOf(formStr(LedgerTransAccount))] final class LedgerTransAccount_FRM_Extension { [DataSource] class GeneralJournalAccountEntry { public display Num SettleId(GeneralJournalAccountEntry _generalJournalAccountEntry) { LedgerTransSettlement ledgerTransSettlement = LedgerTransSettlement::findTransRecId(_generalJournalAccountEntry.RecId); if (showOpen.value()) { return ''; } return ledgerTransSettlement.SettleId; } }
}
But in this case what should be specified on form control property value for Data Method? If i just specify Data Method: settleId, i got the next error:
The data method 'settleId' was not found on the data source 'GeneralJournalAccountEntry' or its base table/view.
It makes me crazy, please help me to find right solution or approach.