BhavayMangla
24 days agoNew Contributor II
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?
Please find the code below which I am using to update the description..
Dim SelectUD4 As String = args.NameValuePairs.XFGetValue("Param1")
Dim NewDescriptionUD4 As String = args.NameValuePairs.XFGetValue("Param2")
Dim UD4TextField As String = args.NameValuePairs.XFGetValue("Param3")
BRApi.ErrorLog.LogMessage(si,UD4TextField)
Dim member As Member = BRApi.Finance.Members.GetMember(Si,dimtype.UD4.Id,SelectUD4)
If member Is Nothing Then
Throw New Exception("Selected UD4 member not found")
End If
Dim newmember As New WritableMember(member)
newmember.Description= NewDescriptionUD4
newmember
brapi.Finance.MemberAdmin.SaveMemberInfo(si, True, newmember, False, Nothing, False, Nothing, False)
Any help would be appreciated.
Any help would be appreciated.
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 infoDim memberinfo As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si,dimtype.UD4.Id,SelectUD4,True)'Get member property from member infoDim memberproperty As UDVMProperties = memberinfo.GetUDProperties()'Set Text2 property as New propertymemberproperty.Text2.SetStoredValue(Scenariotype.Unknown.Id,DimConstants.Unknown,UD4TextField)'Save member info with text valueDim isNew = TriStateBool.TrueValueBRApi.Finance.MemberAdmin.SaveMemberInfo(si,memberinfo,False,True,False,isNew)