How to fix the SOAP end point for update

Kishore8
Kilo Guru

Should i have to change SOAPendpoint in update form?????????

This is for insert

find_real_file.png

This is for update

find_real_file.png

Should i have to change SOAPendpoint in update form?????????

12 REPLIES 12

Are you using with update or insert function, can you please also cross check if sys_id is correct?


Hi,



can you look into screen shot .....i have given sys_id of   instance 1 of current record ,



find_real_file.png


okay, it should work then if sys_id exists on other instance, can you please try with just the content you want to update and see if it helps., example like below.



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inc="http://www.service-now.com/incident">


<soapenv:Header/>


<soapenv:Body>


<inc:update>


<short_description>Test Ext 2</short_description>


<u_my_user>6816f79cc0a8016401c5a33be04be441</u_my_user>


<sys_id>032723d6dbd4c300003af91ebf9619b2</sys_id>


</inc:update>


</soapenv:Body>


</soapenv:Envelope>


Hi,



Thanks for your replay



for   particular record we given sys_id, then we can updated one record



incase, if we want to update 6 records of details then how can we update it, at every time we can't get sys_ids it takes large amount of time.


is there any better way to update the records..


Some times client can't understand   this sys_id process, then how can we overcome this.


if you want to update destination instance record whenever source instance record being updated then you can have a Business Rule on source instance to achieve this. below sample business rule might help you.



(function executeRule(current, previous /*null when async*/) {


// Add your code here


try {


var s = new sn_ws.SOAPMessageV2('Transfer Incidents', 'update');


s.setStringParameterNoEscape('number', current.number);


s.setStringParameterNoEscape('short_description', current.short_description);


s.setStringParameter('active', current.active);


s.setStringParameterNoEscape('caller_id', current.caller_id);


var response = s.execute();


var responseBody = response.getBody();


var status = response.getStatusCode();


gs.log('responseBody' + responseBody);


gs.log('status' + status);


}


catch(ex) {


var message = ex.getMessage();


}


})(current, previous);