Imran Hasan
10/24/2024, 11:47 AMCeligo AI
10/24/2024, 11:48 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems that adding a "Save & Edit" button in Item Fulfillment is not directly possible. However, you can achieve similar functionality by using a client script to load the record, alter it, save it, and then reload the page. Here is a sample code snippet that might help:
javascript
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(['N/record', 'N/currentRecord'], function(record, currentRecord) {
function saveAndEdit() {
var rec = currentRecord.get();
var recordId = rec.id;
var recordType = rec.type;
// Load the record
var loadedRecord = record.load({
type: recordType,
id: recordId
});
// Make changes to the record
// loadedRecord.setValue('fieldname', 'value');
// Save the record
loadedRecord.save();
// Reload the page in edit mode
window.location.href = '/app/common/entity/custjob.nl?id=' + recordId + '&e=T';
}
return {
saveAndEdit: saveAndEdit
};
});
In this script, replace 'fieldname', 'value'
with the actual field name and value you want to set. This script will save the record and then reload the page in edit mode.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/24/2024, 11:48 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840753317
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833474159
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829781234
Celigo AI
10/24/2024, 11:48 AM