Friday, January 4, 2019

Display Web Store Tab for New Members of the Audience Group

There are instances where a web store tab is only available to certain group of Customers. Currently, using dynamic Group is a limitation since there may be a lag time when an entity is added to the dynamic group. To workaround the limitation, one can use Static Customer Group as the Audience on Tab, and a script would automatically add the customer to the Static Group upon registration.

*Create a Static Group
1. Navigate to Lists > Relationships > Groups > New
2. On Create Group page, select Static and choose Customer on dropdown list and click Continue button
3. On the Create Static Customer Group page, enter the following:
    - Name=Web Store Group (Static) 
    - On Members > Group Members subtab , select customers on the list 
    - Display in Website = False
4. Click Save

*Create new Web Store Tab
5. Navigate to Lists > Website > Tabs > New > click New Presentation Tab link
6. On Presentation Tab page , enter the following information: 
    - Label = Web Store Group Tab 
    - On Group multi-select field , select "Web Store Group (Static)"
7. Click Save
8. Add a User Event script on Customer record, create the script below:


9.Navigate to Customization > Scripting Scripts > New , click User Event link
10. In the Script File, click on the ">>" then choose "+ New" then File pop up window will appear
11. Click Choose File button then select the script file created on Step 8
12. In the After Submit Function , enter the name of the function
13. Click Save and Deploy
14. On the Script Deployment page, enter the following:
- Applies To = Customer
- Status = Released
- Log Level = Debug
- Execute as Role = Adminstrator
- On Audience tab , tick Select All checkbox
15. Click Save

* Register in Webstore
16. Navigate to Setup > Site Builder > Preview Web Site, click Preview Site link
17. On the Webstore, click Register link
18. Fill up the Customer Registration Form and click Submit button
19. Notice that Web Store Group Tab appears on the Webstore after logging in.
20. If you navigate to Lists > Relationships > Groups > click Web Store Group (Static) , notice that newly registered Webstore customer is added on the Group Members subtab.  




No comments:

Post a Comment