```record.submitFields({ 'type': 'calendareve...
# suitescript
n
Copy code
record.submitFields({
					'type': 'calendarevent',
					'id': taskid,
					'values':{
						'custevent_kesfs_eventtask_status': servicetaskstatus
					},
					'options':{
						'ignoreMandatoryFields': true
					}
				});
b
generally you can try seeing if you can set that value in the ui
though its somewhat complicated by you using submitFields
n
@battk its a custom field sourcing a custom list I created.
a
@Nick Calendar Events are very weird/not standard records... the statuses are not as regular records with IDs... they are just the text:
Copy code
DEFAULT_RESPONSE    : 'ACCEPTED',
CANCELED_STATUS     : 'CANCELED',
However, I was unable to change the status in any way...
n
@alien4u I was able to changed that satndard event status field but the custom one I created is the one giving me that error
b
your error is saying that the value (2) you are setting in custevent_kesfs_eventtask_status is invalid
go to the ui and set your custevent_kesfs_eventtask_status with the option with internal id 2 to verify
n
@battk I get null when returned
b
huh, i mean use the ui to set the field
dont run the script in the ui
generally the same restrictions in the ui exist in script
n
Okay I tried and it returned undefined in the UI
b
what does that look like
n
message has been deleted
Tried 2 and 3 and nothing. Didn't change the field and just returned undefined
b
as in set the field as if you didn't know script
find your field in the ui and select the option with internal id 2
n
Okay, I did that
It changed it
b
just to be clear, you only changed your one field
n
Yes
b
and the new option that is set is the one with internal id 2
n
Correct
b
if that works, try using the normal workflow of record.load, setValue, and save to save the field value
n
@battk that worked. Not sure why record.submitFields won't do it
b
without knowing how your field is setup, i would guess sourcing
n
@battk thanks for your help and figured out the issue. I had the field ALLOW DELETE OF LIST/RECORD VALUES? set to "Prevent and Return Error". Once I changed that, the submitFields worked. Thanks for the help!