issue: Extending NAV 2018 through VS code
Hi all, I am new in vs code. I want to extend NAV 2018 through VS code but there are some errors as follows: ( Take Page "Purchase Quote" for example )
-
I can not find all actions in VS code.
In NAV 2018, there is an action named "Release" but I can not find it in vs code. Therefore, I can not modify the Release action. (The error message shows that the action is not found in the target.)
note: "Release" in the pic is not the "Action" Release but the "Group" Release -
Can I modify the OnAction trigger in an existing page? In modify(), I just see two options: OnBeforeAction() and OnAfterAction().
Hope someone can kindly help me to solve these issues. Thanks in advance. :)
- Looks like a bug. We will investigate. The Group is actually named "Action3".
- You can't change the code in the original OnAction trigger. You can be only called before or after the original code. In the scenario we you wan't to completely change the behavior, the workaround is to hide the original Action and provide your own replacement.
Hi @esbenk, thanks for your reply. :) I put 3 messages ("1", "2", and "3") on different occasions: OnBeforeAction(), OnAction(), and OnAfterAction(). However, these three messages popped up after I pressed the action button. Is there any way to use OnAfterAction trigger to replace OnAction trigger in Visual Studio Code development environment? ( I don't want to modify my code in NAV development environment and use "vs code extension" to cover the original code.)
The message() function shows messages when all the server-side work is done. If you want to block code execution you can use Confirm() instead.
You can't replace code. Only hide the original action and provide your own with the same Caption/Icon.