I want to disable a menu option if the current record is of the wrong type. I put this code into the ‘On Push’ trigger of the menu option. IF NOT “Branded Questionnaire” THEN BEGIN ERROR (‘This option only applies to branded questionnaires’); END; Nothing seems to happen. What might I be doing wrong ? By the way, I did look back through the old topics and saw one that related to this, which said that the accepted Navision practise was to do this. So I am confident that it must be possible …
Maybe “Branded Questionnaire” is a FlowField. Then you need to use CALCFIELDS(“Branded Questionnaire”).
No, it is a boolean.
Boolean also can be of FlowField type [;)]
Perhaps I should mention that this menu has no ‘Action’, just 2 sub-options.
[:D]If it has no action but sub-menu it will not perform OnPush trigger! You should put that code in OnPush trigger for all sub-menu items. I solved this problem with creating new button and disabling it.
Thanks everyone. I think I will adopt your solution, Arthur.