Forum Discussion
aricgresko
1 year agoContributor III
How to find Entity's Currency in Application Database Tables
I'm working on a custom Table View that returns People Planning Plan Data for our users. The new requirement is to also bring in the Currency of the data. This means I need to bring in the Currency ...
- 1 year ago
You can loop through your data table you are pulling from People Planning and update each row by using the entity information in column X (I assume the entity is in a dedicated column), pull the entity ID, pull the currency using the GetLocalCurrency function, and update the column that shall display your entity's currency using:
BRApi.Finance.Entity.GetLocalCurrency(si, myEntityId).NameAs this uses loops and BRApis, this may not be as performant as you need it to be. Try to keep the displayed table small so that users do not feel the (possible) impact if necessary.
aricgresko
1 year agoContributor III
I'm writing this within a Spreadsheet Business Rule, so I can't steal your code exactly as it's written. Basically, I have a SQL query returning data from the XFW_PLP_Plan table. I've also added a dummy column within my SQL query where I was hoping to populate the Entity's Currency.
I'm happy to post the code if that is helpful. Thanks!
Henning
OneStream Employee
1 year agoYou can loop through your data table you are pulling from People Planning and update each row by using the entity information in column X (I assume the entity is in a dedicated column), pull the entity ID, pull the currency using the GetLocalCurrency function, and update the column that shall display your entity's currency using:
BRApi.Finance.Entity.GetLocalCurrency(si, myEntityId).NameAs this uses loops and BRApis, this may not be as performant as you need it to be. Try to keep the displayed table small so that users do not feel the (possible) impact if necessary.
- aricgresko1 year agoContributor III
Thanks - here's how I ultimately wrote the code.
Added dummy column in my SQL query.
sql.AppendLine(", CAST('' as VARCHAR) as [Ent Curr] ")Then was able to return the currency here. Definitely is slow looping thru but gets the job done.
If column.Name.XFEqualsIgnoreCase("Ent Curr") Dim entityName As String = DataRow("Entity") Dim entityID As Integer = BRApi.Finance.Members.GetMemberId(si, dimTypeID.Entity, entityName) Dim entityCurr As String = BRApi.Finance.Entity.GetLocalCurrency(si, entityID).Name columnValue = entityCurr End If
Related Content
- 2 years ago