Where is my Category status?

The Dynamics 365 Category entity has certain peculiarities, like it doesn’t have a state and status attributes as many other entities in Dynamics 365 and the Common Data Service. In this article I’ll describe how to create your own custom Category Status and lock the attributes in the form accordingly.

Dynamics 365 Category entity doesn’t have a status attribute

Below you can see the list with all the out-of-the-box Category attributes:

Let’s say that we want to implement a similar functionality like we have in other entities where the attributes get locked when the record status is inactive. Since we don’t have a state/status attribute in the category entity, we are going to create a custom one:

Custom Status attribute with Active and Inactive options

Using this custom Status attribute with the simple options of Active and Inactive, we will lock the other attributes in the form using a business rule (let’s give it a try πŸ˜‰ :

Where is the Title?

Here is the other surprise, the out-of-the-box attribute Title is not available in the business rules. The same for the multi-select option set attributes, like “Other Business Areas”.

So what do we do? We need some JavaScript to implement this requirement. In the corresponding cartegory form, we add two events handlers, one when the form loads and another when the Status attribute changes:

https://github.com/rtebar/Dynamics-Utils/blob/master/Dynamics.Utils/Dynamics.Utils.Web/category_form.js

Both events reuse the main JavaScript function to lock the attributes:

https://github.com/rtebar/Dynamics-Utils/blob/master/Dynamics.Utils/Dynamics.Utils.Web/category_form.js

You can download all this code from my GitHub respository.

Below you can see a short video with the final result working. Hope you find it useful πŸ™‚

Short video showing the final result working

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s