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

JavaScript API - SetThread on Incident

Received Response
25
Views
4
Comments
edited Jul 5, 2020 3:50PM in General Technical Discussions 4 comments

Summary

Executing save function in javascript after initializing thread

Content

Hi All,

I am trying to update a thread by calling an external API and I want to execute it when the users click on save . The save is happening before my thread is getting updated. The function which I am putting the code is onbeforesave()

Thanks,
Shankar

Version

19b

Code Snippet

function onbeforesave(){

$.ajax(settings).success(function (response) {

storedResponse =JSON.parse(response);

var modifiedText=  storedResponse["description"] ;
modifiedText = modifiedText.replace(/& lt; /g, "<").replace(/& gt;/g, ">");
window.external.Incident.SetThread(2,translatedThread.text());
})
}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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