I’m trying to create a workflow to automatically s...
# ask-stanley-ai
m
I’m trying to create a workflow to automatically set the default Location on a Vendor Bill based on the Location defined on the Vendor. The problem is that when I use a workflow (after field sourcing), the Location is set correctly at first, but then when NetSuite continues processing (because of a script linked to the Subsidiary), the Vendor’s Location overrides it. So can I need to use after field edit based on subsidiary ? I was thinking about using a Client Script instead — maybe I should use an afterFieldChange event in my wf
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the issue you're facing is due to the sourcing chain in NetSuite. The location is controlled by the subsidiary, and the subsidiary is controlled by the vendor. This chain of sourcing is interrupting the workflow. One suggestion from the threads is to trigger the location from another field that gets set. For example, first set the vendor which sources the subsidiary, then use a workflow to set the location when someone adds an item to the PO, or changes the Memo field, or any other mandatory field. Another suggestion is to use a workflow or user event script to set a default subsidiary for new Locations. This should be done on before record load of the location record, as it provides the flexibility to change the subsidiary if required in the future. For defaulting a child subsidiary on all NetSuite transactions, a workflow to set field value before record load for all the transactions was suggested. However, it was also mentioned that workflows have an issue setting subsidiaries in some transactions, and transactions also source the subsidiary from the Customer. So it might be a consideration to set your customers to that Primary subsidiary. As for using a Client Script and an afterFieldChange event, it could be a viable solution. However, it's important to note that this approach might require more complex scripting and thorough testing to ensure it works as expected. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.869018614
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858703673
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848388791
Please provide your feedback on this answer.