We can achieve this by using + operator OR without operator Without + operator <#assign s = “Hello ${user}!”> ${s} Using + operator <#assign s = “Hello ” + user + “!”> Note : Assume that user is “Big Joe”. In both cases the output will be Hello Big Joe!
Author: Jasmine Jacob
To remove all intervening line breaks in a template
Use <@compress single_line=true>…</@compress> It aggressively removes indentations, empty lines and repeated spaces/tabs . Example: <@compress single_line=true> <#assign users = [{“name”:”Joe”, “hidden”:false}, {“name”:”James Bond”, “hidden”:true}, {“name”:”Julia”, “hidden”:false}]> List of users: <#list users as user> <#if !user.hidden> – ${user.name} </#if> </#list> That’s all. </#compress> OUTPUT List of users: – Joe – Julia That’s all.
Insert another FreeMarker template file into your template.
You can achieve this by using include. Syntax <#include path> or <#include path options> path: The path of the file to include; an expression that evaluates to a string. (With other words, it doesn’t have to be a fixed string, it can also be something like, for example, profile.baseDir + “/menu.ftl”.). Example: Assume /common/copyright.ftl contains: Copyright… Continue reading Insert another FreeMarker template file into your template.
Tags from Ecommerce to sync over to NetSuite using FarApp
Open FarApp account. Click On Mapping from list on the left hand side Click on Orders. Then you will see existing field mapping If you want to add new mapping Click on the Add row button on the top right corner. Then a dialog box appears ,In that choose the field in Netsuite to which… Continue reading Tags from Ecommerce to sync over to NetSuite using FarApp
Difference between ?? , has_content , if_exists in freemarker
?? tells if the left hand operand’s value is missing (means it’s null or undefined variable), and gives back false otherwise true (not missing) accordingly. ?has_content is very much like ??, except it also returns false for a 0-length string or empty array, etc.but It doesn’t return false for a 0, boolean false, etc. !… Continue reading Difference between ?? , has_content , if_exists in freemarker
Telling NetSuite that you have clicked the UI button “SAVE” onthe record.
We can do this by writing in the script. getNLMultiButtonByName(‘multibutton_submitter’).onMainButtonClick(this); return false;
Sent an email containing a bullet-point list
var listtodisplay = (function () {// listitems is an array of string to be listedvar string = “”;lisitems.forEach(function (item) {string += (‘<br>• ‘ + item.toString());});return string;})(); concatenate the above string listtodisplay to the Body of the email.
Create a link to another record in a Saved Search
NetSuite makes this easy with a Formula(text) field and “a” tag with a link to a record. Add the anchor tag as a Results column of type Formula(text). Example: Additional Features: Target=”_blank” If you want to open the record in a new tab you can add target=”_blank” to the end of your URL, like this:… Continue reading Create a link to another record in a Saved Search
Script Sample to create a folder under a specified folder.
If you want to create a folder under a parent folder, you have to include N/Record module. Then create a record of type folder. Set the name to the folder. Set the parent of that folder. const createFolder = (name) => { let folder = record.create({ //creating a folder type: record.Type.FOLDER, isDynamic: true, }); folder.setValue(“name”,… Continue reading Script Sample to create a folder under a specified folder.
Delete Files from File Cabinet using Mass Update.
Delete Files from File Cabinet using Mass Update. Navigation Lists>Mass update>choose files>delete file. Delete Files from File Cabinet using Mass Update. Enter the Search criteria to get all files to be deleted. Click on Preview to check the files going to be deleted. Click the checkbox under Apply if you don’t want to consider that… Continue reading Delete Files from File Cabinet using Mass Update.