Validate.Record

abby123
abby123 Member Posts: 6
Hi, beginner here. We're using 3.7.

I've got code in a dataport that populates a Description column (with the customer's name) using a validate function on the account no.

I would like to insert, at the end of the value populated in the Description column, an Invoice No. (pulled from another column in the spreadsheet). Is this possible? Would I somehow need to capture the value populated in the description field, store it in a variable and then assign the variable and the Invoice number to the Description field?

I hope this makes sense. Thanks for any help in advance!

Abby

Comments

  • bbrown
    bbrown Member Posts: 3,268
    Turn off the AutoUpdate/AutoInsert properties and handle them in your code after assigning the desired values.
    There are no bugs - only undocumented features.
  • CtrlShiftF11
    CtrlShiftF11 Member Posts: 29
    I'm almost sure that I understand your problem but I'll take a guess at it anyway. Is it that you're in say the OnAfterImport trigger of a dataport and you're trying to concatenate a value onto the end of a newly filled Description field? If so then you'll need something like...

    VALIDATE("No.");
    //Above line populates Description field if I understand your post correctly
    //now just add whatever you want on to the end of the Description field
    //(this could be another field value, variable, whatever you want.
    //Pay attention to the field lengths though because you don't want to end
    //up with a runtime error in a TextOverflow situation i.e. trying to Add a
    //20 character field value + a 32 character field value and storing it in a
    //field that can only accommodate 30 characters (like most of Navision's
    //text fields).

    Description += MyInvoiceNoVariable;
    //Here's how you would assign what is already there plus another value
    //onto the end of the field.


    Good luck,
    Andy Sandefer
  • abby123
    abby123 Member Posts: 6
    Thank you so much!! I knew it had to be something as simple as that!