Forum Discussion

BhavayMangla's avatar
BhavayMangla
New Contributor II
2 months ago

Updating Text1 using business rule

Hey Guys, I was writing a rule to update a member description and text 1 field of the same member. I was able to update the member description, but can anyone help me with the text 1 field? Ple...
  • BhavayMangla's avatar
    2 months ago

    I used the following solution..

    Dim SelectUD4 As String = args.NameValuePairs.XFGetValue("Param1")
    Dim UD4TextField As String = args.NameValuePairs.XFGetValue("Param3")
     
    'BRApi.ErrorLog.LogMessage(si,UD4TextField)
     
    ' Get member info
    Dim memberinfo As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si,dimtype.UD4.Id,SelectUD4,True)
    'Get member property from member info
    Dim memberproperty As UDVMProperties = memberinfo.GetUDProperties()
    'Set Text2 property as New property
    memberproperty.Text2.SetStoredValue(Scenariotype.Unknown.Id,DimConstants.Unknown,UD4TextField)
    'Save member info with text value
    Dim isNew = TriStateBool.TrueValue
    BRApi.Finance.MemberAdmin.SaveMemberInfo(si,memberinfo,False,True,False,isNew)