How to create a Journal Entry through script

function createJournal(invoiceSum, reduceContext, cutomId) {       try {         let rec = record.create({           type: record.Type.JOURNAL_ENTRY,           isDynamic: true,         });         rec.setValue({           fieldId: ‘memo’,           value: ‘Script through created JE to write off the balance’         });         let accountObj = {           “debit”: 374,           “credit”: 119         }         for (let key in accountObj) {           rec.selectNewLine({             sublistId: “line”,           });           rec.setCurrentSublistValue({             sublistId: “line”,             fieldId: “account”,             value:… Continue reading How to create a Journal Entry through script

How to disable the column

if (scriptContext.sublistId == ‘item’) {           let lineNum = currentRec.getCurrentSublistValue({ sublistId: scriptContext.sublistId, fieldId: ‘line’ })?.toString()?.trim();           let lineKey = currentRec.getCurrentSublistValue({ sublistId: scriptContext.sublistId, fieldId: ‘lineuniquekey’ })?.toString()?.trim();           let lineIndex = currentRec.getCurrentSublistIndex({ sublistId: ‘item’ });           if (lineNum && lineKey) {             let lineValue = Number(currentRec.getCurrentSublistValue({ sublistId: scriptContext.sublistId, fieldId: ‘quantitybilled’ })?.toString()?.trim() || 0);             if (lineValue) {               let sublistObj = currentRec.getSublist({ sublistId: scriptContext.sublistId… Continue reading How to disable the column

How to create a search to find out the GL Impact changes within a record.

var itemfulfillmentSearchObj = search.create({   type: “itemfulfillment”,   filters:   [    [“type”,”anyof”,”ItemShip”],     “AND”,     [“posting”,”is”,”T”],     “AND”,     [“systemnotes.field”,”anyof”,”TRANDOC.IMPACT”],     “AND”,     [“systemnotes.newvalue”,”isnotempty”,””],     “AND”,     [“shipping”,”is”,”F”],     “AND”,     [“taxline”,”is”,”F”],     “AND”,     [“cogs”,”is”,”F”],     “AND”,     [“systemnotes.name”,”anyof”,”-4″],     “AND”,     [“mainline”,”is”,”F”],     “AND”,     [“systemnotes.date”,”within”,”today”]   ],   columns:   [    search.createColumn({      name: “date”,      join: “systemNotes”,      label: “Date”    }),    search.createColumn({      name: “name”,      join: “systemNotes”,      label: “Set by”    }),    search.createColumn({      name: “field”,      join: “systemNotes”,      label: “Field”    }),… Continue reading How to create a search to find out the GL Impact changes within a record.