Updating UD4 Default value in UD1 using extensibility rule
Hello,
In another post user KarlT suggested the use of the UD defaults available for UD1.
I manually updated members, and the functionality is exactly what I need.
I need to update the field through a data load. UD1 members (Projects), will always have a single UD4 value.
In the current TransformationEventHandler rule I am updating text fields in my UD1 members. I thought I could just duplicate the code an update UD4Default. However it is not working. I know it is trying to update the UD4Default value, because if I manually assign a value, it gets cleared when I load.
My 2nd thought was that since it is a member selection and not a text field I needed the member id. Which is my attempt below.
Any thoughts or suggestion?
'A3 is the department (UD4) example 189
'UD1Attr1 is the project (UD1) example 14123
'D1_Defaults Members
Dim DeptId As Integer = BRApi.Finance.Members.GetMemberId(si,dimtypeid.UD4, A3)
Dim UD1Dept As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, dimtypeid.UD1, UD1Attr1, True)
Dim UD1DeptProperty As New VaryingMemberPropertyItem(cubetypeid.Unknown, scenariotypeid.Unknown, dimtypeid.Unknown, False, PropStorageType.TextType, 0, DeptId)
UD1Dept.GetUDProperties.UD4Default.SetStoredPropertyItem(UD1DeptProperty)
brapi.Finance.MemberAdmin.SaveMemberInfo(si, UD1Dept, False, True, False, False)
