PO Box 55056 RPO Windermere, Edmonton, AB T6W 5B4, Canada

Moving Pass Generation From Sandbox to Production

A worked example for Salesforce administrators. It answers one question: which fields and objects have to be migrated to production to add pass generation to an existing page layout? Two scenarios show the answer: passes on Contact, and passes on a custom object.

Sample business: Woofly Dog Daycare (fictional) · Kemicard 2.30 · Applies to change sets and other metadata deployment tools. This page goes with the Production Install, Migration & Upgrade Guide, which covers installing the package itself.

The short answer

Kemicard only needs two lookup fields on the object you issue passes from, plus a Kemicard configuration record that names them:

WhatExample (Contact)Notes
Lookup to Kemicard Pass (Kcard__Pass__c)Membership_Pass__cHolds the pass created for the record.
Lookup to Kemicard Template Pass (Kcard__Template_Pass__c)Membership_Pass_Template__cWhich template the record's pass uses.
Kemicard Configuration V2 recordContactCustom metadata. Names the object, the two lookups, the email field and the date fields.

The Kemicard configuration wizard can create both lookups for you (and an email and an expiration date field). Everything else is your own setup, and moves the same way as any other customization:

  • Fields the configuration, flows, templates or layouts use: email, dates, wallet URL fields.
  • Automation that sends passes: usually a flow plus a button, or a record-triggered flow.
  • Page layout or Lightning record page that shows the button and the pass fields.
  • Email template used when passes are emailed.
  • A permission set that gives users access to the new fields (see the warning below).
Pass templates are records, not metadata. Change sets can't carry them. Export them from the sandbox and import them into production with the Kemicard Template Workbench, after the change set is deployed.
Fields created by the configuration wizard have no field-level security, not even for System Administrators. Grant Read and Edit through a permission set and include that permission set in the change set, or users won't see the fields and passes may not be linked to records.

Order of work in production

  1. Install Kemicard in production, on the same version as the sandbox. Follow Phases 1–4 of the Production Install guide: prerequisites, install, the Kemicard App named credential, and Authorize Kemicard User.
  2. Validate, then deploy the change set from the sandbox. The lookups point at Kemicard objects, so the package must be installed first or validation fails.
  3. Activate the flows if they arrived inactive, and check any button or record page is assigned.
  4. Assign the permission set to the people who send or view passes.
  5. Import the templates with the Template Workbench. The export also carries each template's configuration.
  6. Test: send a pass to one test record and check the pass lookup is filled and the email arrives.

Scenario 1: Membership passes on Contact

Woofly Dog Daycare built membership passes on Contact in a full sandbox. Members get a pass when staff click Send Membership Pass on the Contact page. Before go-live, the admin lists everything the sandbox setup uses.

Moving Contact passes to production · about 4 minutes, no sound. On-screen captions explain each step, and an orange outline shows where to look. Recorded in Kemicard 2.30 with fictional sample data.
Read every on-screen caption (20)

1. Review the configuration

Open Kemicard Console › Configuration, find the Contact row and choose Edit. Step through the wizard without saving: it lists every field Kemicard uses on Contact.

Kemicard Console Configuration list with the Contact configuration outlined
Kemicard Console › Configuration: one configuration per object.
Configuration wizard Pass and Template Pass Selection step showing the Membership Pass and Membership Pass Template fields
Step 3, Pass & Template Pass Selection: the two lookup fields Kemicard needs.
Configuration wizard Event and Relevant Date Selection step showing the Email field and the Membership Expiration Date field
Step 5: the email field and the expiration and relevant date fields.

2. Find the fields

In Setup › Object Manager › Contact › Fields & Relationships, search for the fields named in the configuration. Also note the helper fields your flows, layouts and email templates use.

Contact Fields and Relationships filtered to Membership, showing Membership Pass and Membership Pass Template as lookups to Kemicard objects
Contact fields: Membership Pass and Membership Pass Template are lookups to Kemicard objects.

3. Check the automation

Woofly's Send Membership Pass button runs the Send Membership Pass flow, which calls Kemicard's pass action and fills Membership Pass on the Contact.

Contact record after Send Membership Pass, with the Membership Pass lookup filled in and the wallet link fields below
After Send Membership Pass: the pass is linked to the Contact, with Apple and Google Wallet links (blurred here).

4. Move the template

Open Template Workbench from a template (or the tab) and Export. In production, drop the JSON file on the Template Workbench and click Import Template(s).

Template Workbench Ready to Export, with one template and one configuration selected
Template Workbench › Ready to Export: one JSON file with the template and its configuration.
Template Workbench in production with a drop zone for the JSON file and an Import Templates button
Template Workbench in production: drop the file, choose the templates, Review & Import.

Change set for Scenario 1

Component typeComponentsWhy
Custom Field (Contact)Membership_Pass__c, Membership_Pass_Template__cRequired by Kemicard (lookups).
Custom Field (Contact)Membership_Expiration_Date__c (Email is a standard field)Named in the configuration (email, expiration and relevant dates).
Custom Field (Contact)Apple_Wallet_Pass_URL__c, Google_Wallet_Pass_URL__c, Send_Membership_Pass__c, Member_Number__c, Member_Since__c, and other fields your templates showUsed by Woofly's flows, layouts and template fields. Include only what you use.
Custom Metadata RecordKemicard Configuration V2 › ContactTells Kemicard which fields to use. Deploy with the fields it names.
FlowSend_Membership_Pass, Send_Membership_Pass_From_Checkbox, Update_Google_Wallet_URLSend passes from the button or a checkbox; copy wallet links back to the Contact. Send_Membership_Pass is also the configuration's Campaign Manager flow.
FlowKemicard_Expired_Member_Scan_ProcessorNamed in the configuration as the Scanner flow.
Flow (optional)ContactMessagingScreenFlowOnly if you send messages to pass holders.
Button or LinkContact › Send_Membership_PassStarts the flow from the record page.
Page Layout / Lightning PageContact layout, Contact record pageShows the button and the pass fields.
Validation Rule (optional)Contact › Active_Template_ValidationStops users picking an inactive template.
Email TemplateWoofly welcome emailSent with the pass.
Permission Sete.g. Kemicard_Contact_UserField access for the fields above.
Report Type / Reports (optional)Membership reportsOnly if you built them.

