How to identify the Business Rule to reference when using the GetCodeDescription method

This article is exclusively for UKG Pro. If you use UKG Ready, please ensure the correct source is selected from the drop-down menu in the top right side of your screen.

Problem

In UKG, business rules store "master" data associated with an employee's record. This data can include information such as a list of jobs, locations, organizational levels, and so on.

When syncing UKG values with [target-system] , it may be necessary to access the business rule description.

To do this, we can use the GetCodeDescription method, which enables us to specify the particular business rule we are interested in and retrieve its description. The challenge lies in determining the correct code value to be passed into the GetCodeDescription method.

For example, the following expression references the location country code.

Location.CountryCode

However, what we need is the country name.

Solution

To obtain the country name, use the GetCodeDescription method. 

First, you must determine the specific business rule to reference. In UKG, go to Settings > Business Rules > Business Rules, find the Business Rule you want to reference, and hover your mouse over its name. 

A URL will appear at the bottom of the browser page (see screenshot below).

 

The URL at the bottom of the browser page will reveal the code, which we will need to reference in our expression.

In this instance, it's COUNTRY.

We can now use the GetCodeDescription method to modify our expression in Connect to AD:

Location.CountryCode.GetCodeDescription("COUNTRY")

Result

Now that we have referenced the business rule using the correct code value, we will see the full country name value come through. 

In this example, we can see that the "co" attribute is populated with "United States" instead of "USA."

The same method can be used for all UKG business rules, whether standard or custom-built ones specific to platform configuration fields.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.