Forum Discussion
Montreux
9 months agoContributor
Substitution Variables with Desc and User Culture
Hi, It doesn't look like the cube view ":name" override using substitution variables respects the user's culture setting. The substitution variable goes instead to the default description. My exam...
- 9 months ago
Yeah, that's just how it works for all "Desc" variables (MF, CV, POV). You're not wrong that it would likely be more elegant to translate them as necessary - although it would introduce a slight inconsistency, since other variables are not affected by Culture.
You can submit an Ideastream post and see where it goes. In the meantime, the workaround (as it's often the case) is to use an XFBR rule:
If args.FunctionName.XFEqualsIgnoreCase("i18n") Then ' get our dimension type Dim dimTypeStr = args.NameValuePairs.XFGetValue("dimtype", "A") Dim myDimType = DimType.GetItemFromAbbreviation(dimTypeStr, False, False, False) ' set option to get our translated strings Dim memOpt As New MemberDisplayOptions() With { .IncludeAllDescriptions = True } ' retrieve member info Dim memInfo = brapi.Finance.Members.GetMemberInfo(si, myDimType.id, DimConstants.Unknown, args.NameValuePairs.XFGetValue("name", "Root"), False, Nothing, memOpt) ' look up the translated description using the user's culture and return it. ' If not present, use default description. Return memInfo.Descriptions.XFGetValue(si.Culture, New MemberDescription()).Description End IfYou'd then specify it in your Cube View like this:
JackLacava
OneStream Employee
9 months agoYeah, that's just how it works for all "Desc" variables (MF, CV, POV). You're not wrong that it would likely be more elegant to translate them as necessary - although it would introduce a slight inconsistency, since other variables are not affected by Culture.
You can submit an Ideastream post and see where it goes. In the meantime, the workaround (as it's often the case) is to use an XFBR rule:
If args.FunctionName.XFEqualsIgnoreCase("i18n") Then
' get our dimension type
Dim dimTypeStr = args.NameValuePairs.XFGetValue("dimtype", "A")
Dim myDimType = DimType.GetItemFromAbbreviation(dimTypeStr, False, False, False)
' set option to get our translated strings
Dim memOpt As New MemberDisplayOptions() With {
.IncludeAllDescriptions = True
}
' retrieve member info
Dim memInfo = brapi.Finance.Members.GetMemberInfo(si, myDimType.id, DimConstants.Unknown,
args.NameValuePairs.XFGetValue("name", "Root"), False, Nothing, memOpt)
' look up the translated description using the user's culture and return it.
' If not present, use default description.
Return memInfo.Descriptions.XFGetValue(si.Culture, New MemberDescription()).Description
End If
You'd then specify it in your Cube View like this:
- Montreux9 months agoContributor
Hi,
Thanks for the reply and XFBR work around. I'll write a post in ideastream.
Related Content
- 3 years ago