You need to sign in to do that
Don't have an account?

Updating a field on a Salesforce lead (or Object) when a Zendesk ticket is opened
After installing the Zendesk Package for Salesforce, I'm trying to create a basic Salesforce apex trigger based off the Zendesk Ticket sObject, in order to update a boolean on a lead. This is my first Salesforce trigger, so there might be some basic steps I'm missing.. But I've saved the trigger in the Developer Console and it doesn't report any problems, yet creating a new ticket doesn't update the boolean.
Here's the trigger I'm running below. I've installed the Zendesk integration onto my Developer edition Salesforce, to the point that new tickets display on a lead's record. However when I have this trigger active and log a new ticket with a lead, it doesn't update the boolean.
Any help appreciated!
Here's the trigger I'm running below. I've installed the Zendesk integration onto my Developer edition Salesforce, to the point that new tickets display on a lead's record. However when I have this trigger active and log a new ticket with a lead, it doesn't update the boolean.
Any help appreciated!
trigger UpdateCampaignResponse on Zendesk__Zendesk_Ticket__c (after insert) { for(Zendesk__Zendesk_Ticket__c ticket : Trigger.new) { // Check if ticket requester is a lead if(String.valueOf(ticket.Zendesk__Requester__c).startsWith('00Q')== True) { // Create a set, add ticket requester id set<id>leadId=new set<id>(); leadId.add(ticket.Zendesk__Requester__c); // Lookup and assign lead based on set Lead lead=[Select CampaignResponse__c from Lead where id in :leadId]; // Mark Campaign Response on lead lead.CampaignResponse__c=True; update lead; } } }
There may be some typos in there but that should get you going. If you are still stuck write back. GL :)