I have a custom record with four fields Subsidiary...
# ask-stanley-ai
w
I have a custom record with four fields Subsidiary, Vendor, Subsidary Country (list/record: Country), Vendor Type(list/record: custom record) The fields Subsidiary Country is set to source the country from the subsidiary and the vendor type is set to source its value from a custom field on the Vendor. When creating new records using suitescript in record standard mode, the field Subsidiary Country is properly sourced but the Vendor Type is not. I'm saving with enableSourcing: true. What could be the problem?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the issue you're facing with the Vendor Type not being sourced properly could be due to a few reasons: 1. Order of Operations: The order in which fields are set in SuiteScript can affect the sourcing of other fields. If the Vendor field is set after the Vendor Type field, the Vendor Type field may not source correctly. Make sure that the Vendor field is set before the Vendor Type field in your script. 2. Script Timing: If you're using a User Event script, it might be that the script is executing before the sourcing has had a chance to take effect. You could try using a different script type or adjusting the deployment settings of your script to ensure it runs after the sourcing has occurred. 3. Field Configuration: Check the configuration of your Vendor Type field to ensure it's set up to source from the correct custom field on the Vendor record. Also, make sure that the custom field on the Vendor record is populated and saved before the custom record is created. 4. Script Errors: There could be errors in your script that are preventing the Vendor Type field from sourcing correctly. Check your script for any errors or exceptions that might be occurring. Remember to always test your scripts in a sandbox environment before deploying them to your live environment. If none of these suggestions solve your issue, you may need to further debug your script or review the configuration of your custom record and fields.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.854064822
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852722049
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844482303
Please provide your feedback on this answer.
Thank you for your feedback
w
Anyone looking at this problem should know that the problem was that the Vendor Type-list-field was set up to be filtered based on the Subsidiary Country. So the problem was a hen and the egg issue. The country needed to be sourced first so that the vendor type list could be filtered. But the order of sourcing was not possible to control.