Get a field value from Item fulfilment using sales order internal id

Suppose we have sales order internal id, and using that need to show a value from a specific field of item fulfilment.

Solution:
Use saved and export the search and use the same in suitescript. Adding sample search below.

var searchFilters = [

			["type", "anyof", "SalesOrd"],
						"AND",
			["applyingtransaction.type", "anyof", "ItemShip"],
						"AND",
			["internalidnumber", "equalto", data]

					];

var searchColumns = [
	new nlobjSearchColumn("internalid", null, "GROUP").setSort(false),
	new nlobjSearchColumn("custbody_og_connote", "applyingTransaction", "GROUP")
		]
var searchResult = Application.getAllSearchResults('salesorder', searchFilters, searchColumns) || {};
console.error('searchResult', searchResult)
var connoteField = searchResult.getValue('custbody_og_connote', "applyingTransaction", "GROUP");

Kindly note that if used “applyingTransaction” in search result, the use the same while taking field value from the result.

Leave a comment

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