Options

Sales Order Form

GDGD Member Posts: 49
How i can put in form 46 in the field Shipment Reason

a defaul value in order everytime the user opens the form this field will

have a default value?

gd

Comments

  • Options
    ara3nara3n Member Posts: 9,255
    Desing the form on triger onnewrecord set the value to what you want.

    "Shipment Reason" := 'tada';

    Ofcourse you could write it properly and and have a default value in some setup table and get and assign it to it;

    SalesSetup.get
    "Shipment Reason" := SalesSetup."Default Shipment Reason" ;
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Please, do not forget you are in the salesline table and validating the "No." field uses an INIT. You should restore the value there also.
  • Options
    GDGD Member Posts: 49
    HELLO,

    I AM SORRY I DID A MISTAKE ABOUT THE NO OF THE FORM IS NOT FORM 46 BUT FORM 42

    I PUT THE "SHIPMENT REASON" := 'SALES' ON FORM- OnNewRecord but
    i dont see anything when i run the form!!!!

    gd
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    If you want a default value in a field, do you want the user to change this? :?

    Maybe it is better to set the value when Inserting the record in the insert trigger of the table and make the field non-editable?

    You can add this field to the SalesSetup like ara3n said.

    It is not recomended to reset a value in a record whenever the form is opened.
Sign In or Register to comment.