Tip 18: Setting DisplayType of field in Suitescript 2.0

Hello Friends,

As I have mentioned in my previous tip, in Suitescript 2.0 developer guide, few points are mentioned wrongly as below.

If you look for how to set display type of a field in either help or guide, you will find as below image.

display_type

But when you use the same syntax its not allowing to upload the code that is

displayType = serverWidget.FieldDisplayType.HIDDEN

But when I changed the syntax by replacing “=” to “:” as below

displayType : serverWidget.FieldDisplayType.HIDDEN

it worked 🙂

Try the same trial method, if you face similar issue.

Hope this trick will help you.

Tip 17: Setting Checkbox in Suitescript 2.0

Hello Friends,

I am exploring Suitescript 2.0 recently and learning new things day by day and I believe I should share it with you all who are also learning Suitescript 2.0.

There are some features which either you won’t get it in document or its wrong in Developer Guide of Suitescript 2.0

Even though its mentioned that in Suitescript 2.0 Checkbox value returns true/false rather than “T”/”F” unlike in Suitescript 1.0, but remember, when you will set Checkbox value use “T”/”F” not true/false.

var fldObj = form.addField({
                    id: ‘custpage_fld_chkbox’,
                    type: serverWidget.FieldType.CHECKBOX,
                    label: ‘Extracting Account?’,
                    container : ‘custpage_tab1’
});
fldObj.defaultValue = ‘T’;

Hope this small tip will save your time and effort.

I will keep on adding tip on Suitescript 2.0

Happy Coding 🙂