function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Karan Thakkar 5Karan Thakkar 5 

How to create trigger which will only fire for those records which are came from API?

Hello Techies,
I have successfully created an update trigger but I'm having an issue. I want to fire trigger only when the case was received from an API(Through Integration from another app)Trigger is fired every time when case is updated. There no option in case object which can help me to identfy that case is came from specific tool
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Karan,

Is there  any differerce in record which comes from API like Createdby or something or there should be some field to ideantify so by kepping If condition you can write the logic in it.

Apart from this I dont think we can solution on it.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
Karan Thakkar 5Karan Thakkar 5

Hi Sai,
Thanks for the response, I have seen some other crm Api docs wherein they have external ticket id which can help us to solve the problem and also current I'm doing the in case section from case orgin object

Thanks & Regards
 

Tim Hunter 12Tim Hunter 12
Most straight forward way would be to have the Case get marked as coming from an API when the API is creating the record. Have something like a Checkbox or Picklist value set to clearly mark the source of the Case during the process the API is running to create the record, then you just need to check the field in the Trigger to see if it's something the Trigger should apply itself on. Or, check the Record Type if the API creates its own specific Record Type of the Case.