Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ADvendio provides the user with a hierarchy of complex objects with many fields. In order to add a new record which often is similar to existing data the user now has to tediously fill out all the fields and add all the child records. Many customers had already requested custom clone functions. To simplify this process ADvendio offers a generic and reusable "clone" function.

...

  1. Enter a Configuration Setup Name.
  2. Enter a Description.
  3. Filter Object Filter for ADvendio objects Only or standard salesforce objects.
  4. in field Select the start object to configure select the main object to be cloned from the drop-down menu options.
  5. Click the button Continue.

...

Note

Please always choose the start object which is highest in the hierarchy. All related objects will be selected in the next step.

Pick Related Objects and select the cloning function on Fields

Attention: Only child objects from a Master-Detail relationship (e.g. Campaign Items from a Media Campaign) can be selected for the generic clone. Objects from a lookup relationship can't be cloned.

...

  • Define the Depth of Child Object.
  • Define the Cloning confirmation. (if configureable configurable the end user gets a page to select or de-select child objects.)
    1. No Confirmation: Doesn't show any confirmation message while starting the cloning process. Cloning The cloning process start starts automatically as soon as the user clicks the clone button at the target record.
    2. Confirmation - Objects Not Changeable: Shows all objects being cloned in a tree structure. Users can't deselect any object in the tree. User The user needs to confirm the selection in order to start the actual clone process. This is the default option.
    3. Confirmation - Objects Configurable: Shows all objects being cloned in a tree structure. Users can deselect objects in the tree to exclude them from cloning. User The user needs to confirm the selection in order to start the actual clone process.

...

  • Define Cloning Condition for Object Media Campaign (Media Campaign is only an example) and handle Action, if condition not met.
    1. Clone Anyway: Clones the record.
    2. Clone With Warning: Clones the record, and creates a warning message containing the object name and record ID shown to the user.
    3. Interrupt Clone: Will not clone and interrupts interrupt the whole cloning process. An error message containing the object name and record ID is shown to the user.
    4. Skip record
  • Select Field path and Operator from drop-down values if necessary.
  • Define Field Configuration for Object Media Campaign (Media Campaign with all its fields is only an example). The drop-down lists Action contains a few different actions depending on the field, field type, and permissions.
    1. Clone: Will copy the current record’s field value. This is the default action.
    2. Adaptive Clone: Will set the reference/lookup adaptively. This is only for fields with a Lookup data type.
    3. Leave Empty/Default: Will null out the value, so the new record’s field will either have nothing or a default value if one is specified for the field.
    4. Set Value: Will allow field values to be specified. Reference fields will show a lookup to select a record.
    5. Clone with Prefix: Will add a text before the cloned value. This is only for fields with a String data type.
    6. Clone with Suffix: Will add a text after the cloned value. This is only for fields with a String data type.
  • Click the button Save/Cancel to save/discard the changes.

...

  1. Navigate to Setup > Object Manager > "Objectname" > Buttons, Links and Actions and click the button New Button or Link.

  2. Enter a Label.
  3. Enter a Name (the field Name should be filled automatically but it is possible to change the API name).
  4. Enter a Description.
  5. Select the Display Type (Detail Page Button).
  6. Select Behavior (Display in new windows) and Content Source (URL).
  7. Enter the following code into the textarea field: {!URLFOR( "/apex/ADvendio__GenericCloneProcessor", null, [id={VariableOfIdOfTheMasterRecord}, fsId={IdOfTheGenericCloneConfiguration}] ) }.
    1. Classic: The IdOfTheGenericCloneConfiguration can be found opening the newly saved cloning configuration and copying the URL out of the browser. 
    2. Lightning: The IdOfTheGenericCloneConfiguration can be found opening Feature Settings and searching for Feature Name = "GenericCloneDetailConfigurationand the Template Name as the name of the object you want to Clone. The ID is the Feature Setting Name.
  8. Click the button Save.
  9. See the following code example to configure your Generic Clone feature correctly:

      → Code Example: {!URLFOR( "/apex/ADvendio__GenericCloneProcessor", null, [id=ADvendio__MediaCampaign__c.Id, fsId="a0jw0000007HIA6AAO"] ) }

  10. Drag the new button into the page layout and the feature can be used. 

...