Roll-up RLI Product Category Values to Opportunity Multiselect

We would like a field on our Opportunity record that reflects all of the Product Category values on related Revenue Line Items. For instance, for an Opportunity with 2 Revenue Line Items, if a "WP" Product Category was on 1 Revenue Line Item and "EC" was on the second Revenue Line Item, we would have a field on the Opportunity that reflects both "WP" and "EC" so that we can filter and report on "Opportunities with Product Category "WP", for instance. 

We like the idea of the "RollUp" SugarLogic formulas, but there isn't anything like this for these fields, so we were thinking maybe a SugarBPM process could do this for New Opportunities and whenever the RLI Product Category field was changed. 

Thanks...VO

Parents
  • What is the purpose on configuring in the Opportunity a custom multiselect whose options are the unique categories related to RLIs? Can you eplain, please?

    Through Reports you should be able to fetch all Categories related to RLIs related to a set of Opportunities, so what is the point?

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • What is the purpose on configuring in the Opportunity a custom multiselect whose options are the unique categories related to RLIs? Can you eplain [SIC], please? We want to be able to filter Opportunities based on what Product Categories they have in them. 

    Through Reports you should be able to fetch all Categories related to RLIs related to a set of Opportunities, so what is the point? Having them available in List View filters is the point, I believe.

    Thanks for asking and helping! VO

  • Thank you for your answers, so the strategy solving that puzzle:

    • Create a dropdown list containing all the available Product Categories. Mind that you will need to update such dropdown list whenever changes are made on Categories module (update, create, delete). We have implemented some logic hooks which update a dropdown list as per changes on a specific module. This may be a good start point for you for maintanance.
    • Create a logic hook before_save on Opportunities which looks for all RLIs related to an Opportunity being created. Fetch the Category for each RLI and populate a custom multi select field accordingly (the one for which you created the Categories dropdown list).

    Good luck!

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thank you, Andre! I haven't written or deployed a logic hook before, so I will need to get up to speed on that. 

    Is there a reason why SugarBPM is not used for these types of things that are initiated when records are created / editted? I see Logic Hooks brought up a lot more than SugarBPM among those that know the platform, so I'm wondering how decisions are made on what tools to use for customizations. Thanks for any insights. 

  • I always try using SugarBPM first so that it can be changed by a non-developer. But it does have some limitations and that is when I choose to use Logic Hooks. Sometimes, more complex SugarBPM processes can be more efficient when written as a Logic Hook but the changes require a developer.

  • SugarBPM is powerful and quite useful for common requests, but for some specific ones, like yours, can not be accomplished on once it is very specific one. In that case you need to surrender to logic hooks.

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply Children
  • Yes. And that is one option but in some cases like this one it is easier to create a Logic Hook than to extend SugarBPM.

  • There is a working example of user configurable custom php that can be executed from SugarBPMs.

    Currently this example does not play nice with Sugar Cloud given that it can dynamically call methods which are not allowed on our policy, but with some refactoring it should get you there.

    I know that one of my colleagues was attempting to make it Sugar Cloud compatible but I have not followed up on that yet.

    The example (taken as-is) is on my github repo: https://github.com/esimonetti/SugarAdvancedWorkflowCustomPHPMethods

    Cheers

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • Hi there

    as mentioned, there is an example repo on his GitHub that allows you to create custom SugarBPM Activity Elements that allow you to overcome many of the limitations that you might encounter using SugarBPM out-of-the-box. It is based on a talk presented at SugarCon a few years ago and provides some background into what is going on in Enrico's repo.

    The link to the content in SuagrClub is Extending SugarBPM

    I have personally leveraged it for a POC to automate certain lifecycle events with the Customer Journey PlugIn. The repo is a good starting point to get the creative juices flowing and by all means be an option to implement the functionality you're after. The only issue is that it is not SugarCloud friendly because of some restricted functions that are used. I did do some work to refactor the example and make it SugarCloud friendly, but it's unfinished. I might dust it off if there is interest.

    Thanks

  • I know a few scenarios that could definitely make use of it.. so if you've got time.. would love to see it finished!!