Posted: 29 Aug 2019 3:36 EDT Last activity: 30 Aug 2019 11:14 EDT
Populating new Properties added to Index Class (Declare Index)
We had an existing Declare Index in our application which was copying 3 work object embedded properties (of a PageGroup) to Index table. Now we want to copy 2 more properties from the same embedded PageGroup.
We have added 2 new properties to the Index class, exposed them, added mapping to appropriate WO properties in Declare Index and ran RecreateIndexesForClass passing Work class as parameter. Still didn't help in populating the new columns.
I understand that "Index processing occurs only if any of the Source Class Property values have changed from their previous values". But is there a way to update Index Instances even when there is no change in Source class property, but there is change in Index class structure.
You can create an activity which opens the case (work object) on a temp page and then call OOTB activity @baseclass.RecreateIndexesForInstance on the same temp page. The key is to set pzReindex property to true and save the work object. The OOTB activity does this for you. If you want to update all the cases, you just have to run this in a loop.
But OOTB activity RecreateIndexesForClass does the same by taking class as input, browses all the instances of that class and invokes RecreateIndexesForInstance on each instance.
I did run RecreateIndexesForClass by passing SourceContextClass and from tracer, I could see that even the Declare-Index got invoked. But new columns haven't got populated. Also, I've tried setting Lock and Release on commit on Obj-Browse.But didn't help.