Scenario 2: Passes for a custom object

Woofly also runs a Puppy Club, tracked in a new custom object, Puppy Club Member. The admin builds it in the sandbox and lets the Kemicard wizard create the pass fields.

Passes for a custom object · about 5 minutes, no sound. On-screen captions explain each step, and an orange outline shows where to look. Recorded in Kemicard 2.30 with fictional sample data.
Read every on-screen caption (18)

1. Create the object

Setup › Object Manager › Create › Custom Object: Label Puppy Club Member, Plural Puppy Club Members, API name Puppy_Club_Member__c.

New Custom Object form with label Puppy Club Member and object name Puppy_Club_Member
New Custom Object: Puppy Club Member.

2. Add a Kemicard configuration

Kemicard Console › Configuration › Add New Configuration. Pick Puppy Club Member and name the configuration Puppy_Club_Member. On Step 3, turn on Create New Pass Field and Create New Template Field. Turn on Apple and Google Wallet on Step 4. On Step 5 Kemicard can also create an email field and an expiration date field. Save & Finish creates the fields and the configuration record.

Configuration wizard Step 3 with Create New Pass Field and Create New Template Field turned on, labelled Puppy Pass and Puppy Pass Template
Step 3: the wizard creates Puppy Pass and Puppy Pass Template.
Configuration wizard Step 5 creating a Member Email field and a Membership Ends expiration date field
Step 5: Member Email and Membership Ends are created too.
Kemicard Configuration list with the new Puppy_Club_Member configuration outlined
The Puppy_Club_Member configuration in the list.
Bulk Actions and Scanner flows (Step 2) are optional. Leave them off until the flows exist; you can edit the configuration later.

3. Give users access to the new fields

Create a permission set (for example Club Member Pass Access). Under Object Settings › Puppy Club Members, grant Read, Create and Edit on the object and Read and Edit on all fields.

Club Member Pass Access permission set with object permissions and Read and Edit field access for the Puppy Club Member fields
Permission set: object and field access for Puppy Club Members.

4. Build the send-pass flow and button

Copy Kemicard's sample flow Send Membership Pass for Member (Save As New Flow) and point it at Puppy Club Member: get the record from recordId, read its template and email fields, and pass them to the Apex action Generate Pass from list of String as pass details (inputs configurationId, whatId, email addresses). Then add a Send Membership Pass button that opens the flow, and put it on the page layout. The action's inputs are described in the API reference and Flow integration guide.

Flow Builder with the Create and Email Membership Pass Apex action and its input values
Flow Builder: the Kemicard pass action and its inputs.

Change set for Scenario 2

Component typeComponentsWhy
Custom ObjectPuppy_Club_Member__cThe new object (its tab too, if you created one).
Custom Field (Puppy Club Member)Puppy_Pass__c, Puppy_Pass_Template__cCreated by the wizard; required by Kemicard.
Custom Field (Puppy Club Member)Member_Email__c, Membership_Ends__cCreated by the wizard; named in the configuration.
Custom Metadata RecordKemicard Configuration V2 › Puppy_Club_MemberNames the object and its fields.
Permission SetClub_Member_Pass_AccessThe wizard's fields have no access until granted.
FlowYour copy of the send-pass flowGenerates and emails the pass.
Button or LinkPuppy Club Member › Send Membership PassStarts the flow.
Page Layout / Lightning PagePuppy Club Member layoutShows the button and the pass fields.
Email TemplateIf the flow sends one

After the deployment

CheckWhere
Kemicard is installed on the same version as the sandboxSetup › Installed Packages
Kemicard is authorizedKemicard Console › Authorization
The configuration record is Active and names the right fieldsKemicard Console › Configuration › Edit (cancel without saving)
Users have the permission set and can see the pass fieldsSetup › Permission Sets › Manage Assignments
Flows are ActiveSetup › Flows
Templates are imported and ActiveKemicard Templates tab
A test record gets a pass: lookup filled, email received, pass opens in a walletRecord page

Common problems

SymptomLikely cause
Change set validation fails on the lookup fieldsKemicard isn't installed in production yet, or is an older version.
Users can't see Pass or Template fieldsMissing field-level security: the permission set wasn't deployed or assigned.
Button does nothing or the pass lookup stays emptyThe flow is inactive, or the configuration record wasn't deployed.
Template import fails or the template has no configurationThe change set (fields and configuration) wasn't deployed before the import.
Pass generation fails for every recordKemicard isn't authorized in production yet.

More fixes in Troubleshooting & KB.

Need help? Email supportkemisoft.com (M–F, 8 am – 4 pm MST) with your Salesforce organization ID and Kemicard package version.

Sources: Kemicard production install scenarios and demos (Kemicard 2.30, fictional sample data). Salesforce Help: Change Sets.