Hi
I have DataItem Item Ledger Entry . I want on request page in a report it appears as Text Value . I want that it should appear as Dropdown and values should come from Dimension Table like below code
"Dimension Value".Code WHERE (Dimension Code=CONST(Sub-Center)) .
In this i want that ShortCut Dimension 1 Code in Dimension Value Table should be equal to User Location. Where i should write the code.
Thanks
*This post is locked for comments
I hope you have written it in On After Get record trigger of the report. You have to add a Findfirst or find statement before you display a message.
Customer.Setfilter("No.",CustNo);
IF Customer.FINDFIRST then
Message('%1', Customer."Customer Type");
Where you have written the above code? Is it on the OnPreDataItem? or simply testing?
If it's simply testing, you need to write the FIND statement before you write the MESSAGE statement.
Ok
Hi
I have written below code . It is giving wrong value in message.
Customer.Setfilter("No.",CustNo);
Message('%1', Customer."Customer Type");
what I meant is the Type of variable. When you declare a variable, you need to define the type : Page, Record, Code, Text etc...
Hi
Can u pls guide what is a page variable,table variable. Where to define.
Thanks.
You have write the below code on the Report Type - OnLookup(VAR Text:Text):Boolean trigger.
lvRecDimValue.SETRANGE("Dimension Code",'SUB-CENTER');
lvDimValues.LOOKUPMODE := TRUE;
lvDimValues.SETTABLEVIEW(lvDimValues);
IF lvDimValues.RUNMODAL = ACTION::LookupOK THEN BEGIN
lvDimValues.GETRECORD(lvRecDimValue);
lvSelectedValue := lvRecDimValue.Code;
END;
in the above code,
lvRecUserSetup is a table variable of "User Setup"
lvRecDimValue is a table variable of "Dimension Value"
lvDimValues is a page variable of "Dimension Values"
and lvSelectedValue is a variable of Code 20.
Now, the lvSelectedValue can be used in the "Item Ledger Entry" - OnPreDataItem() trigger like below:-
"Item Ledger Entry".SETFILTER("Shortcut Dimension 1 Code",lvSelectedValue);
hope this helps you.
Hi
U mean to say here
Report Type - OnLookup(VAR Text : Text) : Boolean
But how to pass that value to that Particular Filter
Thanks
Hi
Can u guide me how to go to OnLookUp Trigger . It is Item Ledger Entry Filter . I have not defined it in Request Page. When i click on Properties of this field In DataItem there is no OnLookUp Trigger.
Thanks
You need to write code on OnLookup Trigger
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156