I am trying to do use the post method for a simple suitescript program, i am very new to this.
In Netsuite i have written a suitescript as follows.
function restPost()
{
var i = nlapiLoadRecord('department', 115);
var memo = nlapisetfieldvalue('custrecord225', ' ');// this is a customfield, which i want to populate the memo field, using rest client in firefox
var recordId = nlapiSubmitRecord(i);
}
i have created a script record and uploaded this suitescript and even copied the external URL to paste it in restclient.
In Restclient(firefox plugin), pasted the external URL, i have given the method as post, header authorization given, content-type: application/json, and in body i put in {"memo":"mynamehere"};
In this the error i get is
message": "missing ) after argument list
I even tried it by writting other suitescript programs the errors i get is as follows:
Unexpected token in object literal (null$lib#3) Empty JSON string Invalid data format. You should return TEXT.
I am kinda new to the programming world, so any help would be really good.
restPost
doesn't have any parameters. Check if you're missing them. You generally need some reference to the request object, and the data it contains. – TonyHfunction restPost(datain) { var i = nlapiLoadRecord('department', 115); var memo = nlapisetfieldvalue('custrecord225', ' '); var recordId = nlapiSubmitRecord(i); }
the error i get now is SyntaxError: Expected end of stream at char 21 – Vin