Discussion
Best practice for changing a class from a data transform?
What is the best practice way of changing a class from a data transform? I want to specialize a class based on a property value.
If you hard set the pxObjClass from the data transform, you get a severe warning: Setting the pxObjClass property will change the class of the containing page. This is not a recommended best practice.
However, I've seen this as an example during an e-course.
Alternatives in my knowledge are:
- Using an activity in stead of DT with the Page-Change-Class method: This will also give warnings for using an activity;
- Using a function to call a generic activity 'ChangeClass' that only changes class using the Page-Change-Class giving in a param.
We can create a Data Transform at the Org level and Set pxObjClass with some Parameter.
Wherever it is required to change the pxObjClass, we can call this Data Transform by passing the Class name as a parameter.
By doing this, we can restrict the Severe warning to only one Data Transform.