Scenario
In this example we have a Power Pages website that has use spread across different countries, so multiple languages are installed on the site. When we display a message to a user we want to make sure the correct language is displayed. When a user opens the Create Case page, we want to tell them how many open cases their company has open.
Setup
In this example our portal has 2 languages installed, English and French. We will create the following in North52 to achieve the business requirement:
- 2 North52 xCache records to store the messages in English and French
- North52 formula of type ClientSide - Perform Action that will execute onLoad of the form
xCache Records
We create 2 xCache records with the same category and key, but we set the Language key to be the Location ID (LCID) of the different languages. The LCID for English US is 1033 and French is 1036. You can get the most up-to-date information on these numbers at this link: https://msdn.microsoft.com/en-us/library/cc233965.aspx
Formula
Setup
- Create a new formula, setting the following values in the Formula Guide
- Source Entity set to Case
- Set Formula Type to ClientSide - Perform Action
- Select the Decision Table editor
- Click the Create button
- Set the Name to Case - Portal - Set Open Cases Messages
- Expand the Source & Target section
- Set the Source Property under the Web - Create Case Events form:
- Ctrl-click Onload and Case Type
- Set the Source Property under the Web - Create Case Events form:
- Expand the Deployment Settings section
- Select the applicable website from the Portal Deployment list, in this example Customer Self-Service website is selected
- Click Save
Configure the Decision Table
- Set up the first Condition:
- Select column A, right-click and select Insert Condition
- Select cell A2, go to the Source tab and search for customer
- Expand the Source node
- Select Customer {Value}
- Select cell A4, go to the Functions tab and search for containsdata
- Hold down the CTRL key and click on the ContainsData function
- Set up the second Condition:
- Select Column B
- Select Functions and search for findcount
- Shift-click on the FindCount function. This will open the function wizard:
- Leave the Type dropdown set to Calculations
- Set the Friendly Name to be Count Open Cases
- Set the Entity Name field to be incident (you can find this by using the search button and searching for case)
- Select the search button beside the Where Attribute field and search for customer.
- Click on Customer and this will add it into the Where Attribute field
- Select the Select Attribute field then click on then Source tab and search for customer
- Select Customer {Value} and this will add it into the Select Attribute field
- Set the Default Value to be 0 and leave No-lock as true
- Click on Generate
- Select cell B4 and type >0 into it
- Set up the Action:
- Select cell C2
- Right-click and select Set Action Column Options > Set ClientSide Action
- Select cell C4
- Click on the Functions tab and search for setform
- Shift-click on the SetFormNotification function to show the wizard:
- Put your cursor in the Message field and click on the Source tab
- Expand the xCache node and PortalMessage node
- Click on the PortalMessages_caseCount xCache record
- Add a + symbol after the GetVar('PortalMessages_caseCount') function in the Message field
- Expand the Global Calculations node in the Source tab
- Click on Count Open Cases
- Set the Level to INFO and the UniqueID to be casecount
- Click Generate
- Click on a different cell on the Decision Table and then click Save
Your Decision Table should now look like this:
Testing
When you open a new case in French:
When you open a new case in English: