0

Update Field in another table after update

Hi,

I am trying to update a 2nd table with a new record and add the SKU field from the first table.

Table 1 (Products) has a table reference to Table 2 (Stock Take Tracker). The new record gets created but the SKU does not popultae into Stock Take Tracker. The following code in on an after update field called 'stock level' on the Product table.

let myNewRecord := (create 'Stock Take Tracker');
let myA := text(SKU);
let myB := text('Stock Take Tracker'.'Stock Take SKU');
myNewRecord.myB := myA;

Reference from Stock Take Checker to Products in N:1.

Stock Take SKU is set on the Stock Take Checker table to show as:SKU.

Any ideas what is wrong?

Thanks

Matt

6 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    let myA := text(SKU);
    let myNewRecord := (create 'Stock Take Tracker');
    myNewRecord.('Stock Take SKU':= myA)

     

    Steven

    • Luck and Luck
    • Matthew_Luck
    • 3 yrs ago
    • Reported - view

    Hi, Thank you. I get the error:

    Expression must return a number or record ID:myA at line 3 colomn 36.

    Any ideas?

    Thanks Matt

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Maybe change first line into:

    let myA := SKU;

    the source field and the destination field must be of the same type. Both number fields or textfields.

    • Luck and Luck
    • Matthew_Luck
    • 3 yrs ago
    • Reported - view

    Hi,

    The following does not error....but does not work!

    let myA := text(SKU);
    let myNewRecord := (create 'Stock Take Tracker');
    myNewRecord.'Stock Take SKU'.SKU := myA

    Also when you go back into it is says:

    let myA := text(SKU);
    let myNewRecord := (create 'Stock Take Tracker');
    myNewRecord.'Stock Take SKU'.(SKU := myA)

    Not sure why?

    Thanks

    Matt

    • Luck and Luck
    • Matthew_Luck
    • 3 yrs ago
    • Reported - view

    Hi,

     

    THis did not work either:

    let myA := text(SKU);
    let myNewRecord := (create 'Stock Take Tracker');
    let myNewField := text(myNewRecord.'Stock Take SKU');
    myNewField := myA

    Can anyone help? No error, it just not update the field.

    Thanks

    Matt

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Matt,

    This works in attached example:

     

    Download example here:

    https://www.dropbox.com/s/lyomspfevzyf5bp/MrLuck.ninox?dl=0

    Steven

Content aside

  • 3 yrs agoLast active
  • 6Replies
  • 1040Views