Forum Discussion
The other option would be to lookup the StageRuleGroups directly.
You could either use plain old SQL for this (just ensure you don't open/close connections inside a loop) or the BRAPI methods to retrieve a datatable, using table name of "StageRuleGroups" and the lookup column "RuleGroupName". If doing this in a loop across multiple entities , in an Extender Rule, then obviously you should pull all the rows into a DataTable first, before entering the loop, and then lookup the row in a Dictionary object if you need to perform lookups inside a loop aross multiple entities. You don't want to continually be running SQLs inside a loop, or on every data unit being calculated ( For Finance Business Rules then cache the DataTable in the Globals object, or use the api.Functions.GetCustomBlendDataTable() to automatically read and cache a data table , which doesn't have to be a BI Blend table despite the name of the function ).
On this note, it's annoying that the lovely LookupRowFieldValue method, which (I believe) will return a single value for a particular field in a particular table, is only available for external databases...
Related Content
- 4 years ago