In this final post on migrating Drupal 7 forums to an Adxstudio portal in Microsoft Dynamics, we’ll look at creating entities and workflows in DCRM to update the posts related to a thread and the total counts. This takes place with the upload of the 4th XML script we talked about in both Part 1 and Part 2.
Before we can create a workflow, we’ll need to create a new entity, Forum Update Thread. Click on the Customize the System link and it should open up a new window that will show you the Information and Components of your DCRM environment. Within Components, you’ll want to go to Entities and then New.
Creating the Entity
Once you get the New Entity screen, set the Display Name and Plural Name. In our case, it is Forum Thread Update and Forum Thread Updates. For the remaining areas, all you need is to make sure Duplicate detection is checked under Data Services. just select Notes and Mail merge.
Click on Save to Create the Entity and after a minute or more, it should be done and will appear in your Entities List window.
Creating Fields for the Entity
We need to create the fields that will capture the data we’re setting in the XML (script 4) file. We need the following fields.
1- Forum Thread
Display: Forum Thread
2- First Post
Display: First Post
3- Last Post
Display: Last Post
4- Post Count
Display: Post Count
Once you’re done, make sure to Publish your customizations.
Processes and Workflows
At this point, you should already have the 4th XML script, which is a Forum Thread Update (adx_forum_thread_update.php). We’ll now get to the Processes page in DCRM which is located in the Settings area. And we’ll start by creating a new process.
Creating a Workflow
Give it a name that you will remember and make sure to set the Category to Workflow and the Entity to Forum Thread Update. Once you’ve created it, it should be in the Processes List and the Status will be Draft. If you don’t have a pop-up blocker enabled, you should see a new window that allows you to configure the new workflow. Otherwise, click on it in the Processes list to continue with configuration.
In the Available to Run area, chose the “As an on-demand process” option. You can also set the Scope to Organization. From there, we’ll go to Add Steps in the lower part of the page. Choose Update Record and set the field to Forum Thread and click on Set Properties.
In this window, first start by clicking on the “First Post” field. On the Form Assistant to the right, in the “Look for” drop-down, set it to First Post (Forum Post), click Add and press OK. It should insert the value in the “First Post” field. Do the same for the Last Post. For Post Count, the Look for should be set to Forum Thread Update and in the drop-down below it, you’ll see Post Count.
Save and it should take you back to the initial configuration screen. Click on Activate. In the Confirmation dialogue that appears, continue with Activate. You should be returned to the Processes screen and your new process should have a status of “Activated”.
Import the XML Script 4 (Forum Thread Update)
We’re going to import the last XML script and this time, we’ll be mapping it to the record type, Forum Thread Update. Once you get to the Field Mapping, it should look like this.
Once you’re done the upload, go back to the Processes page and click on the Forum Thread Update process. When it opens up, go to the Process Sessions section and you’ll see the threads being updated one by one. When this finishes, you can go to your actual Forum and will see all the posts, comments and counts present.
One thing to keep in mind is that this won’t update the total Thread Count on the Forum’s properties in DCRM. You have this information in your XML Script 1 located at the bottom in the “Number” field. Enter that information in DCRM and that should complete the process.
Good luck with your new forums on Adxstudio!