Double open & close form

wilk_uwilk_u Member Posts: 94
Hi, I have a problem with my form, function in codeunit goes like this

//...
IF FORM.RUNMODAL(MyForm, rec) = Action::LookupOk THEN BEGIN
Finction confirming changes();
ED ELSE IF FORM.RUNMODAL(MyForm, rec) = Action::LookupCancel THEN BEGIN
Function Undo Changes();
END;

Problem is that I have to press cancel twice or just close it twice, program generates 2 form from pushing button opening form, which executes function which piece I wrote above. Function works on g/l entry records, making changes in added chcekobexes, if its relevant for this problem.

Any ideas? I really stuck.

Comments

  • DenSterDenSter Member Posts: 8,305
    You have to press cancel twice because you are running the form twice. Restructure your code to only run the form once, and catch the action in a variable. Then use a CASE statement to handle the different values.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.