How can I build a formula that runs a script to update attributes on another record?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have three tables.. SKU Table, Samples Table and Order Request Table.    SKU < Samples.   Order Request < Samples.

A Sample record states the specific use (taken from the Order Request) for a SKU. eg...

Sample1: SKU0001, [Qty] = 1 used for Product photography

Sample2: SKU0001, [Qty] = 1 used for Lifestyle1 photography


Each Sample has a calculated [Sample Status] that indicates whether it is 'Open' or 'Closed'. 

If multiple 'Open' samples share the same SKU and have equal [Qty] we only want to physically order one unit of that SKU and reuse it for each Order Request. 


The SKU record has attributes [Primary Sample], [Secondary Sample], [Tertiary Sample], ect.

The 'Open' Sample with the lowest Record ID tied to a SKU is the Primary Sample, then the next 'Open' Sample with next lowest Record ID tied to that SKU is the Secondary Sample and so on.. Tertiary Sample, ect. 


Samples have attributes [Inbound Tracking], [Location], [Outbound Tracking]

If multiple 'Open' samples share the same SKU and have equal [Qty], but do not have matching values on the above attributes we want to create a button on the sample record that users can click to runs a script that identifies the Primary Sample, copies the values of these attributes and replaces the values on the Secondary Sample, Tertiary Sample, ect. with the values of the Primary Sample. 

Trying to figure out how to write a script so this can be run on both the Primary Samples and the Secondary Sample, ect. so users do not have to navigate to the Primary Sample each time they want to sync values. 

Photo of Nicholas

Nicholas

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Your setup is a bit complicated to be able to answer on this Forum.  If you want one on one assistance, you can contact me off line via the information in my profile.

What I might be able to do on this forum is to help you with writing a URL formula button.  A URL formula button can do sequential actions when clicked as long as the record you are sitting on when clicked has the data elements required, for example knowing which record ID on which tale needs to be edited and which values need to be loaded into which fields.  

If that is your situation, then you may be able to rephrase your question like

How can I write a URL formula button which when clicked will Edit a record and do this, and then edit a different record and do that and then edit another tertiary record and do this  and then redisplay the XXX record.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
It would be helpful if you definitively listed every field under which table it is in. I am confused which table [Sty] is in and perhaps others. Also, your reliance on the primary, secondary and tertiary samples having increasing [Record ID#]s might cause a problem as there is no clear way you can inforce this constraint.

In any event I am sure you can do this with script.