Scenario Overview
In this scenario we are using Microsoft Portals for our knowledge base website. We want the Knowledge Base Articles to have a custom URL to help with Search Engine Optimizations.
We wish for the Title of each article to influence this custom URL.
For details on how to set up free Microsoft Portals , please see Microsoft's Portal Documentation
North52 Decision Suite Solution
The North52 Decision Suite solution works like this:
- A formula of type 'Save - To Current Record' is created
- It is set to trigger when a Knowledge Article record is created or updated.
- The formula will take the info in the Title field and remove any special characters that would affect a URL
- It will then save this changed info into the Article Public Number field.
North52 Decision Suite Steps
The following set of steps outline how to create this Formula
- Create a new formula of type 'Save - To Current Record'
- Set Event to Create & Update
- Set Source Entity to 'Knowledge Article' **
- Set Source Property to 'Title'
- Set Target Entity to 'Knowledge Article'
- Set Target Property to 'Article Public Number'
- Copy & paste the formula below into the formula
- Click save & test
** For Knowledge Article to appear, you will need to have installed Microsoft Portals. Please see Microsoft's Portal Documentation
xCache
First we will need to create the xCache used by the formula. By using Xcache to list our Special Character exceptions, we are avoiding any syntax issues that may arise.
- Go to Settings > N52 xCache
- Create a new xCache
- Under Category , enter "CustomURL"
- Under Base Key , enter "CustomURL_And_Replacement"
- Under Value , paste in "&"
- Click Save
- Create a new xCache again
- Under Category , enter "CustomURL"
- Under Base Key , enter "CustomURL_Dash_Replacement"
- Under Value , paste in " ,---,--,/,\"
- Click Save
- Create a new xCache again
- Under Category , enter "CustomURL"
- Under Base Key , enter "CustomURL_Special_Characters_Replacement"
- Under Value , paste in "?,",#,.,;,:,*,^,%,@,},{,~,[,],`,|,<,>"
- Click Save
Formula
Smartflow(
SetVar('Custom_URL', Replace([knowledgearticle.title], xCacheGetGlobal('CustomURL_And_Replacement'), 'and')),
SetVar('Custom_URL', ReplaceMultiple(GetVar('Custom_URL'), xCacheGetGlobal('CustomURL_Dash_Replacement'), '-')),
SetVar('Custom_URL' , ReplaceMultiple(GetVar('Custom_URL'), xCacheGetGlobal('CustomURL_Special_Characters_Replacement'), '')),
Left([knowledgearticle.articlepublicnumber], '8') + '-dynamics-crm-365-' + GetVar('Custom_URL')
)
Quick Button
Please see article at this link for instructions on how to set up the quick button which will trigger this formula.
Once all three parts above are finished, you are ready to test.