1
votes

I have a suitelet in which i am running a html code to show a list of records in a html table format of a custom record type. I get the list of results from a search for loop. There i have given a delete button on each line and i want it to delete the record

I want to given button onclick action to delete the records on that line. I even get internal ID of the record

<td> <button type="button" class="btn btn-info btn-lg" onclick="record.delete({ type: "customrecord200",id: '+internalid+', }); "> <span class="glyphicon glyphicon-trash"></span> </button> </td>

1

1 Answers

0
votes

Basically to delete record in NetSuite you need to use N/record module as follows,

record.delete({ type: RECORD_TYPE, id: RECORD_ID });

As you mentioned you are using Suitelet to show list of records with button on it to delete the records. So you need to attach Client Script from your Suitelet like

form.clientScriptModulePath = 'CLIENT_SCRIPT_PATH'

and pass recordId(and recordType too preferably) to it on button click method which would then use above sample to delete passed record.