You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

ondataupdated() set customField

Received Response
edited Mar 8, 2018 8:18PM in UI Extensibility 1 comment


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.


May 2017

Code 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;					
					var cemail = c.EmailAddr;

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!