Levi Pruss
09/08/2025, 2:45 PMCeligo AI
09/08/2025, 2:45 PMAI generated answer (using internal Slack threads):To create a custom field (inline) on the Work Order (WO) that will dynamically show the Transfer Order (TO) that links to that WO, you can use SuiteScript. Here's a general idea of how you can achieve this: 1. Create a custom field on the WO record. This field will be used to display the linked TO. Make sure to set the 'Store Value' option to 'No' so that it can be dynamically populated. 2. Write a User Event Script that triggers on the 'beforeLoad' event of the WO record. In this script, you will fetch the linked TO and set its value to the custom field you created in step 1. Here's a sample script to give you an idea:
javascript
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define(['N/record', 'N/search'], function(record, search) {
function beforeLoad(context) {
if (context.type !== context.UserEventType.VIEW)
return;
var woRecord = context.newRecord;
var woId = woRecord.id;
// Perform a search to find the linked TO
var toSearch = search.create({
type: "transferorder",
filters: [
["custbody_linked_wo", "anyof", woId]
],
columns: ["tranid"]
});
var toSearchResult = toSearch.run().getRange({start: 0, end: 1});
if (toSearchResult.length > 0) {
// Set the value of the custom field to the TO number
var toNumber = toSearchResult[0].getValue({name: "tranid"});
woRecord.setValue({
fieldId: 'custbody_linked_to',
value: toNumber
});
}
}
return {
beforeLoad: beforeLoad
};
});
Please replace 'custbody_linked_wo' and 'custbody_linked_to' with the actual IDs of your custom fields. This script assumes that you have a custom field on the TO record that stores the linked WO.
******
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
09/08/2025, 2:45 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851196408
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840515137
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820739806
Celigo AI
09/08/2025, 2:45 PM