Jobs
What information is required to have a job created in OCC when the Job Object is configured as a Lead?
When the Job Object is configured as a Lead for the integration, the following process happens:
- The user from Salesforce MUST be mapped to a user in OCC and their mapping must be active.
- We then iterate over all of the active Salesforce Users we have mapped and look for appointments based on the association key (e.g. OwnerId, or whatever is configured) in the Lead.
- For each lead, we utilize the following mapping to create a job in OCC:
- Customer Name: {lead.Name}
- Name: {lead.Name}: {lead.ProductInterest__c}
- Email: {lead.Email}
- Lead Source: {lead.LeadSource}
- Job Address:
- Line 1: {lead.Address.street}
- City: {lead.Address.city}
- State: {lead.Addres.state} (there is a mapping to validate it is in the correct format)
- Postal Code: {lead.Addres.postalCode}
- Status: In the event the integration is configured to update the status, the following is done:
- Status is set to lead.Status.delete(‘ ‘).underscore (in the case that the status matches on in OCC)
- Phone Number (lead.Phone):
- Name: Main
- Number: {lead.Phone}
- Phone Number (lead.MobilePhone):
- Name: Mobile
- Number: {lead.MobilePhone}
- Assigned User: lead.OwnerId (Based upon the mapping set up in the integration)
- Metadata:
- salesforce_lead:: {lead.Id}
- salesforce_user_id: {lead.OwnerId}
What information is required to have a job created in OCC when the Job Object is configured as an Opportunity?
When the Job Object is configured as a Lead for the integration, the following process happens:
- The user from Salesforce MUST be mapped to a user in OCC and their mapping must be active.
- We then iterate over all of the active Salesforce Users we have mapped and look for appointments based on the association key (e.g. OwnerId, or whatever is configured) in the Opportunity.
- The integration also looks for the Contact which is identified which is identified as “Primary”.
- For each Opportunity, we utilize the following mapping to create a job in OCC:
- Customer Name: {contact.Name}
- Name: {contact.Name}: {opportunity.Name}
- Email: {contact.Email}
- Lead Source: {opportunity.LeadSource}
- Job Address:
- Line 1: {contact.MailingStreet}
- City: {contact.MailingCity}
- State: {contact.MailingState}
- Postal Code: {contact.MailingPostalCode}
- Phone Number (contact.Phone):
- Name: Main
- Number: {contact.Phone}
- Phone Number (contact.HomePhone):
- Name: Home
- Number: {contact.HomePhone}
- Phone Number (contact.MobilePhone):
- Name: Mobile
- Number: contact.MobilePhone
- Assigned User: opportunity.OwnerId
- Metadata:
- salesforce_opportunity_id: {opportunity.Id}
- salesforce_contact_id: {contact.Id}
- salesforce_user_id: {opportunity.OwnerId} (or whatever is set up in the integration)
- Job Type(s):
- The token job_type configuration must be setup by a developer
- The column must be a multi select within Salesforce
- The column must be directly associated with the Opportunity
- Create the job types within One Click to match the values in the multi select within Salesforce
- Status: {opportunity.StageName}
- The org job states must be set up by a developer to match the Opportunity StageName stages by a developer
- Enable Opportunity Status Update through the Salesforce UI
- Additional Info:
- The token additional_info configuration must be setup by a developer
- The column must be a string within Salesforce
- The column must be directly associated with the Opportunity
- Appointment:
- Summary: {event.Subject}
- Start Time: {event.StartDateTime}
- End Time: {event.EndDateTime}
- Appointment Note Text: {event.Description)
- Metadata:
- salesforce_event_id: {event.Id}
What information is required to have a job created in OCC when the Job Object is configured as Custom?
There is a custom configuration which is available to be able to customize the object(s) utilized to push/pull information to/from Salesforce. If the customer requirements cannot be met by the default Salesforce integration, this can be an option through consulting with OCC. If the data is available via a Salesforce SOQL query call, the information can be pulled and pushed from One Click Contractor.
When configuring a “custom” Salesforce integration, there are a few things that are required:
- SOQL Query for Jobs: There needs to be a SOQL query which can be run to get a list of records that have been updated for importing / updating into OCC. The goal is to make the query as efficient as possible and be able to be run in a single query every 15 minutes. In order to help make the query more efficient, there is a value which can be added to the query which can be utilized to help filter records.
- For example, you can utilize something like WHERE LastModifiedDate >= to help filter and include only records that were updated since the last sync. One thing to keep in mind is that IF there are multiple records you have in the query you may need to make sure you check updates to each of them as it is common for updates to an Account not to update an Opportunity, etc.
- Organization Mapping: There must be a value that is present on the object we’re utilizing from Salesforce that is set to a value we can map to identify the location in OCC. That value MUST be present in the SOQL query (mentioned below) and a value must be set in the OCC Org Metadata for mapping.
- Job Mapping: There will need to be a configuration which will allow the system to know how to map data from Salesforce to the job / address / phone number(s) in OCC.
- For each of the values, there are at least 2 properties which need to be defined:
- Key (key): The value corresponding to the SOQL query for the job that we’re pulling data from
- OCC Value (occ_value): The field on the OCC Job this data will map to.
- Here is a list of the OCC values which can be configured:
- Name (name): The name of the job
- Customer Name (customer_name): The customer’s name on the job
- Lead Source (lead_source): The lead source on the job
- Email (email): The email address for the customer
- Address Line 1(address_attributes.line_1): The first line of the job’s address
- Address Line 2 (address_attributes.line_2): The second line of the job’s address
- Address City (address_attributes.city): The city for the job’s address
- Address State (address_attributes.state): The state for the job’s address
- Address Postal Code (address_attributes.postal_code): The postal code for the job’s address
- Phone Number: There can be multiple phone numbers added to the job. In this case, there are 3 values which need to be set:
- Key, occ_value, and label
- For example, if you’re pulling a phone number off of an account and you want to call it “Mobile” you would utilize the following configuration:
- key: Account.Pnone
- occ_value: phone_numbers_attributes
- label: Mobile
- Assignment (assignments_attributes): The user we will be assigning the job that is created to. By default, this utilizes the OwnerId value from the record but can be overwritten in the configuration.
- Additional Assignment (additional_assignments_attributes): The user that will be brought over as the “secondary” assigned user on the job.
- Metadata: This is where you can set up a record(s) you wish to store the identifying values back to the job. If you wish to make use of the default ability to push a document back to either the opportunity or lead object, you will want to utilize either of the following configurations:
- Opportunity: Set the values as follows:
- key: Id (or whatever the field is in the SOQL query for jobs to identify the opportunity)
- occ_value: metadata.integration.salesforce_opportunity
- Lead: Set the values as follows:
- key: Lead.Id (or whatever the field is in the SOQL query for jobs to identify the opportunity)
- occ_value: metadata.integration.salesforce_lead
- Opportunity: Set the values as follows:
- For each of the values, there are at least 2 properties which need to be defined:
- Event Mapping: There will need to be a configuration which will allow the system to know how to map data from Salesforce to an appointment in OCC.
- For each of the values, there are at least 2 properties which need to be defined:
- Key (key): The value corresponding to the SOQL query for the job that we’re pulling data from
- OCC Value (occ_value): The field on the OCC Job this data will map to.
- Here is a list of the OCC values which can be configured:
- Summary (summary): The title of the appointment
- Notes (notes): The description of the appointment
- Start Time (start_time): The start date/time of the appointment (ensure it is specified in the appropriate time zone as it will be assumed to be UTC if not specified).
- End Time (end_time): The end date/time of the appointment (ensure it is specified in the appropriate time zone as it will be assumed to be UTC if not specified).
- Metadata: You will want to provide at least one metadata field to store the id. For example, if utilizing the first ServiceAppointment associated with a record you might have a configuration such as:
- key: ServiceAppointments.first.Id
- occ_value: metadata.salesforce_service_appointment_id
- For each of the values, there are at least 2 properties which need to be defined:
- Push Back to Salesforce: A configuration/mapping of pushing data back to the record in Salesforce when it is updated in OCC.
Are there any options for other mappings for job creation?
There are additional options for mappings that are custom.
When should an update in Salesforce be reflected in OCC?
There is a job that runs every 15 minutes at 10, 25, 40, and 55 minutes after the hour.
What happens if an Opportunity, Contact, or Opportunity Contact Role is deleted in Salesforce?
The information created in OCC would be orphaned and unlinked between Salesforce and OCC. There is no update to reflect that in OCC and no updates will be pulled to a job(s) in OCC.
What happens if an Event is deleted in Salesforce?
Much like if an Opportunity, Contact, or Opportunity Contact Role is deleted in Salesforce, NO update for appointment(s) will be pulled to a job(s) in OCC.
Do updates in OCC push back to Salesforce?
Yes, there are options for information to be pushed back to Salesforce. In the integration configuration, there are options for different types of updates back to Salesforce.
- Opportunity
- Default Data:
- {opportunity.LeadSource} - job.lead_source
- Job Type
- The token job_type configuration must be setup by a developer
- The column must be a multi select within Salesforce
- The column must be directly associated with the Opportunity
- Create the job types within One Click to match the values in the multi select within Salesforce
- Additional Info:
- The token additional_info configuration must be setup by a developer
- The column must be a string within Salesforce
- The column must be directly associated with the Opportunity
- Custom Mapping:
- The custom opportunity mapping must be setup by a developer
- Any information that is related to job (organization information) can be mapped to a column on the Opportunity
- Default Data:
- Contact
- Default Data:
- Email: job.email,
- FirstName: first_name,
- LastName: last_name,
- MailingStreet: job.address.line_1,
- MailingCity: job.address.city,
- MailingState: job.address.state,
- MailingPostalCode: job.address.postal_code,
- MobilePhone: number_map.mobile,
- Phone: number_map.first_alternate
- Default Data:
- Account
- Default Data:
- Name: job.customer_name
- Phone: job mobile phone OR first alternate - finds a number in job.phone_numbers to send to Salesforce
- ShippingStreet: job.address.line_1
- Name: job.customer_name
- ShippingStreet: job.address.line_1
- ShippingCity: job.address.city
- ShippingState: job.address.state
- ShippingPostalCode: job.address.postal_code
- BillingStreet: job.address.line_1
- BillingCity: job.address.city
- BillingState: job.address.state
- BillingPostalCode: job.address.postal_code
- Custom Mapping:
- The custom opportunity mapping must be setup by a developer
- Any information that is related to job (organization information) can be mapped to a column on the Account
- Default Data:
Can I make status changes in OCC and have them show up in Salesforce?
Yes, there are 2 options for getting status changes in OCC back to Salesforce.
Option 1: Currently, there is an ability to update a result and result reason on an appointment in OCC and have that reflected back in Salesforce "immediately". There is NO ability to change the Job’s status in OCC and have that reflected back in Salesforce.
Under the appointments tab, for each of the appointments that come over from Salesforce will have an option to result each of those appointments.
After selecting the icon to result it gives you the ability to select a result and notes to save the changes.
Once that change is saved it is accessible on the Opportunity and Appointment back in Salesforce.
- Result will update the Stage of the Opportunity back in Salesforce.
- The notes which are entered on the result screen will also show back up in Salesforce on the Event.
Is there anything else that happens when an appointment is resulted?
Yes, the Opportunity.StageName is updated AND the event.notes are updated on the associated Salesforce event.
What happens when I change the owner (or other association key) on the Job Object (Opportunity or Lead) in Salesforce?
Once the association is changed in Salesforce, it should be picked up on the 15 minute synchronization timeframe. Please note the SAME rules still exist where there must be a user linked between OCC and Salesforce AND it must have been updated since the last synchronization.
Please note that with changes made in Salesforce, those updates may take upwards of a minute or so to reflect and be made available to the API for us to pull down.