Setting assigned to on opportunities to match field on related account

The assigned to field continues to be a bit of a struggle for me. I am trying to have the assigned to field be a calculated field on the opportunity module so it reflects the name of a sales rep I am using on a drop down field in the accounts module. is there a way to do this?

  • Hi  ,

    Yes, this should be possible! You first will need a list of database IDs of your users. The easiest way to get that is to build a report on the Users module showing the 'ID' column and their respective usernames. Once you have that, you would insert those IDs into a formula like the following on the assigned_user_name field in Opportunities doing a nest ifElse for each potential user you want to assign opportunities to:

    ifElse(
        equal(
            related(
                $accounts,
                "sales_rep_c"
            ),
            "User A"
        ),
        "user_a_database_id",
        ifElse(
            equal(
                related(
                    $accounts,
                    "sales_rep_c"
                ),
                "User B"
            ),
            "user_b_database_id",
            ...
        )
    )
    
                    createList("Apparel")), "1", "seed_jim_id")

    Depending on how many sales users you have, the formula could end up getting quite large. 

    Let me know if this helps.

    Chris