Difference between Synchronous and asynchronous in Servicenow?

manojpanda
Giga Contributor

Could anyone please help me on a good scenario with Difference between Synchronous and asynchronous in Servicenow?

9 REPLIES 9

vijay_kumar
Giga Contributor

HI Manmat,



I hope you are asking about Synchronous and asynchronous   GlideAjax Calls. If yes then the best scenarios would be


1) Synchronous: Any validation you want to perform before the form submits on client side.   For ex you want to check if a field on other table has data or not   for this you will make a Synchronous Ajax call to get the Data from Server Side to client and based on response you may submit the record or return false.


2)Asynchronous: If you need to perform any server side action and there is no need to show anything on current form . i.e. for any background server actions you can use Asynchronous Ajax.



For more details: GlideAjax



Regards,


Vijay






Chuck Tomasi
Tera Patron

In short, async happens "in the background". The user doesn't wait.



Synchronous holds the client's browser hostage while it waits for a response from the remote system.



This is often seen in HTTP requests (GlideAjax, REST calls, etc.) The recommended way to do this is async as it doesn't create unwanted latency or bad experience - however there are rare cases where you MUST wait for a response before proceeding.


Hi Chuck,



Do we have any server side api which works asynchronously like GlideAjax works on the browser end ?



Regards,


Kshitij


what the business use case here, you can have the Async Business Rule to run the script asynchronously, but what is the requirement?


Ashutosh Munot1
Kilo Patron
Kilo Patron

HI Manmat,



Please Mark Answer as correct or helpful accordingly.



Thank you,




Ashutosh