SharinPix DocumentationMain Documentation SharinPix Cookbook - Use Case and Implementation ExamplesDuplicate a SharinPix album using a Process Builder or Flow (Admin-Oriented)

Duplicate a SharinPix album using a Process Builder or Flow (Admin-Oriented)

This article demonstrates how to duplicate a SharinPix album using a Process Builder.

For this demo, we will use the Lead and Opportunity objects.

The setup will be in such a way that when a Lead record is converted into an Opportunity, the Lead's album is duplicated to the Opportunity record.

The SharinPix package includes the Apex class DuplicateAlbum which is used to duplicate SharinPix albums.

Creation of the Process Builder

This section demonstrates how to create a Process Builder that invokes the Apex class DuplicateAlbum to rename an album.

To do so, follow the steps below:

  • Go to Setup. In the Quick Find Box, type Process Builder
  • Under Process Automation, select Process Builder
  • Click on New
  • For the newly-created Process Builder:
    1. For the field, Process Name enter SharinPix Duplicate Lead To Opportunity Album
    2. Enter a description for the process (This step is optional)
    3. For the field The process starts when, select A record changes
    4. Click Save

Once on the Process Builder editor:

  • Click on Add Object
    1. For the field Object, select Lead
    2. For the field Start the process, choose when a record is created or edited
    3. Click on Save
  • Next, click on Add Criteria
    1. For the field Criteria Name, enter On Lead to Opportunity conversion
    2. For the field Criteria for Executing Actions, select Conditions are met
  • Inside the Set Conditions section
    1. Choose Converted Opportunity ID as the field
    2. Then, select Is Changed as the operator, Boolean as the type and True as the value
  • Leave the field Conditions as All of the conditions are met (AND)
  • Next, click on Add Action
    1. For the Action Type, choose Apex
    2. For the Action Name, enter Duplicate Opportunity album
    3. For the Apex Class, select sharinpix__DuplicateAlbum
  • Inside the Set Apex Variables:
    1. For the field Destination Album ID, choose Field Reference as the type. For the value, choose Converted Opportunity ID
    2. For the field Source Album ID, choose Field Reference as the type and Lead ID as the value

There is one additional variable available in the Set Apex Variables, namely, Include tags which, when set to true, enables duplication of tags applied to the album's images as well.

This variable is optional and can be accessed by clicking on the Add Row link inside the Set Apex Variables section.

  • Click Save when done

You can now activate the Process Builder.

Note:

  • The variables Source Album ID and Destination Album ID are compulsory and should therefore be filled.
  • The variable Include tags is optional and can therefore be ignored when not required.

Demo

To test the Process Builder:

  • Go on a Lead record and upload some images to it's corresponding SharinPix album
  • Then, convert the Lead
  • Go to the converted Opportunity record. The images previously uploaded on the Lead are now available on the converted Opportunity's album

0 Comments

Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.