Netsuite Suitelet - Update view in sublist based on what is on the search form? - netsuite

I'm trying to display the data in the sublist based on the field input of the search form.

Create a client script create function for fieldChanged event and write operations for and don't deploy this script on any record, you have to use this client script in for using following code.
Use this
form.setScript('CLIENT_SCRIPT_ID);

Related

Getting data from netsuite using suite script

Can someone explain me how to fetch the record from netsuite (eg. if we click on the save button of inventory form, it should capture the record and display) using suite script.
thanks in advance.
You have to write a USER EVENT Script and deploy that script in the record (ex: customer record)
In the afterSubmit function of the script you can use scriptContext to get and display the value.
function afterSubmit(scriptContext) {
log.debug('scriptContext',scriptContext.newRecord); //You can see the record info on debug logs
}
If you want to get the data for some validation purposes you can use beforeSubmit function.

NetSuite - Adding Features to Standard Transaction Form?

Is is possible to add a script to a standard form in NetSuite?
My goal is to just display an inline text of a summation of a sublist column shown on the Bill of Materials Inquiry page.
You can deploy Scripts to Record Types or to Custom Forms. You cannot deploy Scripts to the other native pages like Search Results, a Report, or a list of all the Sales Orders.
Yes, unless you specify the customform field specifically, a script will run on every form.

How to pass a field bigger than 2000 characters from a SuiteScript script to a Suitelet script in Netsuite

I have coded a suiteScript (V1.0) form that loads a sublist. I check some lines in this sublist and I need to create a file with this line and another information and save it into the the file cabinet.
I was thinking create the field and populate the data with SuiteScript functions and pass the info by POST to the Suitelet script but I don't know how to.
Do you mean a Suitelet with a sublist?
If so,if the list is editable, you can get the sublist values through NetSuite api (request.getLineItemValue) on the POST action, you don't have to send it manually.

Remove NetSuite Sublist Button

I have a NetSuite Suitelet script that is listing all of a customer's credit cards so that they can edit the cards themselves.
I would like to remove the "remove" button from that sublist, if possible. I've looked all over the NetSuite support site, with no luck. Has anyone encountered this before?
Below is the code that I have:
var creditCardSublist=form.addSubList('custpage_credit_card_sublist','inlineeditor','Current Credit Cards');
/* this does not work */
form.removeButton('custpage_credit_card_sublist_remove');
/* this does not work either*/
creditCardSublist.removeButton('custpage_credit_card_sublist_remove');
Thanks for any assistance with this.
Actually client side is what you have to do.
You create a client script to go along with your suitelet.
use form.setScript... to associate it.
in the client script create an initLine function. That function can use jQuery (automatically included by Netsuite) to find and remove the Remove button.
This is a hack but Netsuite doesn't have any API for manipulating those lists
addSubList(name, type, label, tab) takes a type parameter, which decides the sub list type.
editor - An edit sublist with non-inline form fields
inlineeditor - An edit sublist with inline fields
list - A list sublist with editable fields
staticlist - A read-only segmentable list sublist.
So you might want to use a staticlist type.
use this jQuery in relevant client script.
jQuery(".uir-insert").remove();
jQuery(".uir-remove").remove();
jQuery('#custpage_so_sublist_insert').hide();
jQuery('#custpage_so_sublist_remove').hide();
Note:
you can only use jquery in clienscript so you must create client script along with suitelet script.

Lotus Script computed field handling

I am facing an issue in handling computed fields from lotus script agent. Please find below description:
There are two fields in Main form (web main form) Start Date and End Date,text fields,which are computed fields and are being computed using DBcolumn, and then on submit button, agent is called.
In lotus script agent I want to use values of these two fields, but I am unable to use them using document context but can not get the value of these fields.
Eg. EndDate=doc2.EndTime ( doc 2 is session.document context)
Any help will be appreciated.
You need to use EndDate=doc2.EndTime(0) as the field content is returned as an array (also for single value fields)
Got the answer, I had to call the agent on WebQuerySave instead of button click.

Resources