For calling the export API we need to configure the event which we want to triggered. Select the event and save the configuration record. After enabling create an ASN receipt and upon the status changes to verify and close will trigger the API and the integration log will fetch the details. Once we fetch the… Continue reading Export API in Infor
Author: Vishnu P
Infor ASN receipt Creation
Create an ASN receipt in INFOR for the purchase order. Click populate from PO from the Action tab and enter the purchase order number, upon saving the ASN receipt will create. Once ASN receipt created click the Tools tab and click additional downloads from the drop down, then a new page will show with the… Continue reading Infor ASN receipt Creation
Show alert message in Suitelet POST
/** * * @param scriptContext */ function alertMesage(scriptContext){ var html = ‘<script> alert(“The quantity should be greater than Zero”);window.close() </script>’; scriptContext.response.write(html) } The alert message will show and on clicking ok will close the whole suitelet page
Shopify NetSuite Integration via Heroku
Shopify NetSuite Integration via Heroku Functionality Overview Initial Heroku Setup and app creation GitHub implementation and deploying in Heroku Creating webhooks in Shopify Creating a script to connect to NetSuite (Restlet) and payload conversion Restlet in NetSuite to fetch payload and do updates Initial Heroku Setup Create a Heroku account and purchase a dyno (Eco),… Continue reading Shopify NetSuite Integration via Heroku
Check the account type
/** * @description Functions from N/config module encapsulated * @type {{isProduction(): boolean}} */const configFunction = { /** * To know whether the account is Production Environment or not * @returns {boolean} true when account is Production, false in all other scenarios */ isProduction() { var companyInfo = config.load({ type: config.Type.COMPANY_INFORMATION }); var ns_companyid = companyInfo.getValue({… Continue reading Check the account type
Check if the value is number or string
/** * @description To check whether the Given Value is a string or number * @param value * @returns {boolean} true if the given value is a string or number , else false */const isNumberOrString = (value) => { return (util.isString(value) || util.isNumber(value))};
To fix a float number to specified decimal parts
/** * @description To fix a float number to specified decimal parts * @param {Number|String} value * @param {Number|String} decimals * @returns {Number|String} */ const fixFloat = (value, decimals) => { decimals = (decimals) ? decimals : 2; // return roundFloat(parseFloat(value), parseInt(decimals)).toFixed(parseInt(decimals)); return parseFloat(value).toFixed(decimals); };
Round a float number
/** * @description To round a float number * @param {Number|String} value * @param {Number|String} decimals * @returns {Number} Floating Point Number with the given precision */ const roundFloat = (value, decimals) => { decimals = (decimals) ? decimals : 2; return Number(Math.round(parseFloat(value) + ‘e’ + parseInt(decimals)) + ‘e-‘ + parseInt(decimals)); };
Assign default value
/** * @description To assign a default value if the value argument is empty * @param {String|Number|Boolean|Object|Array|null|undefined} value * @param {String|Number|Boolean|Object|Array} defaultValue * @returns {*} either value or defaultValue */ const assignDefaultValue = function assignDefaultValue(value, defaultValue) { if (checkForParameter(value)) return value; else return defaultValue; }
Transforming transfer order based on item fulfillment
/** * * @param docNum * @param IFDetails * @param ifInternalId * @return {*|number} */ function IRcreation(docNum, IFDetails, ifInternalId) { try { let trecord = record.transform({ fromType: record.Type.TRANSFER_ORDER, fromId: docNum, toType: record.Type.ITEM_RECEIPT, isDynamic: true, defaultValues: {‘itemfulfillment’: ifInternalId.toString()} }); let itemCount = trecord.getLineCount({sublistId: ‘item’}); log.debug(‘in itemCount’, itemCount); for (let i = 0; i < itemCount; i++)… Continue reading Transforming transfer order based on item fulfillment