AnsweredAssumed Answered

Script Trigger - Finishing Help Needed

Question asked by lcot17 on Feb 23, 2016
Latest reply on Feb 24, 2016 by lcot17

Hiya,

 

Is it possible to ask for help finishing a script trigger.

I have two tables: 1) Product Options 2) Barcode Pool

Keys in each:

Product Options

__productOptionIDpk

_barcodeIDfk

Barcode No

 

Barcode Pool

__barcodeIDpk

_productOptionIDfk

Barcode No

 

In basic terms - I am trying to synchronise the two!

A barcode cannot be assigned to two product options, and because a product option cannot have two barcodes.

SO, when I assign a barcode in product options, I want to set the option ID in the barcode pool. This is because a calculation relies on it to calculate an availability status.


My script is intended to: (set to OnObjectSave)

1) Check if barcode ID value is set or empty

2) If empty, exit script

3) If set - set product option ID variable, set barcode ID variable, go to barcode pool and set the ProductOptionID in the record that matches the barcode ID.


The script I currently have is:

Screen Shot 2016-02-23 at 15.35.50.png

Can someone help me finish this script?

 

Outcomes