Hi all,
I'm currently creating an Extension/App (upgrading an older solution). I added some page actions and created a Codeunit to handle the action events (OnBeforeActionEvent).
Is it possible to update the action calling page like it is in the action trigger of the page itself (-> CurrPage.UPDATE)? If not, maybe there is a work-around you know about?!
Thanks in advance.
0
Answers
I don't know of a work-around for this either.
that's sad news. I was hoping I missed something in the whole event thingy. Really unfortunate.
Thanks for your answer anyway :-)
@Kishorm to make page editable / non editable what you can do is to set a boolean variable on Editable property and make it true on OnInitPage() depend on some condition.
Moreover you can also call one page function to another but make sure function should not be LOCAL. By calling that function you can set the value of that boolean variable.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
@zohaibu95 You're misunderstanding this post. I know how to set the Editable property on a Page - that's not what this is about. It's about how to achieve this by using Events in separate codeunits - i.e. WITHOUT changing the Page object itself.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
@wittgenstein wants to add a new Action to a Page and within this action he wants to call the CurrPage.UPDATE to update the Page. However he wants to achieve this without making any changes to the Page object itself but by using Events mechanism introduced in NAV 2016.
That's exactly what I want. Even though it is possible in extensions to add new actions you can't add code to the actions' triggers. This is why I wanted to solve this with events.
So I chose the OnBeforeActionEvent and added my code. Unfortunately NAV doesn't pass the page object to the event so you are not able to make an update (CurrPage.UPDATE) on the page.
we need to wait for extensions 2.0 which is in preview
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I just used SendKeys to send an 'F5' to the page. I used the DotNet solution as there is a popup when running an Automation for the first time.