Hi, guys, I'm trying to create a workflow with som...
# general
u
Hi, guys, I'm trying to create a workflow with some conditions. There is a custom list field "A" in sales order. I want to import SO csv files. When importing a csv file, I want to check if the field A value exists or not. For example, I want to create a SO with a field value 001 for my custom field "A". Since I am creating a new record, I can just set "create a new record" on workflow. However, when I import a csv file with the same value "001" for my field "A" for the second time, I want to check if "001" already exists in my sales order, then if it does, I don't want to create a record since it will produce duplicates. Instead, I want to set the field value "001" in the field "A". I tried to set the condition and put formula "CASE WHEN {custbody_csv_value} NOT IN (SELECT {my_custom_value} FROM {customsearch_id}) THEN 'T' ELSE 'F' END" but it doesn't seem to work.. any idea how to fix my problem? {custbody_csv_value} is the value from the csv that I want to set, {my_custom_value} is a value from the saved search {customsearch_id}
m
Little confused. On your first import, are you creating sales orders or updating? Not sure I understand “check if the field A value exists or not.” on a csv creation import.
You need some kind of key on import. Are you using an external ID on the csv?
u
Hi, Michael sorry for the confusion, on my first import I'm creating sales orders, not updating.
and yes, I'm using an external ID on the csv.
So.. I'm creating 2 sales orders with CSV import. First one with the new field value A(creating the new custom record). The second one with the same value, but this time not creating the record, but just set the field value.
m
Hmmm. Does the second record have the same external ID?
u
NOpe
The user imports a csv file without knowing if the value already exists or not
m
Well, if there is no external ID, Netsuite assumes you are creating a new record. It has nothing to check against.
When you say “if value exists”….where?
on the csv or a NS record?
u
If the CSV value exists on the NS custom record.
@Michael McNamara Does it make sense? If not, let me know! I think using a script is better.. but I still want to know if it's feasible with workflow.