Skip to main content
Contributor
Sep 24, 2024 7:04 PM UTC
Solved

How to get UD1 Default Values

Hello, 

I need to extract all the UD1 Default values and am stuck on statements 3 and 4 in the example below.  

Example using cost center 1100:

Dim strUD1Member As String = "1100"

1-Dim UD1Member As Member = BRApi.Finance.Members.GetMember(si, dimtypeId.UD1, strUD1Member)
2-Dim UD1MemberInfo As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, DimTypeid.UD1, UD1Member.Name, True)

3-Dim UD1Properties As UDVMProperties = UD1MemberInfo.GetUDProperties()  ?

4- ?

I appreciate any help you can give me.

Thanks!

 

 

Member
Sep 25, 2024 7:46 PM UTC

I went with your example.

 
Dim mbrUD1 As Member = BRApi.Finance.Members.GetMember(si, DimTypeId.UD1, "CourseMgt")
 
brapi.ErrorLog.LogMessage(si, BRApi.Finance.Members.GetMember(si, DimTypeId.UD2, BRApi.Finance.UD.GetDefaultUDMemberId(si, mbrUD1.MemberId, DimTypeId.UD2, -1)).Name)
 
You get a UD1, then you loop it through UD2 to UD8 and get the name.

4 replies

Member
Sep 24, 2024 7:16 PM UTC

BRApi.Finance.UD.GetDefaultUDMemberId

cap08Author
Contributor
Sep 25, 2024 7:13 PM UTC

Hi ckattokaran 

How does this work with getting all UD1's and their UDDefaults?  I'm not very well versed in the BRApi's. If you don't mind to, could you give me an example? 

Thanks!

 

Member
Sep 25, 2024 7:46 PM UTC

I went with your example.

 
Dim mbrUD1 As Member = BRApi.Finance.Members.GetMember(si, DimTypeId.UD1, "CourseMgt")
 
brapi.ErrorLog.LogMessage(si, BRApi.Finance.Members.GetMember(si, DimTypeId.UD2, BRApi.Finance.UD.GetDefaultUDMemberId(si, mbrUD1.MemberId, DimTypeId.UD2, -1)).Name)
 
You get a UD1, then you loop it through UD2 to UD8 and get the name.
cap08Author
Contributor
Sep 25, 2024 8:23 PM UTC

Got it! Thanks!!