Is it possible to edit a Sublist Subrecord in a Cl...
# suitescript
t
Is it possible to edit a Sublist Subrecord in a Client Script with SuiteScript 2.0? I notice in the docs that it says the CurrentRecord.getCurrentSublistSubrecord method loads the subrecord in View mode which makes me believe it can't be edited. Is that true?
g
Hi @Tyler, from my experience you'd need to work with both sublists and subrecords functions
t
Thanks for the response @Gustavo Doná - I'm not sure exactly what you mean though
g
You need to iterate through the sublist first and then use the subrecord functions
Copy code
customer.selectLine({
							sublistId: 'addressbook',
							line: i
						  }); 

						  var hasSubrecord = customer.hasCurrentSublistSubrecord({
							sublistId: 'addressbook',
							fieldId: 'addressbookaddress'
						});
						log.debug('Has subrecord',hasSubrecord)

						customer.removeCurrentSublistSubrecord({
							sublistId: 'addressbook',
							fieldId: 'addressbookaddress'
						});
						
						customer.commitLine({
							sublistId: 'addressbook'
						});
This is one I worked to delete subrecords..
I hope it helps
t
Thanks @Gustavo Doná, I'll give it a shot