Skip to main content
Expert
May 17, 2023 11:57 AM UTC
Solved

Get member description in user's culture code

Does anyone know how to get the member description in the user's culture code?

ChristianW
Employee - Advisor
May 17, 2023 2:05 PM UTC

ok, you can access the descriptions with the memberinfo object:

 

Dim MemberIdOfAccount As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Account, "41010")
Dim test As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, DimTypeId.Account, MemberIdOfAccount,,,New MemberDisplayOptions(True,"en-US",True,False,False,False,False,0))

BRApi.ErrorLog.LogMessage(si, test.Descriptions("en-US").Description & " " & test.Descriptions("fr-FR").Description)

 

20 replies

ChristianW
Employee - Advisor
Employee - Advisor
May 17, 2023 1:36 PM UTC

Hi Markus

Do you need to know, how to load it? Or how to access it?

Cheers

Christian

MarcusHAuthor
Expert
May 17, 2023 1:40 PM UTC

How to access it. I am processing base members for Confirmation Rules and I want to show the user the member description in their language if it fails the Rule. I am currently using this to get the member list

Dim AllBase As List(Of Member) = api.Members.GetBaseMembers(BRApi.Finance.Dim.GetDimPk(si, UD6DimensionName), topUD6MemberID)

ChristianW
Employee - Advisor
Employee - Advisor
May 17, 2023 2:05 PM UTC

ok, you can access the descriptions with the memberinfo object:

 

Dim MemberIdOfAccount As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Account, "41010")
Dim test As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, DimTypeId.Account, MemberIdOfAccount,,,New MemberDisplayOptions(True,"en-US",True,False,False,False,False,0))

BRApi.ErrorLog.LogMessage(si, test.Descriptions("en-US").Description & " " & test.Descriptions("fr-FR").Description)

 

MarcusHAuthor
Expert
May 17, 2023 2:59 PM UTC

Thank you! 

Employee - Sage
May 17, 2023 2:30 PM UTC

BRApi.Finance.Members.ReadMemberDescriptionsNoCache(si, dimTypeId, memberId) should give you all the descriptions, then you can loop through them. Each MemberDescription has a MemberDescriptionPK with a property for the language, i think.

ChristianW
Employee - Advisor
Employee - Advisor
May 17, 2023 3:06 PM UTC
Dim MemberIdOfAccount As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Account, "41010")
Dim list As List(Of MemberDescription) = BRApi.Finance.Members.ReadMemberDescriptionsNoCache(si, dimTypeId.Account, MemberIdOfAccount)
Dim englisch As String = list.FirstOrDefault(Function(x) x.MemberDescriptionPk.Language = "en-US").Description
Dim french As String = list.FirstOrDefault(Function(x) x.MemberDescriptionPk.Language = "fr-FR").Description
BRApi.ErrorLog.LogMessage(si, englisch & " " & french)
Contributor
Jul 12, 2023 10:52 PM UTC

I love 'Dim englisch'. Endlich ein Tip in Deutsch!
But seriously, thank you so much for the tip. Exactly what we need to derive local account descriptions.