SuiteScript : Track Original Transaction (the Copied From)

Script Difficulty: 💚💚💚

Ok, so have you ever wonder if a transaction is copied or created from scratch?  And if it is copied from another transaction, well, where did it come from originally?

In this exercise we have a client script that tracks your records as the users process the transaction in such a behavior.  The user start out by opening an existing record then clicking "Make Copy". The script kick off a series of validation checks and grabs its original transaction and dump it in a customer field (Type record).  The administrator (or power user) can later run a report base on this field for audits.

If the transaction is not copied (meaning it is created from scratch) then the custom field will left blank.  In essence, if you see a non-blanks in this tracking custom field, you know it is a copy.

The solution does a one pass check (it will only check as far back as one copied at a time).  If  the record has already make multiple copied passes, you can link those passes back and forth in the long list of report.

Note - if you don't have the script running on a certain record types (Sales Order for instance), the standard behavior of information passing will be triggered.  Which means, you can expect to see mismatching types of record in this field.  (Sales order have a copied from Quote).

Here is  the step by step to the Copied From Feature.



Comments

Popular posts from this blog

Troubleshoot : Purchase Order did not Auto Generate for Drop Shipping

SuiteScript : Defaulting Tax Code at Line Level

Saved Search Build : Find And Replace Substrings