Case when you want to perform search in a role and that role has no permission for that record

  1. Update the client script to send a GET HTTP request to a Suitelet that will run the search you want to run. Values can be passed using the URL parameters. For example:

https. get.promise({

  url: stSuiteletUrl + ‘&orderId=’ + stOrder

}).then(function(response){

  var objResponse = JSON.parse(response.body);

}).catch(function onRejected(reason) {

  console.log(reason);

});

2. Create the Suitelet that will run the search. Make sure it is configured to run as an Administrator.

  • URL parameters can be accessed using the context.request.parameters argument. For example:

let stOrderId = scriptContext.request.parameters.orderId;

scriptContext.response.write({

  output: JSON.stringify({

   status: ‘success’,

   results: arrResults

  });

});

Leave a comment

Your email address will not be published. Required fields are marked *