RE: How to remove selected lines from suitelet sublist using suitescript 2.0?
I have created custom suitelet, added checkboxes and vendor bills in a sublist. If I select a checkbox for vendor bill and click on button, then selected vendor bill lines should be removed from suitelet. I tried to use removeline API, but its not removing those lines.
Below is client script function, which is calling from submit button.
function CallforSuitelet(context) {
var billArray=[];
var tempFlag="F";
var currentRec = currentRecord.get();
var lineCnt = currentRec.getLineCount({
sublistId: 'custpage_openbills_sublist'
});
for(var sublist=0;sublist< lineCnt;sublist++)
{
var checkbox=currentRec.getSublistValue({
sublistId: 'custpage_openbills_sublist',
fieldId: 'custpage_select',
line: sublist
});
console.log("checkbox",checkbox);
if(checkbox==true)
{
var billId=currentRec.getSublistValue({
sublistId: 'custpage_openbills_sublist',
fieldId: 'custpage_internalid',
line: sublist
});
billArray.push(billId);
alert("sublist line number="+sublist);
currentRec.removeLine({
sublistId: 'custpage_openbills_sublist',
line: sublist
});
}
}//sublist close
var billArrays=JSON.stringify(billArray);
console.log("billArrays",billArrays);
var suiteurl = url.resolveScript({
deploymentId: "customdeploy_sut_create_filter_suitelet",
scriptId: "customscript_sut_create_filter_suitelet",
params: {
'billarrays': billArrays
}
});
console.log("suiteurl",suiteurl);
window.open(suiteurl, "_self");
}//function close
Depending on the list type in your suitelet (https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4332704307.html#bridgehead_4332704307), this may not be possible.
Could you please explain the overall aim of the solution?