Unable to expose a column in Data-Admin-Operator-ID class (PR_OPERATORS table)
Organization has their own Org structure, and most of the times PRPC data structure (Org>Div>Unit) is not sufficient. I assume there are lots of use cases that developer wants to extend Data-Admin-Operator-ID class to have custom organization properties. Let's say, we have a class MyCo-MyApp-Data-Department that have information about the organization.
- DEPTID (Identifier)
Now I want to have OperatorID instance to possess this data as this is critical element in this organization. Simply I have created a Single Page property which points to this MyCo-MyApp-Data-Department and now I can populate this data in my application. From clipboard this data is available in OperatorID page.
Since this property is very important and I want to use this in many Security implementation (ex. ARO), I need to expose this field. I know this class is out-of-the-box and not advisable to alter much, but I have to. Right-clicking to optimize this property in App explorer fails and PRPC shows an error message as below.
I believe there should be still a way, and this PDN article below also says "Create the columns manually for these properties" as resolution.
So I have done ALTER TABLE ADD COLUMN from Database directly and exposed this field. Having different names between database and PRPC was ideal, but since External Class Mapping is not possible because this Class is not editable (locked, and Class is not overridable), I guess we can't have different names.
I can give up having different names but can't give up exposing itself. So I have exposed this database column as DEPTID and also made the PRPC property name the same (DEPTID). In my understanding, as long as the property name and database name are exactly identical, PRPC automatically sees them both as the same thing (Correct me if I am wrong here). Now, I have resaved Data-Admin-DB-Table instance of Data-Admin-Operator-ID class and tried saving this Department ID data in OperatorID but it does not populate database column. I tried rebooting application server but the result was the same.
What is the proper way to expose a column for above scenario?
This is not working may be due to the reason that the data is not being set on the primary page. We had a similar requirement to expose additional column on PR_Operator table and save it while creating the operator. We use a separate activity to save the operators with this additional exposed column value.
This Operator ID screen is actual operator maintenance screen (Data-Admin-Operator-ID). I have overrode this out-of-the-box screen and therefore it is a primary page for Operator ID instance. PRPC should populate exposed column from Blob when the instance gets saved.
To make sure that your database mapping is working correctly, you can probably create temp activity and save the operator record there with DEPTID holding some valid value. once, this is confirmed, then you can check for the primary page issue, as mentioned by SwarnenduM
Nope, this is not about page issue. Like I said, I have overrode the operator ID screen and that means whatever information I type on screen is surely Data-Admin-Operator-ID class. It has right information saved in Blob and that is verified in clipboard.
This is an issue about Single Page property expose rather than Single Text property. As I indicated in my original post, the property I am exposing is a property under other Data class (MyCo-MyApp-Data-Department). So, DEPTID is not directly under Data-Admin-Operator-ID class but it is .Department.DEPTID. This is making a difference actually. If DEPTID were Single Text property under Data-Admin-Operator-ID class, then it should be working but since this is not, it is not working. If this is a custom class then I can use External Class Mapping (map .Deparment.DEPTID - DEPTID) but since this class is Pega shipped OOTB class, the class rule is locked and I can't add any entries. In this case, how can I create a mapping?
Thanks for your idea. Well, declare index is originally intended for array structure (page list) and this solution does not sound quite right for me. The 1st option is to expose a single Text property to hold the key that points to some other table. This way, I would always need to use JOIN operation and I was rather wanting to possess this data directly in this table for better performance as data volume is massive. Isn't there any way to accomplish this in shipped Pega class? This is very easy in custom class..
If the property is single value rather than single page then yes, you are correct and it works fine. But these two are relevant data set that is stored in the same row in Data class table and if it is not a single page then it will become completely different property and I would need to build a separate logic to handle these.
I assume it is not possible to expose a property under Single Page in shipped Pega class because External Mapping tab in class form is locked and edit is not allowed. So here are solutions:
#1. Create a single value property instead and expose it by ALTER TABLE ADD COLUMN from database directly. In this case I would let this field contain only the key which relates to other separate table.
#2. No expose. You can have a single page but there is no expose if performance allows.