Setting New Opportunity Revenue Line Item Assigned To and Teams

When creating a new Opportunity (Opp), the Revenue Line Item (RLI) is also created at the same time. Currently, the RLI Assigned To and Teams are set to the values of the person creating the records, but we would like the RLI Assigned To and Teams to be equal to the Opportunity Assigned To and Teams. We'd only like this on initial RLI Creation because we'd like to have the ability to change it and make it different, if needed, later. 

I was thinking of a SugarBPM process initiated on a new RLI Record Creation, but I can't seem to find the right way to set the RLI Assigned To and Teams fields to the values in the Opportunity. 

Maybe there's an entirely different way to do this, but we are new at Sugar and haven't done much in the customization way other than some SugarLogic formulas for fields and very rudimentary SugarBPM processes. 

Thanks for any help!

Parents Reply Children
  • Hi Vince,

    After having a quick glance I believe you are good to deploy and test it. Please upload the zip package in sandbox environment, test and move ahead. :)

  • Hi Vince, 

    just to make it simple: The MAC is a big messi when it comes to creation of zip-files.

    1st, your zip file must have the manifest.php and the Files directory in the root directory. In your file you find the directory rli_copy_opportunity_team_assigned_logic_hook and the typical MAC garbage __MACOS. 

    2nd there is a file .DS_store in nearly each directory, again MAC garbage which must be removed.

    3rd: A LICENSE file should be added, even if it contains only empty lines.

    When you zip your installable it should contain the following files and nothing else:

    Fullscreen
    1
    2
    3
    4
    \manifest.php
    \LICENSE
    \Files\custom\Extension\RevenueLineItems\Ext\LogicHooks\rli_copy_opportunity_team_assigned_to_hook.php
    \Files\custom\modules\RevenueLineItems\rli_copy_opportunity_team_assigned_to.php
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Related to the manifest file, I would use 

    'acceptable_sugar_versions' => array('9.*.*','10.*.*'),

    which is not the univeral unlocker like the regex. RLIs exist not since the beginning of Sugar.

    SugarFlavor CE will not work witj RLIs and is not supported any more.

    Lastly, your name is very long, This name is used to create some file names during installation. So it could happen, if the file system of the target machine has issues with long filenames (like Windows has), your function will be installed but will not run correctly.

    I always use the same strings for name and id and try to make them short and simple.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • FYI this is the command i use to zip my files on a Mac and avoid including the system-generated files:

    Fullscreen
    1
    zip -r --filesync ../packages/my_mlp_name.zip * -x "*.DS_Store" -x "*.git*" -x "__MAC*"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX