Is Marketing Cloud Eligible: Adding a New Field in the Calculation (Apex) | Scribe

    Is Marketing Cloud Eligible: Adding a New Field in the Calculation (Apex)

    • Jess Talwar |
    • 44 steps |
    • 5 minutes
    information ordinal icon
    To be able to include a new field in the calculation of 'Is Marketing Cloud Eligible', we have to modify the Apex class called: 'ContactTriggerHelper', which we cannot do in Production directly. So we'll have to modify it first in the sandbox, and then deploy it to Production.
    alert ordinal icon
    Before you proceed, make sure you have the API name of the field/boolean you created in Production (and now, you should do the same steps in the sandbox to make the field in here, as well).
    1
    Click the set-up gear icon. Again, we are in the *sandbox* to start.
    2
    Click Setup.
    3
    Click the "Quick Find" field.
    4
    Type and click "Apex Classes".
    5
    Click "C"
    6
    Click "more"
    7
    Click "ContactTriggerHelper"
    8
    Click 'Edit' button.
    9
    Follow the below format to add your new field in the calculation of "Is Marketing Cloud Eligible." Please note that it's required to add these 2 lines of code (check underlined sample code below: line 291 and line 314). Simply replace the part that says "SFMC_New_Field__c" with your actual field's API name.
    10
    Click 'Save' button.
    information ordinal icon
    Now that we're done with adding the field to the Apex Class, we'll proceed with the deployment of it to Production.
    11
    Click the "Quick Find" field.
    12
    Type "outbound."
    13
    Click "Outbound Change Sets."
    14
    Click new button.
    15
    Define any name that describes your deployment (e.g. "Adding \[Field Name\] to Is MC Eligible Boolean"), then click Save.
    16
    Click the "Add" button.
    17
    Click this dropdown, then find "Apex Class."