on click is available for catalog item ?

String
Kilo Sage

Hi Team ,

We are having a catalog item form ,So when we click on Price button .We should trigger a SOAP out bound 

 

Please guide me the best pratices 

3 REPLIES 3

Sai Shravan
Mega Sage

Hi @String ,

Here are some guidelines to consider:

  1. Use the Outbound REST Message functionality instead of SOAP if possible. Outbound REST Messages provide a simpler and more flexible integration approach compared to SOAP, and are generally easier to configure and maintain. However, if SOAP is the only option available for your integration, then you can use it.

  2. Use a script include to encapsulate your SOAP call logic. This will make it easier to reuse your integration code across multiple catalog items or other areas of the platform. You can create a script include by navigating to "System Definition > Script Includes" in the ServiceNow application navigator.

  3. Define your SOAP message and endpoint in the ServiceNow SOAP Message functionality. This allows you to define the structure of your SOAP message and specify the endpoint URL for your outbound call. You can create a new SOAP message by navigating to "System Web Services > Outbound > SOAP Message".

  4. Use asynchronous SOAP calls whenever possible. Asynchronous calls do not block the ServiceNow user interface and provide better performance and scalability for your integration. You can make an asynchronous SOAP call by setting the "SOAP Message Processing" option to "asynchronous" in your SOAP message definition.

  5. Use credentials with the minimum necessary permissions. When defining the credentials for your outbound SOAP call, make sure to use a ServiceNow user account that has only the minimum necessary permissions to access the external system. This will minimize the security risk and potential impact of any issues with the integration.

  6. Test and validate your SOAP integration in a non-production environment before deploying it to production. This allows you to verify that your integration is working correctly and identify any potential issues or performance concerns before it impacts your production environment.

  7. Implement error handling and logging in your integration code. This will help you identify and troubleshoot any issues with your integration and provide better visibility into the integration status. You can use the ServiceNow GlideRecord API to write log messages to the system log or a custom table.

  8. Use a retry mechanism to handle transient errors. In some cases, your SOAP outbound call may fail due to temporary issues with the external system or network connectivity. To handle these transient errors, you can implement a retry mechanism that automatically retries the call with a backoff strategy.

  9. Avoid hard-coding endpoint URLs and other configuration parameters in your integration code. Instead, use ServiceNow properties or other configuration mechanisms to store these values, which allows you to change them easily without modifying the integration code. You can use the ServiceNow System Properties functionality to define these properties.

Regards,
Shravan

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you

Thanks @Sai Shravan  for the valuable  information ,We can't see any option for on Click for  button in catalog client script 

Screenshot 2023-03-06 at 3.43.35 PM.png

Please suggest 

snegi
Giga Contributor

You have to write the code in Price UI action. See the below code. It will help you to write server and client side code in same UI action:

 

Client & Server Code in One UI Action - ServiceNow Guru

 

Hope this helps!

 

Regards,

Shamma