javascript - NetSuite SuiteScript - print quote with T&Cs -


We have a JS script that prints the quotation within the NetSwight. We have created a custom field with field ID: custbodytctype on the quote indicates which terms and conditions documents (showroom or contract) should be used. Based on the field, we used a if / else statement in the JS script, which is the text to use. However, it is currently calling showroom words only for all quotes so that some script is not working. Please help!

Here is the original script (which works fine):

There is a modified script which only displays the showroom words:

You have to change this part

  function printQuote (request, response) {var transactionId = request.getParameter (' TransactionId '); Var tcType = request.getParameter ('custbodytctype'); Var record = nlapiLoadRecord ('estimation', transactionId); Var employee = nlapiLoadRecord ('employee', record.getFieldValue ('salesrep'));   

to

  function printQuote (request, response) {var transactionId = request.getParameter ('transactionId'); Var record = nlapiLoadRecord ('estimation', transactionId); Var tcType = record.getFieldValue ('custbodytctype'); Var employee = nlapiLoadRecord ('employee', record.getFieldValue ('salesrep'));   

This is because you mentioned that the custbodytctype estimate is a custom field. In your current code, TCTE is always empty or ''.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -