Hello,
Currently I'm working on a report. First I created an option field 'Currency Code' in 'Value Entry' table with options: Select,INR,USD. Then in 'Inventory Valuation' report I have taken two fields from 'Value Entry' table i.e. 1. Cost Amount (Actual) (ACY) & 2. Currency Code.
In request page I have taken 'Currency Code' to create a filter on the report based on 'Currency Code'. So, If an user select the 'Currency Code' as 'USD' then he can only view the 'Cost Amount (Actual) (ACY)' field instead of 'Cost Amount (Actual)' field which is already been there.
For that I wrote the following code within Value Entry - OnAfterGetRecord()
IF "Value Entry"."Currency Code" <> "Value Entry"."Currency Code" ::USD THEN
EXIT;
"Value Entry"."Cost Amount (Actual)" := "Value Entry"."Cost Amount (Actual) (ACY)";
But I couldn't get the desired result. Can someone help me!
Thank You,
0
Answers
1- When you create a filter on 'Currency Code' = 'USD' (or INR) in the request page, only Value Entries that already have 'USD' (or INR) in the record in that field are processed in the report.
2- The code in the OnAfterGetRecord performs an extra 'filter function' and makes sure every record with "Currency Code" <> US is skipped (NOT processed, not shown, not printed etc.)
Does this make sense?