Show No. Series Selection on New Record

It4Ch1It4Ch1 Member Posts: 36
How do I undo a new record?

Situation:
In Sales Order Card form, I press F3, and a custom prompt came out.
Then decided that I want to cancel the new record.
The card still shows the new record.

Any suggestions? Thanks! :P

Answers

  • matttraxmatttrax Member Posts: 2,309
    You can't undo an insert. The change is committed to the database. Just delete it.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Unless you're in line form (journals, sales line, etc) where the delayed insert is turned on, once you push Enter, it's committed into the system.
  • kinekine Member Posts: 12,562
    It4Ch1 wrote:
    How do I undo a new record?

    Situation:
    In Sales Order Card form, I press F3, and a custom prompt came out.
    Then decided that I want to cancel the new record.
    The card still shows the new record.

    Any suggestions? Thanks! :P

    Why? What you want to solve by asking user if he really wants to create the record?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • It4Ch1It4Ch1 Member Posts: 36
    OnInsertRecord
    CASE STRMENU(SeriesList,0,'Please choose a series:') OF
      0 : BEGIN
            ERROR('Please push ESC to cancel');
            EXIT;
          END;
      1 : "No." := NoSeriesMgmt.GetNextNo(SalesSetup."Order Nos.",0D,TRUE);
      2 : "No." := NoSeriesMgmt.GetNextNo(SeriesCode[1],0D,TRUE);
      3 : "No." := NoSeriesMgmt.GetNextNo(SeriesCode[2],0D,TRUE);
    END;
    

    This is on Sales Order Form. in case the user push cancel, the form by default shows the next number, where as it should not. This is caused by one of the no. series being set default in the first place in the no. series list.

    the above code just prevent the user from going further.
    :|

    in simple terms, user hit F3, then decides not to add new record.
  • kinekine Member Posts: 12,562
    Why not just set the no. series to not be default? Than the user select the no. series through assist edit as standard way how to do that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • It4Ch1It4Ch1 Member Posts: 36
    kine wrote:
    Why not just set the no. series to not be default? Than the user select the no. series through assist edit as standard way how to do that...

    Then, how can I make the AssistEdit appear automatically after user push F3? (user dont have to push AssistEdit button)
    I haven't got a clue how to do that.
  • kinekine Member Posts: 12,562
    Ok, just teach users to press F3, Shift+F2 and you are done...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • It4Ch1It4Ch1 Member Posts: 36
    Thanks! =D>

    Got this around by using Automation.

    OnNewRecord()
    IF ISCLEAR(WSHShell) THEN
      CREATE(WSHShell);
      
    WSHShell.SendKeys('+{F2}');
    

    Worked like a charm! \:D/

    edit: this solution not related to the first issue.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    ](*,) ](*,) ](*,)

    This is a horrible solution. :thumbsdown:
    David Singleton
Sign In or Register to comment.