Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Catch Event from page which has pre-defined option or function (use for Extension)

Posted on by 55

Hi All.

I can issue now - to catch Event from page which has pre-defined option or function.

E.g. we have page 5522 "Order Planning" (or another page, it is like for example).

We have pre-defined selection (like "Show Demand as") with some option for this worksheet.

E.g. I need to change line "Refresh &Planning Line" for Actions to my own, which do similar point. What I do:

1. I created new Action-line without code (because I plan to use it for Extension).

2. I created new CU and subscribed for "OnAfterActionEvent" Event for this page&action.

Issue - all good, but I need to receive value from this predefined function (it is "Show Demand as" from example), but have Rec only.

Can you hepl me some how? main point - I can't add code to newly created Action-line, because I need it for Extension.

Thank you in advance.

BR, Yuriy

*This post is locked for comments

  • RedFox Profile Picture
    RedFox 55 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Murat, thank you for your help and you show direction (I see "IncludeSender") and no angry at all.

    But I wrote example where I need to receive filters, which set by user on page. Looks like Business Event is solution, but I can't write code on page for Extension.

    Thank you again.

  • Muratvzr Profile Picture
    Muratvzr 743 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Because there is no event that handles your situation, So you create a new one for your inquiry. Am I making you angry? I just want to help you. Sorry If my solution seems inappropriate to your problem.

    Also, you don't want to change the code of  5522 this makes you have to do it on separate cu.

  • RedFox Profile Picture
    RedFox 55 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Sorry, but I have page 5522 and I have variable on this page (you can see it under "Show Demand as"). OK?

    Question - why I need to create new event publisher function on a separate (!!!) CU if I have all information on this page only?

  • Muratvzr Profile Picture
    Muratvzr 743 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    if I understood it correctly.  

    You should create a event publisher function on a sperate CU and add which variables you need to locals.

    And raise that event on your action code which you are writing on extension like :

    Myeventcodeunit.SampleEvent(rec, varx,varb );

    And than go and subcribe this event you dont need to modify 5522 or any objects

  • RedFox Profile Picture
    RedFox 55 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Murat, I wrote example above - page 5522 "Order Planning" and value for pre-defined selection "Show Demand as" should be transferred to CU (which should work similar to Action "CalculatePlan").

    main issue - it is for Extension and it is not allowed to touch standard code

    Thank you in advance.

  • Muratvzr Profile Picture
    Muratvzr 743 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Please give me more details about this which page and what is your local variable and where do u set this variable. I ll try to write a sample code for you

  • RedFox Profile Picture
    RedFox 55 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    Hi Murat Vezir.

    Thank you for answer.

    Could you advice me now how can I pass through local value from page (value from local variable) to Event (see my description and it is my question), if vent has Rec only?

  • Muratvzr Profile Picture
    Muratvzr 743 on at
    RE: Catch Event from page which has pre-defined option or function (use for Extension)

    I think you have to create a new Integration Event and passvalues to it and add this event subcriber.

    Maybe this will help you

    blogs.msdn.microsoft.com/.../integration-events-in-microsoft-dynamics-nav-2016

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans