This topic contains 5 replies, has 0 voices, and was last updated by JacksonP 7 years, 11 months ago.
-
AuthorPosts
-
December 2, 2016 at 12:08 pm #1417
JacksonPI’m trying to set a multiselect field via setText, and it’s not working at all. The documentation says
If the field type is multiselect:This parameter accepts an array of string values.
This parameter accepts a null value. Passing in null deselects all currently selected values.
but strangely it’s not working at all.here’s the exact code im using
Code:
var prefBrands = customerRecord.getText({
fieldId: ‘custentity135’
});
eventRecord.setText({
fieldId: ‘custevent32’,
value: prefBrands
});
it’s returning[ “American Standard”, “Moen” ] Has anyone else run into this? Am I missing something?
This is a cached copy. Click here to see the original post. -
December 4, 2016 at 3:26 pm #1418
ironsidePerhaps, according to the docs the setText() method takes a fieldId and text (not value)?
-
December 5, 2016 at 8:01 am #1419
JacksonPI’ve tried both ways, with no luck.
-
December 5, 2016 at 8:44 am #1420
JacksonPI’ve been working in a beforeLoad userevent to try and set the values, and I could never get it working. When I tried setting the values in a pageInit client script it worked right away using a getValue, setValue.
I think it’s because in a beforeload the record isn’t loaded in dynamic mode, and you need to have real time sourcing for a multiselect field to be set.
-
December 5, 2016 at 1:14 pm #1421
david.smithI don’t think you can set or manipulate NetSuite fields beforeload. You can for fields that you create for the form on the fly but I don’t think you can otherwise.
A possible solution would be to create a custom field on the fly with the same options as the NS field and hide the NS field. On fieldchange of the custom field you could set the value of the NS field.
Maybe I’m wrong…. It tends to happen.
erictgrubaugh replied on 12/05/2016, 05:17 PM: Correct; in a beforeLoad event, you cannot change any field — native or custom — that is stored with the record (i.e. custom field with "Store Value" checked). If the field is not stored (for instance, a calculated or formula field), then you may modify its value in beforeLoad.
-
December 6, 2016 at 6:42 am #1422
JacksonPTo give you a broader view of what is going on, I’ve created a new event form, that sales reps click on a customer record, that pulls fields from the customer record and sets them to the new event. Which is all done in a beforeLoad… except the multiselect field, which I had to do in a pageInit. These fields on the new event record also write back to the customer record via a beforeSubmit. There’s also a sublist that i’ve created on the form in script that writes back to other records. I could only get the values for the sublist in a client script as well.
-
AuthorPosts
You must be logged in to reply to this topic.