Options

Adding\creating new field in a table.

rodbernardorodbernardo Member Posts: 34
Hello Gurus,


I want to add a new field in a table.

The new field is the same\equivalent to the primary key field, BUT, the length of the new field is only 3 characters.

How can I do that the table will always update the new field from the primary key field with only contain the first 3 characters?

I want also to add a code in OnValidate, that every transaction (update or modify) the new field will update from the primary key field – only the first 3 characters.


Please advice sometime tips to accomplish this scenario.


Thanks,


Rodel
Rodel Bernardo
Pressure is an opportunity.

Comments

  • Options
    itspeteritspeter Member Posts: 105
    Rec.NewField:=COPYSTR(Rec.PrimaryCode,1,3);
    

    Is this what you want?
    Regards,
    Peter Ng
  • Options
    rodbernardorodbernardo Member Posts: 34
    Thanks for the reply Peter,

    Yeah, that's what I am looking for, but, where should I put the code, is it in the onvalidate?


    Thanks again.
    Rodel Bernardo
    Pressure is an opportunity.
  • Options
    rodbernardorodbernardo Member Posts: 34
    I got it!!!

    Solve my problem.


    Thanks mate!
    Rodel Bernardo
    Pressure is an opportunity.
Sign In or Register to comment.