Skip to main content

Adding and Populating a N:1 Relationship

We need to create a way to capture the global parent account on the account entities for reporting. Since the accounts were already created, this would need to be enforced after the fact. This solution will work if you need to create a data relationship for any fields you want to add.

It is not an elegant solution, but it works.

The attribute or field that was created needed to have a relationship tied to the account. So, I created a many to 1 (N:1) attribute to hold the global parent field. I made this field a business recommended, as it would be on all forms. The workflow, that I will explain later, can be set to fire on an account create action to tie the created account to the global parent account.

Here are the settings of the attributes.

Since there was already a parental relationship set with the account entity, a referential enforced relationship would have to be created. In this instance, this will be fine, as we do not want a tied record to be altered if the global parent account gets assigned, or altered. Only a cleanup process would need to happen (to re-assign the global parent), which would be from the workflow below.

Workflow

Here is a snapshot of the published workflow.

The first stage will check if the current account record has a parent account assigned, as it is assumed that when an account is created, they will be assigned a parent account if it is a sub account. If it does the workflow will progress, if not it will end. If there is then it will populate the global parent account field, with the associated parent account, as a baseline. We know that this is at least a possible global account for this account.

From there, it grabs the parent account value for the related global parent account and then applies that value, but only if that global account's "parent account" value is populated. If not then it ends.

Condition check:

Assignment of a value:

Note the Dynamic Value section. The fact that the Global Account field had a data relationship, allows the workflow to access related fields from that global account field, including it's parent account. From there we assign it, and the value is set up the chain.

The step is repeated in the workflow, to make sure that it grabs any deeper hierarchy's with the correct value.

I created an advanced find that grabbed all of the accounts that do not have a global parent account set. I then ran the workflow on demand the set the global parent.

Comments

Popular posts from this blog

SQl Upgrade Error - Access to the Path C:\Program Files\Microsoft SQL Server\110\License Terms\SQLServer2012_License_SQLBI_1033.rtf is denied

SQL Upgrade Error - Access to License Denied Ahh a wonderful time to experience an error, when you are upgrading SQL, during a limited window for downtime.  Sop much for the weekend plans eh? No worries, this one is easy.  In my case I received the following when downgrading an edition for a reporting Server that houses several instances.  After the first one processed, I received this error: If I browse to that path, we notice the file is set to read only. Easy enough, lets un-check read only and try again.  Success!  I had to do this for each instance install.  So if you have multiple instances be prepared to set the file to read/write each time.

SCSM Data Warehouse Cube / Dimensions do not process - Event 33573 / 35574

Recently I received an alert from our SQL server "OLE DB error: OLE DB or ODBC Error: Operation Cancelled HY008.   Around that same time, I found a few errors in our Operations Manager log on our SCSM 2012 R2 DataWarehouse Management Server.  Specifically Events 33573 and 33574. Event 33573 Warning Message : An Exception was encountered while trying during cube processing.  Message=  Processing warning encountered - Location: , Source: Microsoft SQL Server 2012 Analysis Services Code: 1092550657, Description: Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'WorkItemDim', Column: 'WorkItemDimKey', Value: '18553'. The attribute is 'WorkItemDimKey'..     Well, that appears that a overnight job did not run for our SCSM data warehouse.  However, when I looked at the Data Warehouse Jobs in the SCSM Console, all of the status were either set to Not Started, or success. Going back to the logs on the SCSM

PowerShell - Add telnet client to Windows Server 2012 R2

I was trying to check port specific communication on  a server, so I decided to power up good old telnet.  Much to my surprise it was not installed on the Server. PowerShell to fix that issue! Add-WindowsFeature telnet-client  All set.  No Reboot needed. -AJ