Hi,
Could you please tell how I can set a few xml fields inside one server event? I have code as below:
K2.Synchronous = True
Dim xmldata As String = K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value
Dim StrTime As String=DateString & " " & TimeString
K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:DataPostedByDate",StrTime)
K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:SalesManager","aPerson")
It only populate the filed of salesManager. However, if I move swap the last two lines of code, it only poulate the DataPostedByDate to the current date time.
Could you please help with this? Thank you very much.
Regards
Flo
Page 1 / 1
Hi,
I was given the solution, hope to share with you. It was because the xmldata was overwritten. The code below works:
K2.Synchronous = True
Dim xmldata As String = K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value
Dim StrTime As String=DateString & " " & TimeString
xmldata = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:DataPostedByDate",StrTime)
xmldata = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:SalesManager","aPerson")
K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value = xmldata
Cheers
Flo
I was given the solution, hope to share with you. It was because the xmldata was overwritten. The code below works:
K2.Synchronous = True
Dim xmldata As String = K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value
Dim StrTime As String=DateString & " " & TimeString
xmldata = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:DataPostedByDate",StrTime)
xmldata = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(xmldata,"my:RASPricingForm/my:SalesManager","aPerson")
K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value = xmldata
Cheers
Flo
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.