Refreshing Master Form Data Source from Child Form

//Example when modifying checkbox value and modify parent datasource,
// it will have an error unless if you refreshing parent datasource after you modify it,

public boolean modified()
{
//AIFD_ custom exchrate custtrans -> ledgerjournal trans
#Task
LedgerJournalTrans ledgerJournalTransLoc;
FormDataSource fds;

//END

boolean ret;

ret = super();

//AIFD_ custom exchrate custtrans -> ledgerjournal trans
ttsBegin;
if(this.checked())
{
select forUpdate LedgerJournalTransLoc where ledgerJournalTransLoc.RecId == originator.RecId;
LedgerJournalTransLoc.ExchRate = CustTrans.ExchRate;
ledgerJournalTransLoc.update();
}
else
{
select forUpdate LedgerJournalTransLoc where ledgerJournalTransLoc.RecId == originator.RecId;
LedgerJournalTransLoc.ExchRate = 100;
ledgerJournalTransLoc.update();

}

ttsCommit;

fds = element.args().record().dataSource();
fds.research(true);

fds.refresh();
//END

 

return ret;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s