How can I prevent the creation of a journal entry ...
# general
v
How can I prevent the creation of a journal entry if a specific account is present in the lines, using the "*Return User Error*" feature in a NetSuite workflow?
m
There is no restrict user action for workflows
that doesn't exist
v
Oh, my mistake. I mean Return user error .
m
Oh i see
I don't think this is possible via workflow
Workflows cannot leverage the Lines of a journal entry
You could make a saved search with the criteria of Account = [specific account] and then use that saved search as the criteria of your Return User Error action
However it will only work correctly with After Record submit trigger, but that won't help because the journal would still be created, but then show the error after creation
So you would need a Client script that could check a checkbox on the Journal called "Contains xx Account". if one of the Lines has the account you don't want. Then do a Workflow with Return User Error, BEFORE SUBMIT if "Contains xx Account = TRUE"
Or a User Event script using the ERROR module on Before Submit
but unfortunately a WF couldn't fully support this