Cancel insert record

xavigepexavigepe Member Posts: 185
Hi,

I want to cancel a insert action from the code. I need to send a Escape to Navision.

The user send F3 and I want to cancel this action.

What can I do?

Thank you very much.

Xavi [-o<

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Create a menubutton on the form. Put a menutitem in it with Shortcut-key F3.
    Give a name to the menubutton.
    In the OnOpenForm-trigger, give the properties Width and Height of the menubutton the value 1. This makes the menubutton virtual invisible and interecepts the F3 of the user.

    BTW: you can also put property "InsertAllowed" of the form to No. 8)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • xavigepexavigepe Member Posts: 185
    Thank you Kriki,

    But my problem is the following one. When the user want to insert a new contact he must introduce data in a new form.

    When the user press F3 a new form opens. When the user close the new form the form of the contact continues waiting for a new contact and I want to cancel this action.

    The user can push F3 but I, with code, must Cancel this action. When you push F3 and later you go to the last record, navision cancel de Insert trigger.

    I believe that this problem will be solved if I can send a Escape to navision or end the trigger but I dont know How.

    Thank you very much,

    Xavi
  • krikikriki Member, Moderator Posts: 9,118
    Search the forum for SendKey. There are posts about it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    I just don't understand your problem. If you catch the F3 by having a menu item with shortcut to F3 running your custom form, Navi should not insert a new record. Does it really do that?
Sign In or Register to comment.