can anybody help me to add a value to the select f...
# suitescript
s
can anybody help me to add a value to the select field which is inside a sublist in a suitelet form but for different line of sublist there needs to be different value for the select field
t
how about you use a mapping for this?
s
ho can we use the mapping
t
you can create a config file or library then set a object contains your values
s
sir can you provide any samples
because the internal id of the select field is same for aa lines in the sublist
t
hmmm do you know what is "different line" on the other sublist?
s
sir i created a saved search on item and fetch the preferred vendor and set the value to the select field inside sublist but after execution the whole script for each item it shows the total vendor because the internal id of the select field is same for each iteration
t
so if I get it right, uhm you are trying to pull the record from your saved search and display it to a sublist on your suitelet form?
s
yes sir
yes sir and in that sublist there is a select field for each item row which have to show only preferred vendor of that item but in my case it showw all the vendor after completeing the whole iteration
t
I see.. I think what you need to do is when you get the result from your saved search, try to create a condition that will show only your preferred vendor
s
because i an using this code and there is no other option var venSub = form.getSublist({ id: 'itemsublist', line: j }).getField({ id: 'vendor' });                     venSub.addSelectOption({                         value: vendorId,                         text: vendorName                     });
okay sir, i am trying but if there is any sample related to this type of task please share
l
thumbs up 1
n
Another approach. Leave the sublist column with all vendors, make it disabled to stop the user changing it (presuming you don't want them to). Add script to ascertain the preferred vendor and set it either in a client script at line level or UE before submit for all lines.
s
sir how can we apply cliet script lineInit in this scanerio
n
You would probably do it on validateLine because you would need the item to be present when you evaluate the preferred supplier.
109 Views