Custom Action Button Calculated

Hi! I'm trying to create a new Action button for Accounts that relates to Meetings; specifically to create a new Meeting where the meeting subject is: ("TAF" + "name of related Account"). 

TAF is an acronym used internally to designate the purpose of the meeting.

In the Accounts module I have created a Textfield: "taf_value_c" with a default value of "TAF".

Ex. Account name = "Meyer's Grocery Store"

taf_value_c = "TAF"

User clicks button > button opens Meeting create screen with subject "TAF Meyer's Grocery Store"

I am trying to configure the button to concatenate taf_value_c and Account name and have two issues.

I would think this Default value would apply after Edit*save on the account, but the Textfield remains blank until I edit the field itself on the record layout:

 

Below was my button formula, which was accepted but is not working. After pressing the button the subject is empty.

concat(string(related($accounts, "name")), string(related($accounts, "taf_value_c")))

Does anyone see any obvious errors?

Thank you

Parents
  • Hi  ,

    There are no errors in what you are doing. Unfortunately, you are encountering a product defect. This behavior is currently tracked under the following bugs: 90036, 93982, & 95346. Those bugs are flagged as 'no plan to implement', but Sugar reconsiders bugs as more customers report their impact. I recommend first filing a support case to highlight those bugs impacting your implementation.

    With that said, there are two workarounds I can think of:

    Calculated Field on Accounts

    Overview: You create a calculated text field on the Accounts module to build out the intended meeting subject. You then use that field to pass the value through to the meeting subject in the action button configuration.

    Pro: Sets the name as you want on creation
    Cons: Requires the placeholder field to be added on the account record view in order for the action button to function (due to bug # 95999); requires existing accounts to be resaved/recalculated after creating the field before it will pass through a value in the action button

    1. Create a field in the Accounts module (e.g. meeting_name_c) with the following formula:
      Fullscreen
      1
      2
      3
      4
      5
      concat(
      $name,
      " ",
      $taf_value_c
      )
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    2. Once the field is created, you will need to add it to the account record view layout in order for it to function. If you have the action button also showing in the record view dashlet, then add the field to that layout as well.
    3. You will need to use the mass action 'Recalculate Values' or a solution like our Upsert Calculated Fields plugin to set that field value for all the applicable accounts. 'Recalculate Values' can only be done in batches of 1,000 accounts at a time while our plugin will scan through all accounts in the backend and perform the updates automatically.
    4. In the action button configuration, remove the existing configuration for the 'Subject' field and select 'Subject' from the 'Copy Field Value(s) From Parent' list:
    5. Once selected, select your field in the 'From Parent Field' list:

    From there, the action button should function as you expect!

    SugarBPM Sets the Meeting Subject

    Overview: Using SugarBPM, you can set a process definition to trigger on newly created meetings matching your criteria (e.g. Activity equals "TAF", Meeting Type equals "Scheduled (phone)", etc.), that then updates the meeting subject as desired. 

    Pro: Works immediately on deployment. No need to create a calculated field on Accounts module, insert that field onto your layouts, and force updates to all existing accounts
    Con: You need to set a placeholder subject on meeting creation which may cause confusion for users since SugarBPM will only update the meeting after it is saved

    Note: This solution is possible with a series of backend fields on the Meetings module and additional conditions in the process definition to get the desired outcome. In the interest of efficiency, I am presenting a simplified solution using the new Enhanced Change Field action in our Upsert BPM Essentials plugin. 

    1. Create a process definition on the Meetings module
    2. Set the start event to 'New Records Only' and set the appropriate field criteria on which to trigger
    3. Connect the start event to an action event
    4. Set the action event to 'Upsert :: Enhanced Change Field'
    5. In the action settings, select to update the current record and set the related module to 'Accounts' to define where to pull field values from:
    6. In the Subject field, select the appropriate fields from the related account to update the meeting:

    This action will run immediately on record creation, so your users will see the expected subject after they save the new event.

    If you would like more information about how Upsert Calculated Fields or Upsert BPM Essentials can help you be more successful with Sugar, please reach out via our site!

    Chris

Reply
  • Hi  ,

    There are no errors in what you are doing. Unfortunately, you are encountering a product defect. This behavior is currently tracked under the following bugs: 90036, 93982, & 95346. Those bugs are flagged as 'no plan to implement', but Sugar reconsiders bugs as more customers report their impact. I recommend first filing a support case to highlight those bugs impacting your implementation.

    With that said, there are two workarounds I can think of:

    Calculated Field on Accounts

    Overview: You create a calculated text field on the Accounts module to build out the intended meeting subject. You then use that field to pass the value through to the meeting subject in the action button configuration.

    Pro: Sets the name as you want on creation
    Cons: Requires the placeholder field to be added on the account record view in order for the action button to function (due to bug # 95999); requires existing accounts to be resaved/recalculated after creating the field before it will pass through a value in the action button

    1. Create a field in the Accounts module (e.g. meeting_name_c) with the following formula:
      Fullscreen
      1
      2
      3
      4
      5
      concat(
      $name,
      " ",
      $taf_value_c
      )
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    2. Once the field is created, you will need to add it to the account record view layout in order for it to function. If you have the action button also showing in the record view dashlet, then add the field to that layout as well.
    3. You will need to use the mass action 'Recalculate Values' or a solution like our Upsert Calculated Fields plugin to set that field value for all the applicable accounts. 'Recalculate Values' can only be done in batches of 1,000 accounts at a time while our plugin will scan through all accounts in the backend and perform the updates automatically.
    4. In the action button configuration, remove the existing configuration for the 'Subject' field and select 'Subject' from the 'Copy Field Value(s) From Parent' list:
    5. Once selected, select your field in the 'From Parent Field' list:

    From there, the action button should function as you expect!

    SugarBPM Sets the Meeting Subject

    Overview: Using SugarBPM, you can set a process definition to trigger on newly created meetings matching your criteria (e.g. Activity equals "TAF", Meeting Type equals "Scheduled (phone)", etc.), that then updates the meeting subject as desired. 

    Pro: Works immediately on deployment. No need to create a calculated field on Accounts module, insert that field onto your layouts, and force updates to all existing accounts
    Con: You need to set a placeholder subject on meeting creation which may cause confusion for users since SugarBPM will only update the meeting after it is saved

    Note: This solution is possible with a series of backend fields on the Meetings module and additional conditions in the process definition to get the desired outcome. In the interest of efficiency, I am presenting a simplified solution using the new Enhanced Change Field action in our Upsert BPM Essentials plugin. 

    1. Create a process definition on the Meetings module
    2. Set the start event to 'New Records Only' and set the appropriate field criteria on which to trigger
    3. Connect the start event to an action event
    4. Set the action event to 'Upsert :: Enhanced Change Field'
    5. In the action settings, select to update the current record and set the related module to 'Accounts' to define where to pull field values from:
    6. In the Subject field, select the appropriate fields from the related account to update the meeting:

    This action will run immediately on record creation, so your users will see the expected subject after they save the new event.

    If you would like more information about how Upsert Calculated Fields or Upsert BPM Essentials can help you be more successful with Sugar, please reach out via our site!

    Chris

Children
  • Hi Chris,

    WOW! Thank you so much for your help. I went with Option 1 and that's working in our Sandbox environment. Really appreciate all of the detail.

    Since we don't have the Upsert Calculated Fields plugin the Recalculate Values step was a bit time consuming. I even got a notification that it failed to process- although I couldn't find any evidence of this. the values updated correctly according to my reports and the record view UI.

    I'd be curious to take your advice on Option 2 and apply it to another process we have- thank you for sharing your knowledge.