InitValue

kanikakanika Member Posts: 247
Hi people, I would to know if I can initialize a value in a table depending on the company that is open
for example
I am working in Company X and initialize the "location code" of the customer table to "B" but when I change companies and work with the company Y also initializes this field to "B" but I want to initialize it to "C "
How?
thanks

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You mean while creating the new customer or while choosing the customer in any document?
  • udayrmerudayrmer Member Posts: 171
    Yes you can do it by writing code on OnInsert of Customer.

    Add Custom Field on Company Information "Default Location", and Flow it to Customer when Insert.
    Uday Mer | MS Dynamics NAV Techno-Functional Consultant
  • kanikakanika Member Posts: 247
    Hi udayrmer
    OnInsert in the customer form???

    the "location code" exists in "company information"
    and i want
    customer."location code" := "company information"."location code"
    but I do not know how or where write it

    how I do "and Flow it to Customer when Insert"???
  • DenSterDenSter Member Posts: 8,307
    kanika wrote:
    OnInsert in the customer form???
    No NEVER write data code on the form, form triggers are supposed to be used for display purposes only. Data validation, default values, things like that go into the table triggers.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    kanika wrote:
    OnInsert in the customer form???
    OnInsert Trigger exists in table not form..
  • udayrmerudayrmer Member Posts: 171
    kanika wrote:
    Hi udayrmer
    OnInsert in the customer form???

    the "location code" exists in "company information"
    and i want
    customer."location code" := "company information"."location code"
    but I do not know how or where write it

    how I do "and Flow it to Customer when Insert"???

    Write it onInsert of Customer Table :)
    Uday Mer | MS Dynamics NAV Techno-Functional Consultant
Sign In or Register to comment.