How to load a relate field into another field

Hi Everyone,

We currently have a relate field and would like to have the value selected in this field appear in another field on the same module. To my knowledge, it is not possible via studio and a calculated field. Has anyone had any luck loading a relate field to another field? Please note this is not a relationship field either.

Fields:
1. Relate field to users module from opportunities
2. Text field on opportunities module.

Sugar version 10.0.2

Thanks!

  • Hi Dan,

    if you mean fields like these:


    then it takes a few clicks to configure the logic hook with Logic Builder (https://logicbuilder.integroscrm.com) with no coding and generate zip:




    If to install zip with Module Loader, it will enable the following behavior:


    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Forgive me, but I would question the underlying requirement, what is the basic reason behind the request?

    It looks like you are taking the name, or user_name, of the related User and putting it in a Text field, is that correct?

    What will you do with that text field that you can't do with the Relate field?


    FrancescaS

  • I am wondering the same thing as but its easily done in a logic hook.  Something like

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <?php
    class accounts_bs_hook
    {
    /**
    * @param Account $bean
    * @param string $events
    * @param array $arguments
    *
    * We have 3 different types of accounts and each needs its own Before Save hook
    */
    public function beforeSaveLogic($bean, $events, $arguments): void
    {
    //The ID from this relate would be
    // $YOUR_TEXT_FIELD_ID_c = $YOUR_RELATE_FIELD_c_owner
    $YOUR_TEXT_FIELD_c = $YOUR_RELATE_FIELD_c;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • I've added an email address to the example above, because it seems that it is not possible to send a message, (e.g.notification) to that related User via OOTB SugarBPM

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • The solution is pretty easy to accomplish either by sugarLogic on Studio or Dependency SetValue:

    related($some_user_link,"the_field")

    Obviously replace "some_user_link" and "the_field" by appropriate values.

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • AFAIK, this approach works if there are relationships, but won't work via Studio for the fields of Relate type, as requested

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Hi - The main reason that you can create a workflow based on a text field and not a relate field. The goal was to auto generate an email when the text field changes which is not available using the standard workflow tool in the professional version.

  • In that situation I would do a logic hook that looks to see if the relate field has changed, and if so triggers your workflow. It's a simple process of comparing the field content before and after the changes are made. 

    I have not played with Workflows in Professional, we only had a couple when it was communicated, quite some time ago, that workflow would go away from Professional version so I converted those few to logic hooks, but I am guessing there is a way to use workflow, perhaps by checking the relate field's ID rather than the field itself, and you can find that name in the vardefs in your cache file.

    Best of luck.

    Francesca