This content has been marked as final. Show 11 replies
In iExpense each report line can have only one distribution information. So, in that case you may follow this approach,
--extend the "ExpenseAllocationsVO" to get the line amount in the VO.
--write a plsql function which would take the CODE_COMBINATION_ID and the LINE AMOUNT from the above VO. Do your validation in the PLSQL function and return appropriate value.
--Based upon the above value, you may write your logic in the VOImpl to display required error message.
Hope this helps.
Thanks. I'll try your suggestion.
A question though. Please correct if my understanding of how OAF works is incorrect.
Joining the table definitely would give access to the amount value from the lines table. However, the records we want to validate are before the save into the tables i.e. they are still in the VOs.
So the data at the time of the validation is still in memory. Would the application understand that the amount I enter in the LinesVO attribute should be reflected in the ExpenseAllocationsVO's extended amount attribute?
I have looked for an AO. But cannot find it. This would be the cleanest way to do this but there seems to be no AO. I'll keep looking.
I am assuming that there should be an AO somewhere as the EOs, LinesEO(Corresponding to LinesVO) and DistEO(Corresponding to ExpAllocVO) are FK related. Surprising that I cannot find it.
This is in Oracle iExpense. If you can make any suggestions from your experience that will be helpful.
Or can I create an AO my self? Something like extend both the EOs and create an Association between the Extended EOs. But again the join columns (Report_Line_Ids) are not created until the save/submit transaction. So I will not have them available prior to that which is the whole point-validate prior to save/doDml.
I got this working. Oracle does not use associations in these cases but sets the appropriate join fields as transient attributes whose values are derived from LinesVO.
I added some more transient attributes to the AllocationsVO and populated them with the LinesVO attributes.
This gave me access to the linesVO info in the AllocationsVORowImpl.
Although Oracle says that all validation logic should be placed in EO's, in the Oracle iExpense there are a bunch of validations that are performed at the VORowImpl level and quite a few pl/sql packages are called here. I just went by the same paradigm.
We have a similar requirement now and would like you to share some info regarding this
I need to get the Cost_Center from the ExpenseAllocationsVO() and Attribute5 from AllocationsLinesVO().
I have created a transient variable for Attribute5 in ExpenseAllocationsVO() (thru Extension and substituted the VO)
As you mentioned "This gave me access to the linesVO info in the AllocationsVORowImpl ", does it mean, now I will have access to Attribute5 of linesVO() in AllocationsVORowImpl ?
If so can you please let me know the sample code for this.
ExpenseAllocationsVOImpl expvo = expallampl.getExpenseAllocationsVO();
Row ExpAllRow = expvo.getAllRowsInRange();
for(int i=0; i<expvo.getRowCount(); i++)
ExpenseAllocationsVORowImpl allocrowimpl = (ExpenseAllocationsVORowImpl)ExpAllRow;
String x = (String)allocrowimpl.getAttribute('Attribute5");
Please confirm if this is the approach to be followed