Wednesday, May 29, 2019

Add a Custom Entity Field to the Profile Information Page of Reference My Account


Pre-requisites:

 

1.) From the Custom My Account, make sure that the librariesset are the scripts under your Custom My Account > ssp_librariesfolder.

 

2.) Service files from Reference My Account should also becopied to Custom My Account > services folder.

 

3.) Lastly, the custom entity field should have the WEBSITE checkbox checked under its record udner the Applies subtab.


To add a Custom Entity Field to the Profile Information Page of Reference My Account, perform the following steps:

A. Make sure that the Content Delivery Service library is selected in the My Account SSP Application
1. Navigate to Setup > Site Builder > SSP Applications.
2. Click the Edit link next to the Custom My Account SSP Application.
3. In the Scripts tab > Libraries subtab, make sure the following library is added:

Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. - Content Delivery/ContentDeliveryService/ssp_libraries/ContentDeliveryService.Models.js

4. Click Save.

B. Edit profile_information.txt to add the additional custom entity field
1. Navigate to Setup > Site Builder  > Web Site Hosting Files.
2. Click on Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. - My Account > Custom My Account > templates > profile.
3. Click the Edit link next to profile_information.txt.
4. In the Media Item field, click the Edit link again.
5. Add the code to display the additional custom entity field in the Profile Information page.

6. Click Save.

C. Edit the home_profile_macro.txt
1. Navigate to Setup > Site Builder  > Web Site Hosting Files.
2. Click on Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. - My Account > Custom My Account > templates > home > macros.
3. Click the Edit link next to home_profile_macro.txt.
4. In the Media Item field, click the Edit link again.
5. Find this code:


6. Add the following code below it:


7. Click Save.  

D. Edit the Models.js file to set and display the value of the Custom Entity field
1. Navigate to Setup > Site Builder  > Web Site Hosting Files.
2. Click on Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. - My Account > Custom My Account > ssp libraries.
3. Click the Edit link next to Models.js.
4. In the Media Item field, click the Edit link again.
5. Find the Get function for updating the Profile Information. Look for this code:

profile = customer.getFieldValues(this.fields);

6. Enter the following code after it.  This will display the value of the custom entity field in the Profile Information page if there is an existing value.
*Note: This only accommodates 1 custom entity field in the customer record; for 2 or more fields, code changes are needed.

7. Find the Update function that updates the customer's profile. Look for this code:

data.confirm_email = data.email;

8. Enter the following code after it. This will update the value of the custom entity field in the customer record.


9. Click Save.

E. For custom entity field with TYPE of Check Box,use the following codes:

 

NOTE: custentity_checkbox is the id of the custom entity field

 

1.      Under the profile_information.txt, use thefollowing:

No comments:

Post a Comment