Tip:13 – Add Link to text in results of Netsuite Saved Search

Most of us must have faced the issue of Record Number/Name not displaying as a link but as a text in saved search results.

When in a saved search result, we need to show Parent -> Child -> Sub Child’s field, its difficult to create saved search on Parent record.

So we approach with saved search on Child Record, so that we can fetch column on Parent as well as its child’s column like:

Parent’s Fields<- Child -> Child’s Fields

But we need to make sure, that the saved search results should appear like the saved search is on Parent’s record.

In that condition sometimes, we won’t get link on Parent’s fields like its Number, its Customer/Vendor, so that on click of the link, we should redirect to Parent’s record instead of Child’s record.

Saved Search

I would link to share my findings on the same issue.

Solution:

Instead of adding Number/Customer Name/Vendor Name, add Formula(Text) in results column.

Ex:ย  For Number:

Column: Formula(Text)

Formula: ‘<a href = https://system.na1.netsuite.com/app/common/custom/custrecordentry.nl?rectype=484&id= ‘||{custrecord1401.internalid}||’>’||{custrecord1401.name}||'</a>’

Here remember below points:

  1. Use “<a>” HTML tag for adding link to the specific field in results.
  2. The “href”ย  value should be the address URL same as to open a new record of that type like: “<a href = https://system.na1.netsuite.com/app/common/custom/custrecordentry.nl?rectype=484&id=
  3. Netsuite uses “||” while adding fields to HTML tags. Use carefully while adding this symbol. Use “||” before and after the field name like ||{custrecord1401.name}||.
  4. ||{custrecord1401.name}|| should always be within single quote() like ‘||{custrecord1401.name}||’.
  5. Use the field within “<a>” & “</a>” like ” ‘<a>’||{custrecord1401.name}||'</a>’ “.
  6. Now add the internal ID field for “id=” parameter in the URL like: ‘<a href = https://system.na1.netsuite.com/app/common/custom/custrecordentry.nl?rectype=484&id= ‘||{custrecord1401.internalid}||’>’||{custrecord1401.name}||'</a>’.
  7. DON’Tย  use “+” sign while adding id field to the parameter that we generally do for other languages.
  8. Now click Add and “Save & Run”. Now you must be able to see the link on the Number/Name. On click of that, you must be redirected to that record.

Hope this tip will help you.

Comments/Suggestions are appreciated.

Thanks,

Asha

Advertisements

Tip 12: Add new page to suitecommerce advance website to set password and login to myaccount

This is my first blog on Netsuite suitecommerce. So lil bit nervous as I am not an expert on suitecommerce advance feature on Netsuite. But I am happy to share something on this which I have explored on my own. You are most welcome to add comments…

Some days before, I got a requirement as follows…

“Employee of the company related to the website will create a customer record with some temporary password. Once customer record is created, An email will be sent to customer with the link to reset the password. As soon as customer resets the password, he should be redirected to his account.”

When I started working on the requirement, I had faced some issues to achieve the result.

-I didn’t have much knowledge on SSP Application.

-Its difficult to get a clear idea on SSP application flow.

-The requirement was having both Password reset as well as login in one go.

I checked how Reset Password is working in SSP application.

Similarly I approached with some add-on.

Step 1: Create a template for Set Password let’s say “new_password.txt“.

Step 2: Decide, where do you want to attach that template to show that page in UI. According to that update the respective View.js file.

I have updated the Login.View.js file as I want to display the same in login touchpoint.

Step 3: As the login part is attached to Account module in Models.js, create a new file under Accounts module called Account.NewPassword.js which is responsible for client-side validation of the form as well as attach the respective .ss file if needed.

Step 4: Create a .ss file let’s say account.newpassword.ss under services folder and put all your back-end logic that will be executed when form is submitted.

So as per my current requirement, I have added code to get the customer related information from the parameter passed as well as new password and confirm password from the field.

To Reset the password, I am calling an suitelet script to reset the password, as I was facing some issue on doing the same in .ss file. But I am sure, we can do it in .ss file too.

On success of reset password from suitelet, I am calling the Account.login(email, password) to login to the site and redirect to my account page.

Remember: All new files added must be reflected in global.configuration.js file and all code should be reflected in Application.js. Else, you will face some issue of file/code not found.

I hope, you must have got some basis idea on how to add a new page and its back-end execution flow.

For any query, please add your comments below. I will surely get back to you.

Suggestions/corrections are appreciated ๐Ÿ™‚

 

Thanks,

Asha

 

Tip 11 – Show list of Partially/Pending fulfillement Sales Orders excluding dropship items

Hello friends,

This blog is related to a saved search which includes only sales order which are partially fulfilled or pending fulfillment.

Note: Let’s say if Client is using drop-shipment feature, that means, item will be delivered directly to customer from Vendor, which is nothing to do with client’s inventory.

Important:

Item drop-shipment feature can be used in two possible ways.

-We can directly check the Item Dropship checkbox in Item record itself, so that as soon as we add the item to the Sales Order, a Purchase Order will be created and that will be handled as Drop-shipment.

-Another way is to select an item which you want to opt for drop-shipment in that particular Sales Order, and select the “Drop Ship” option in Create PO column. A Purchase Order record will be created which will be used for drop-shipment.

Now let’s start creating the saved search.

Step 1: Create a saved search for Transaction record type

Step 2:

In Criteria:

-Filter 1: Type: Sales Order

-Filter 2: Status: any of – Sales Order:Partially Fulfilled, Sales Order:Pending Fulfillment

Now, to filter the dropship item in the saved search, you need to keep the below point in mind.

-When Item is checked for dropship in Item record, use below filter in criteria:

Case 1 – Filter 3: Item:Dropship Item is Yes

-When Item is selected for dropship in Sales Order record(select Dropship in Create PO column of Sales Order), use the following filter

Case 2 – Filter 3: Purchase Order:Applied To Link Type – is not – Drop Shipment

Remember, if you are using both in Item level as well as in Sales Order lever, use both the filters in “OR” condition using Advance Filter option.

Filter 4: Main Line is false

Filter 5: Shipping Line is false

Filter 6: Tax Line is false

Filter 7: COG Lina is false

dropship2

In Results:

Add the fields as per your result’s requirement.

Now save and run the saved search and see if you get the desired results.

Point to be noted:

-You can’t get the Create PO column in the filter criteria in the saved search.

-You can’t use Applying Link field in the filter criteria, as it will show all the transaction link that has been processed for the same item in the Sales Order. So, you may get the dropship item, even though you have filtered using the criteria, as it belongs to some other linked value along with dropship as below image.

dropship1

Hope next time when you get similar requirement, you won’t struggle like me.

Enjoy Coding ๐Ÿ™‚

Thanks,

Asha

Tip 10: Did you get an error “One or more cc emails are not valid” while running workflow in Netsuite??

While working on a requirement for sending email using workflow, I got an error

One or more cc emails are not valid.

I searched it in SuiteScript Error, but nothing helped.

Setting of CC field:

My requirement was to send email to cc emails which will be dynamic depending upon what user selects. So, I set the CC field(in Send Email action of workflow) value as internal ID of a field({custbody_cc_emails}), which holds multiple emails separated by comma.

When do I get the error:

While testing, I got to know that, I get the error, when user doesn’t select any email for CC. So custbody_cc_emails field is blank.

How to overcome the error:

I never get error on sending email, when the CC field is blank. They why error is coming, when the custbody_cc_emails field value is blank. It should simply carry the null value to CC field in Send Email action.

The Reason is still unknown to me.

But I found the way to get rid of that error, as User may or may not select the CC field({custbody_cc_emails}) in Transaction record. So we need the workflow to be worked in both the situations.

My Approach:

I have updated the Send Email action by setting condition formula as {custbody_cc_emails} is not null.

In this case CC field value is {custbody_cc_emails}.

I have created another Send Email Action, where I set the condition formula as {custbody_cc_emails} is null and left the CC field in Action as blank.

In this way, 1st Send Email action will be executed, when “custbody_cc_emails” field is not blank, and 2nd Send Email action will be executed when “custbody_cc_emails” field is blank.

Isn’t it cool ๐Ÿ™‚

Thanks,

Asha

Tip 9: Show Contact Lists in Sales Order to fetch contact emails and name to send email to Contact with cc other contacts in Netsuite

Have you ever got any requirement similar to below and if yes, here is a simple way to achieve it.

Requirement: On creation of a new Sales Order record, Sales Rep wants to have feature, which will allow them to choose a contact from all contact lists(of that particular Customer) to whom email will be sent addressing the Contact Name with some other Contacts as CC instead of sending email to Customer(as a Company) with addressing Company Name.

Current Feature: Currently they are sending to customer(as a company) company email addressing Company name. And there is no option to select other contacts for choosing as CC.

How to achieve it???

Step 1: Create a custom field called Primary Contact which is a List/Record of Type “Contact”. In the field record set the Sourcing as “Parent equals Customer” so thatย  the Primary Contact List will contain only the contacts belongs to that customer only.

primary contact

Step 2: Create a custom field “Primary Contact Email” of type “Email Address” which will hold the contact email when Primary contact field will be selected with a contact.

Step 3: Create a custom field “Primary Contact Name” of type “Free-from-text” which will hold the contact name when Primary contact field will be selected with a contact.

Step 4: Create a “Multiselect” custom field of type “Contact“called “Secondary Contact List” where user can select multiple Contacts. In the field record set the Sourcing as “Parent equals Customer” so that the Primary Contact List will contain only the contacts belongs to that customer only.

Step 5: Create a “Text Area” custom field called “Secondary Contact Emails” which will hold the email address lists respective to selection of contact for CC list.

contact lists

Step 6: Create a client script for Sales Order and in the field change event, write code for Primary Contact and Secondary Contact List field change, get respective emails and Contact Name(for Primary Contact). Deploy the script and test for any Sales Order, if on selection of Primary Contact and Secondary contact, respective emails and contact name is populated or not.

contact info

Now use the emails and contact name while sending emails.

Hope this small tip will help you ๐Ÿ™‚

Thanks,

Asha

Tip 8: How to set dynamic CC field value in Workflow SendEmail action in Netsuite

Recently I got a very interesting requirement from one of my client.

Requirement:

User will create a Sales Order record, email will be sent to customer’s multiple contacts through workflow.

Existing Feature:

Netsuite provides a CC textbox field in Send Email action in workflow where you don’t have option to select any field.

Then how to fetch it???

After exploring in different ways I got a solution for it which I like to share with you all.

Solution:

Create a “Text Area” field let’s say “Contact Emails(custbody_contact_emails)” in Sales Order record and populate the Contact’s emails with comma(“,”) separated.

Contact Emails

In the Send Email action of workflow, set that custom field id ({custbody_contact_emails}) in the CC fieldย  and save the state.

cc

Now execute the workflow and check, email is sent to the CC emails too ๐Ÿ™‚ ๐Ÿ™‚

Isn’t it simple???

Thanks,

Asha