Calculated field to return earliest meeting with training as intent

Hi Team,

  I am trying to add a calculated field to my accounts module that captures the earliest related meeting date where the meeting is held and the intent of the meeting was "Training/Onboarding". Feels like there is a simple formula with ifelse that might be leveraged but I am drawing a blank. Has anyone created something like this before?

  • Hi  ,

    While this is technically feasible using the rollupConditionalMinDate() formula, I don't think this is an ideal use of Sugar Logic. The reason is that once your desired event has happened, there is no need to continuously calculate that date value for a given account. Sugar Logic will continue to process that though as it is designed to check on each record save to ensure it has the proper value based on the meetings related to the account.

    My recommendation is to use SugarBPM to capture this data point. The process definition would be set to trigger when (1) a meeting with 'Training/Onboarding' intent is changed to 'Held', and (2) the date field on the parent account is empty. The action would then be configured to update the date field on the parent account to the meeting start date value.

    Doing this means you would need to populate existing accounts with the appropriate date value where they have had this meeting. To do this, I recommend building a report that outputs the account ID and meeting start date for any meetings with 'Training/Onboarding' intent and 'Held' status. Then you can export the report and use Excel to distill the accounts with multiple meetings with those criteria to only have the earliest entry. Once you have 1:1 list of account IDs with their earliest meeting date, you can then build queries like the following:

    UPDATE accounts_cstm SET custom_date_field_c = 'yyyy-mm-dd' WHERE id_c = '{account ID}';

    If your date field was called 'first_onboarding_session_c' and the first session was December 30, 2024 for an account with an ID of 'ccb9f716-8ad6-11ef-9f7f-02d60046d9de', then the query would look like:

    UPDATE accounts_cstm SET first_onboarding_session_c = '2024-12-30' WHERE id_c = 'ccb9f716-8ad6-11ef-9f7f-02d60046d9de';

    Once you have the queries drafted to update all your accounts, provide those queries to Sugar Support to run on your database and SugarBPM will handle updating any other accounts moving forward.

    Chris