Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

OnOpenPage

Posted on by 3,027

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

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: OnOpenPage

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

  • mmv Profile Picture
    mmv 11,465 on at
    RE: OnOpenPage

    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.

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: OnOpenPage

    Ok

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: OnOpenPage

    Hi

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

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

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

  • mmv Profile Picture
    mmv 11,465 on at
    RE: OnOpenPage

    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
    jsshivalik 3,027 on at
    RE: OnOpenPage

    Hi

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

    Thanks.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: OnOpenPage

    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
    jsshivalik 3,027 on at
    RE: OnOpenPage

    Hi

      U mean to say here

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

    But how to pass that value to that Particular Filter

    Thanks

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: OnOpenPage

    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

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: OnOpenPage

    You need to write code on OnLookup Trigger

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans