ondataupdated() set customField
Content
Currently, if an agent chooses a specific disposition ID in an Incident, it pings an external service to get back the necessary UUID, and then save it to the custom field on the contact. This works fine, but the data is only saved to the custom field when a save is performed on the Incident which is not the desired outcome. Rather the data should be saved to the field as soon as the saveUUID function is called. Any help is appreciated on this.
Version
May 2017Code Snippet
<script type="text/javascript"> var initialDisp = window.external.Incident.Disposition; var i = window.external.Incident; var c = window.external.Contact; var cemail; var serviceResponse; function ondataupdated(obj) { if (obj == "Incident") { if (initialDisp != i.Disposition) { var newDisp = i.Disposition dispLevels = (newDisp.split(",").length - 1); delimiter = ','; tokens = newDisp.split(delimiter).slice(dispLevels); newDisp = tokens; var ccid = newDisp; if((newDisp == 4927)||(newDisp == 4928)) { if((c.EmailAddr != "undefined") && (c.EmailAddr != null)) { var cemail= c.EmailAddr; loadDoc(cemail); } else { var cemail = c.EmailAddr; } } }
Tagged:
0