Insert and get the number

superbruger
superbruger Member Posts: 41
edited 2007-03-13 in Navision Attain
Hi all

If I use

SH.INIT;
SH.SetHideValidationDialog(TRUE);
SH.VALIDATE("Document Type",SH."Document Type"::Order);
SH."No." := '';
SH.INSERT;

Where SH = Sales Header, how do I get the "No." that was just inserted?

Its Attain 3.10

Regards,
Brian

Comments

  • SteveO
    SteveO Member Posts: 164
    You would need to change your INSERT to INSERT(TRUE).
    This is because the code that does the No. Series Management gets called from the insert trigger.

    After that you can just use SH."No." to get the number (the instance that the the trigger uses is the same instance that you are currently using).
    This isn't a signature, I type this at the bottom of every message
  • superbruger
    superbruger Member Posts: 41
    Yes (of course) :)

    My bad.

    Some times You just look and look, and cant find it .... :roll:

    Regards,
    Brian