Hello,
I have a field named FirstName that has an OnAfterChange event handler. In this event handler I would like to make sure that the FirstName value is in sentence casing (i.e., "tom" or "TOM" would be corrected to "Tom"). My question is, what is the best way to update the FirstName field with the corrected value?
I know that I can just change
XDocument.DOM.selectSingleNode("my:myFields/my:FirstName").text, but is there another way to do this that doesn't require knowing the XPath? What I have in mind is to change a property equivalent to eventObj.Site.text or eventObj.NewValue.
Thanks,
Tom
UPDATE: After further research I found out that I needed to set a Boolean flag in order to prevent infinite loops in the OnAfterChange event handler (thanks to Greg Collins'
article). Now I can change the field value by updating either
XDocument.DOM.selectSingleNode(eventObj.MatchExpression).text or
eventObj.Site.text.