web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

OnOpenPage

(0) ShareShare
ReportReport
Posted on by 3,099

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 have the same question (0)
  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    You need to write code on OnLookup Trigger

  • jsshivalik Profile Picture
    3,099 on at

    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

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      U mean to say here

    Report Type - OnLookup(VAR Text : Text) : Boolean

    But how to pass that value to that Particular Filter

    Thanks

  • mmv Profile Picture
    11,471 on at

    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.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

    Can u pls guide what is a page variable,table variable. Where to define.

    Thanks.

  • mmv Profile Picture
    11,471 on at

    what I meant is the Type of variable. When you declare a variable, you need to define the type : Page, Record, Code, Text etc...

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      I have written below code . It is giving wrong value in message.

    Customer.Setfilter("No.",CustNo);

    Message('%1', Customer."Customer Type");

  • jsshivalik Profile Picture
    3,099 on at

    Ok

  • mmv Profile Picture
    11,471 on at

    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.

  • Tina Menezes Profile Picture
    2,582 on at

    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");

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans