Skip to content

Instantly share code, notes, and snippets.

@axilaris
Created October 19, 2021 07:42
Show Gist options
  • Save axilaris/70a24cd73b76f3d6b6bbd0f8681518eb to your computer and use it in GitHub Desktop.
Save axilaris/70a24cd73b76f3d6b6bbd0f8681518eb to your computer and use it in GitHub Desktop.
/**
* @NApiVersion 2.1
* @NScriptType Restlet
*/
define([
"N/log",
"N/search",
], function (log, search) {
function post(context) {
log.debug('POST1 Context', context);
return JSON.stringify(getCustomRecords(context));
}
function getCustomRecords(context) {
var mycustomSearch = search.create({
type: search.Type.CUSTOM_RECORD + '1589',
title: 'Search Title',
id: 'customsearch_my_second_so_search',
columns: [{
name: 'id'
}, {
name: 'custrecord3987'
}],
filters: [{
name: 'custrecord3987',
operator: search.Operator.EQUALTO,
values: [context.custrecord3987]
}],
});
return mycustomSearch;
}
return {
post: post,
};
});
...
payload = {
"custrecord3987": "12345678",
}
...
@axilaris
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment