Suitelet call not working on button click

Scenario: When adding buttons in the suitelet using HTML code. On the button click, it should redirect to another suitelet page, but it is redirecting to a blank page. Solution: This will happen when we use <button>tags and not mentioning the type properly. So that, it will work like default submit action. Mention the button… Continue reading Suitelet call not working on button click

CSV content truncated when passing from suitelet to html page

Scenario: CSV content passing from suitelet :  var csvContent = ‘Month-Year,Program,PO #,Billing type,Employee ID,Employee Name,Designation,Available Hours,Billed Hours,Invoice Currency,Invoice Rate,Invoice Value,Acsia Rate ($),Acsia Cost ($),Acsia Direct Cost ($),Customer Rate ($),Expected Revenue ($),Calculated Cost ($),Calculated Direct Cost ($),Actual Revenue ($),Gross Margin ($),Margin ($),Margin (%),Revenue Leakage ($),Resource Utilization (%),Actual RPE/Hr ($),Expected RPE/Hr ($),Direct CPE/Hr ($),CPE/Hr ($)n’;    … Continue reading CSV content truncated when passing from suitelet to html page

Pass CSV file data from suitelet and create the csv file in the html page

Scenario: We have a html page, which contains a generate report button. On clicking the button, the csv file should be downloaded. From the html page we are passing the values to the suitelet. From the suitelt the response data is returning to the html page. Solution: HTML: function call on button click:   var… Continue reading Pass CSV file data from suitelet and create the csv file in the html page

URL parameters are not passed properly through resolve url

Scenario: When we try to pass the parameters through url, but unable to get values from the parameters. var reportURL = url.resolveScript({   scriptId: ‘customscript_jj_sl_cpe_dashboard’,   deploymentId: ‘customdeploy_jj_sl_cpe_dashboard’,   params: {     ‘buff_filters’: buff_filters,     ‘otherFilters’: otherFilters,     ‘bill_filters’: bill_filters   },   returnExternalUrl: true }); var buff_filters = scriptContext.request.parameters.buff_filters; is not working where buff_filters=[[“custrecord_jj_cpebuff_billtype”,”is”,”Buffer”]] Solution: The issue might be related to how… Continue reading URL parameters are not passed properly through resolve url

Invoice Sales Order > Unexpected Error > Transaction was not in Balance OR Transaction was not complete

Scenario: Customer tries to Bill/Bill Remaining/Next Bill Sales Orders, but when attempts to save the Invoice page, an Unexpected Error occurs. The Error description could be “Transaction was not in Balance” OR “Transaction was not complete” Solution: Those Errors can appear when the Company does not have a default Accounts Receivable Account set, and Customer… Continue reading Invoice Sales Order > Unexpected Error > Transaction was not in Balance OR Transaction was not complete

Resolve UNEXPECTED ERROR When Using log.debug on URL With Parameters Using SuiteScript 2.0 N/log Module

Scenario: User is encountering UNEXPECTED ERROR when using the log.debug function of the N/log Module to log URL with stringified array parameters such as: /app/site/hosting/scriptlet.nl?script=<scriptid>&deploy=<deployid>&compid=<companyid>&ordersArray=%5B123152%2C1521512%5D Solution: To prevent encountering the error, User should utilize the JavaScript native method encodeURI() to escape reserved characters in the URL string. Include the encodeURI() method before displaying the URL… Continue reading Resolve UNEXPECTED ERROR When Using log.debug on URL With Parameters Using SuiteScript 2.0 N/log Module

Resolve error: “code”:”SSS_INVALID_SRCH_COLUMN_SUM”,”details”:”An nlobjSearchColumn contains an invalid column summary type

Scenario: Creating saved search in suite script which contains results having summary type. Solution: Check the field types. If the field type is numeric (e.g., Integer, Decimal Number), you can use “SUM”, “AVG”, “MIN”, “MAX”. If the field type is non-numeric (e.g., Text, List/Record), use “GROUP” or “COUNT”. If we are using summary types as… Continue reading Resolve error: “code”:”SSS_INVALID_SRCH_COLUMN_SUM”,”details”:”An nlobjSearchColumn contains an invalid column summary type

Dashboard Customization

Scenario: We need to create a html page and display it in the dashboard. Solution: Create the html page. Upload the html page into the file cabinet. Create Portlet script. Include the html page url as iframe in the portlet.(script given below) Personalize dashboard->custom portlet->select the portlet script. Portlet script: /**  * @NApiVersion 2.1  *… Continue reading Dashboard Customization

Generate a Suitelet form and automatically populate the sales representative field.

scenario: Generate a Suitelet form and automatically populate the sales representative field with the sales representative of the customer if the provided email address corresponds to an existing customer. solution: /**  * @NApiVersion 2.1  * @NScriptType Suitelet  */ define([‘N/record’, ‘N/search’, ‘N/ui/serverWidget’],     /**  * @param{record} record  * @param{search} search  * @param{serverWidget} serverWidget  */  … Continue reading Generate a Suitelet form and automatically populate the sales representative field.