On a regular custom list field that is sourced, is...
# suitescript
m
On a regular custom list field that is sourced, is there any way to append the list and add options? Example: List of employees filtered by transaction department = Employee department, but add two names that aren’t in the department? This is not a custompage. Or can expressions be used in a custom field filter?
c
Can you source from a saved search that explicitly adds in the employees you want?
m
I cannot. Do not have the ability to use a search. Good idea though.
I tried using a client script: billApproverList.push([{value: ‘1329’,text:‘John Doe’}]); No luck
c
Where does this field appear?
m
On a vendor bill. They wanted it filtered down to the same department on the record, but now want to add just two employees who are not in the same department.
c
And you don't have access to update the sourcing on the field definition?
Oh, it's dependent on the department selected on the bill huh?
m
It’s limited. I can’t seem to use expression for (OR Department = etc….etc.)
Yeah
c
Is that something a person could change while the bill is being edited?
the department that is
m
No because it’s filtered already. They can’t select what’s not there. I did the script with fieldChange. Would postSourcing function be better?
c
What I meant was: if there's a department field that's the source of the filtering for the employee field, can the department field be changed while the bill is being edited?
m
That would make total sense in an ordinary world, but they want to keep the department on the record as is.
c
Have you considered letting the field accept any employee and validating the choice using a map that includes the department plus the explicitly designated employees?
using validateField or saveRecord
m
You gave me hope there for a second. I reied changing the department, adding the employee and then changing it back. It cleared the field. Ugh!
c
Could you: 1. Make this field (#1) accept all employees 2. Add two other fields (#2, #3), one filtered by department and one that includes those two employees only (as an override) 3. Clear the value of #2 when #3 is changed and vice versa 4. Set the value of #1 to match what's selected in #2/#3, either when they change or on saveRecord
m
I will see if that works…
c
Good luck!
m
Thanks buddy!
@Clay Roper I found a workaround. I created a separate dropdown that could filter for those two employees. Then adjusted my workflow to use that field if the other field was blank. Thanks for your help!
1
c
Glad to hear you got it solved!