I want to add "save & edit" button in Item ful...
# ask-stanley-ai
i
I want to add "save & edit" button in Item fulfillment, when click on the button transaction will save and open in edit mode.
c
AI 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:
Copy code
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. ******
Slack 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
Please provide your feedback on this answer.