Announcements
Hi All,
I have create Project DICD3FO_VASPackage inheritance Application Suite model
- Add Forms extension LedgerJournalTransDaily.Extension to my Project
- Form LedgerJournalTransDaily.Extension had ready DataSource LedgerJournalTrans
- Add DataSource "DICVASFields" to DataSource of Form Extension
- New tab in the Design pattern
- Add some fields of DICVASFields datasource to this TAB
- Input Data Method (DICVASFields_Extension::editAddress) and DataSource (DICVASFields) in to Field (Address) attribute
- Create class Name: DICVASFields_Extension
public static class DICVASFields_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public static edit DICAddress editAddress(boolean _set,DICVASFields _this,DICAddress _address)
{
// I want to get current datasource of LedgerJournalTrans in form LedgerJournalTransDaily.Extension to assgin to 3th param in the method setAddress
return _this.setAddress(_set,_address, ledgerJournalTrans);
}
}
Please help me find out the solutions
Thanks,
DonTran
The record already exists in the table LedgerJournalTrans have JourNumber = "00619 "
and Voucher = "ARPM004091", RecID = 5637161597
I add form Extension "LedgerJournalTransDaily.Extension" to add some fields from table DICVASFields to calculator but must get some data from datasource LedgerJournalTrans in that RecID Field.
Thanks
Maybe the record hasn't been saved yet. Record ID is assigned on insert.
Thanks Martin, You gave me good idea and I finished task with code:
FormDataSource fdsVASFields = _this.datasource();
FormDataSource fdsLedgerJournalTrans = fdsVASFields.formRun().dataSource("LedgerJournalTrans");
LedgerJournalTrans ledgerJournalTrans = fdsLedgerJournalTrans.cursor();
return _this.setAddress(_set,_address,ledgerJournalTrans);
By the way for me add one the question:
I got current datasource from ledgerJournalTrans and have value of some fields of table ledgerJournalTrans (Like voucher,...) , but special value of field RecID = 0.
I don't know reason why the value of RecID = 0.,
and help me how to get RecID of ledgerJournalTrans ;
Please help.
Models can't inherit from other modules. Do you mean that you've created a new model in a separate package and added a reference to Application Suite, or that you added another module to Application Suite package?
Regarding your method, you can call _this.datasource() to get the FormDataSource object nad then formRun() to get the form. When you have a reference to the form, you can call any of its methods, such as datasource() and you can get the active record from a datasource by cursor().
Thanks Martin Dráb, Do you have any solution for my question?
Hi DonTran, please tags for categories of your question; a sentence like "D3FO: How to get data from an another DataSource of Forms Extension in edit method: doesn't fulfil the purpose of tags.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,186 Super User 2024 Season 2
Martin Dráb 227,996 Super User 2024 Season 2
nmaenpaa 101,148