For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom Mailing Labels

The client is looking to create mailing labels for contacts that are related to another object. In this example, the contacts that are needed are related to Case.

Instructions

  1. Create a lookup field on SDOC Jobs tied to the related object (Case).

  2. The query will need to be updated from what is listed in the Mass Merge article. Note: You will need to update contact__c to the lookup field you created.

Original Query:

SELECT name, mailingstreet,mailingcity, mailingstate, mailingpostalcode 
FROM contact WHERE id 
IN (select SDOC__Contact__c from SDOC__SDJob__c where ownerid = '{{!User.id}}')

Updated Query:

SELECT contact.name
    ,contact.mailingstreet
    ,contact.mailingcity
    ,contact.mailingstate
    ,contact.mailingpostalcode
FROM case
WHERE id IN (select Case__c from SDOC__SDJob__c where ownerid = '{{!User.Id}}') 

Last updated

Was this helpful?