OnBeforeAction Event Page 42, Release button

andtry10andtry10 Member Posts: 1
Hi, Using the OnBeforeActionEvent on page 42 on the Release button.

The Event code is only triggered on the Tab: Actions, not on the Tab: Home.
I have made a function subscribing to this event and it trigger the code fine as long as I push the Release button from the Actions Tab, but it does not trigger from the Home Tab.
The button is the same, only that on the property it has Promoted = Yes

Does anyone know why ?

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I didn't try this. if you are sure about it then please check latest CU's if it is fixed or not. otherwise you can create a support case to MS to fix it.
  • DenSterDenSter Member Posts: 8,307
    If you subscribe to the OnBeforeReleaseSalesDoc event in codeunit 414, it doesn't matter from where you click Release
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    I think you should subscribe to " OnBeforeReleaseSalesDoc " in codeunit 414 as @DenSter specified.
    Its not a good idea to use OnBeforeAction Event for this purpose.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Lars_WestmanLars_Westman Member Posts: 116
    Problem is that page 42 calls the function PerformManualRelease in cu414. The events are placed in the Code function after PerformManualRelease has been executed, so the only chance to catch something before anything happens in cu414is to subscribe to OnBeforeAction of the release action.

    You need to be on build 46773 or later of NAV2016. In earlier builds the OnBeforeAction doesn't work on the home tab.

    I would really like generic OnBefore/OnAfter of ALL functions passing the parameters of the function as VAR:s. Maybe even buil't in handling of the Handled pattern. Wouldn't that be nice :-)
  • DenSterDenSter Member Posts: 8,307
    yes that sure would be nice, wouldn't it :) A MASSIVE amount of refactoring would have to happen in order for that to work though
Sign In or Register to comment.