Jeniffer
05/19/2025, 10:03 PMCeligo AI
05/19/2025, 10:03 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the issue you're facing is due to the fact that SuiteScript treats all fields in a column uniformly. This means that when you use
currentRecord.insertSelectionOption
, it will add the selection to all line item select fields, not just the one you're currently working with.
One workaround suggested in the conversations is to use a second field on your custom line record. This field would have all options available for the vendor, and when a line is committed and a value is set in your existing line level vendor field, you would copy the value of the vendor from that field to your basic field of the same type. This way, the value is stored and you don't care what options are now missing for lines which are already committed.
Here's a rough idea of how you might implement this:
1. Create a second field on your custom line record. This field should be a list/record vendor field with all options available.
2. In your User Event or Client script, when a line is committed and a value is set in your existing line level vendor field, copy the value of the vendor from that field to your new field.
3. You might need to add some show/hide fields logic to make it look better in the UI.
Remember, this is just a workaround and might not be the most elegant solution. It might also be a bit confusing for new users as to why there are two vendor columns, and the one they can edit behaves a bit weirdly. You could address this with documentation or training.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/19/2025, 10:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829051554
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828720391
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817749798
Celigo AI
05/19/2025, 10:03 PMCeligo AI
05/19/2025, 10:05 PM