Cancel Option addition on a form.

manisharma31manisharma31 Member Posts: 285
Hi,
This is the standard code in Codeunit 311 for checking sales line qty,

IF CheckItemAvail.SalesLineShowWarning(SalesLine) AND GUIALLOWED THEN BEGIN
OK := CheckItemAvail.RUNMODAL= ACTION::Yes;
CLEAR(CheckItemAvail);
IF NOT OK THEN
ERROR(Text000);
END;

When the form is open i have two option Yes or No.
Now i want cancel option on the form also,i.e Yes,No,Cancel.

If cancel is pressed then some process is done.

But if i add / modify the code to as,
OK := (CheckItemAvail.RUNMODAL= ACTION::Yes) or (CheckItemAvail.RUNMODAL= ACTION::Cancel);

i get error message to clear the form first.

How can i check on form the action pressed is Yes or Cancel.

Any Idea.... ](*,)
Regards,
Manish

Answers

  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kapamaroukapamarou Member Posts: 1,152
    Your code
    OK := (CheckItemAvail.RUNMODAL= ACTION::Yes) or (CheckItemAvail.RUNMODAL= ACTION::Cancel);

    ..calls RUNMODAL twice without clearing it....

    Try:
    OK := (CheckItemAvail.RUNMODAL IN [ACTION::Yes,ACTION::Cancel]);
    
    
    Does this help?
  • manisharma31manisharma31 Member Posts: 285
    hey kapamarou
    Thanks,it worked =D>
    Regards,
    Manish
  • kapamaroukapamarou Member Posts: 1,152
    You're welcome. :D

    You can mark the topic as solved now.
Sign In or Register to comment.