How do you bypass the requirement to create a Revenue Line Item before you can save an Opportunity?

Customer uses the Revenue Line Items, but doesn't want to be forced to create one in order to save the Opportunity, as this does not fit their process.  They want to create and save the Opp, then come back later and either enter or import the individual RLI records.

The admin section for Opportunities does not offer the RLI to be optionally added later.  The only choices are use the RLI or don't use RLI and then they go away entirely.

Is there a way anyone has found to bypass the requirement that you must create at least one RLI?

  • Guess no one has run into this situation yet?

    Anyone from Sugar Engineering that reads this stuff and can help?  At least a hint?  This is a big deal for this customer, and they are refusing upgrade to 7.6 until this is solved.

  • You can create a custom controller for the create-actions and record views that in turn would allow you eliminate the check for Revenue Line Items that is performed when you create a new opportunity and/or view an existing opportunity.

    The code for those would look something like this, respectively:



        extendsFrom: 'CreateView',


        getCustomSaveOptions: function(options) {

            this.createdModel = this.model;

            // since we are in a drawer

            this.listContext = this.context.parent || this.context;

            this.originalSuccess = options.success;

            var success = _.bind(function(model) {


            }, this);

            return {

                success: success



        _dispose: function() {






        extendsFrom: 'RecordView',

        initialize: function(options) {

        this._super('initialize', [options]);   


        _dispose: function() {




  • Angel, thank you for this.  I am going to try this later today.  I really appreciate the help!

  • Hi Angel.  Maybe I am doing something incorrectly on this.  I have modified the file you specify, and then installed it into:


    And I see no affect.  Either the custom file is not over riding the original file, or I am not looking at the correct lines to edit.  Even if I remove most of the lines in getCustomSaveOptions it has no affect.  Also, I did notice now (with all the original code) that when you try to save an Opp and you haven't filled in an RLI there is no warning message, it just highlights the "Likely" field in the RLI in the subpanel.  The code below shows an RLI Warning message that I never even see.

    Here is the file that is in my 7.6 install on OnDemand:














                var success=_.bind(function(model){


                    var addedRLIs=model.get('revenuelineitems')||false;











            var message=app.lang.get('TPL_RLI_CREATE','Opportunities')

                    +'  <a href="javascript:void(0);" id="createRLI">'+








            var model=this.createLinkModel(this.createdModel||this.model,'revenuelineitems');







                        var ctx=this.listContext||this.context;ctx.reloadData({recursive:false});













  • I pulled it directly from the backups that Sugar sent me of the OnDemand sandbox.  Grabbed it from modules/Opportunities/clients/views/create-actions/

    Here's what it looked like before I added some line returns for readability.  This looks the same as the one in your note:

    var addedRLIs=model.get('revenuelineitems')||false;addedRLIs=(addedRLIs&&addedRLIs.create&&addedRLIs.create.length);if(!addedRLIs&&options.lastSaveAction!='saveAndCreate'){this.showRLIWarningMessage(this.listContext.get('module'));}

    And that is the line I focused on.  I tried to remove it and I tried to just set it to true.  No effect.  Unless I did something wrong, of course. 

  • Angel, I've tried just about everything in both the create-actions.js file and even now I've tried the record.js file.  It seems that nothing has any affect on the requirement to create a RLI before you can save an Opportunity.  Is there any other area that I can chase down that anyone knows of to help with this?

    Anyone from Sugar Engineering that might be able to point me in the right direction?


  • I think I know the source of part of the problem here. I think each of us is talking about different parts of the problem.

    To clarify, there are two matters relating to the use of RLI entries. Assuming you are using a version prior to 7.6.0, upon one creating a new Opportunity, one would receive a prompt informing the user that they needed to create at least one RLI. A similar alert would appear if you happened to go to an existing Opportunity that didn't have at least one linked RLI entry. This is the first matter and is addressed by the code snippets that I referenced.

    In 7.6.0, the creation process changed a bit and now you can enter an RLI at the same time that you create the new Opportunity. This is where I think I got confused and thought you were talking about the alert I mention above. Given that the RLI entry panel is displayed as part of the new Opportunity window and some of its fields are required, it is not possible to create an Opportunity without also creating at least one RLI entry.

    If I now understand your goal correctly, what you want is to effectively remove the RLI panel from the Opportunity creation window so as to not force the user to create that entry, would that be correct? (And second to that, the removal of the alerts that will likely come back by way of no longer forcing the creation of that one RLI entry).

  • Angel, you are right on with this.  That's exactly the issue.  I had in the 7.5 disabled the warning message for customers.  But in 7.6 it's now required that you create an RLI.  I would just like that subpanel to go away in the Opp create screen.  I've tried altering subpanel-for-opportunity-create.php and that didn't help either.

    I'm digging in even deeper at this point.  Where I haven't tread before.    I'm open for hints.

    I will reply here if/when I figure out the solution.

  • You'll want to modify the create-actions layout for Opportunities, located here:


    The metadata file (create-actions.php) will contain the following:

    $viewdefs['Opportunities']['base']['layout']['create-actions'] = array(

        'type' => 'create-actions',

        'name' => 'base',

        'span' => 12,

        'components' => array(


                'layout' => array(

                    'components' => array(


                            'layout' => array(

                                'components' => array(


                                        'view' => 'create-actions',



                                        'layout' => 'subpanels-create',



    In your version of this file, you should be able to get rid of the RLI panel by simply removing this snippet:


                                        'layout' => 'subpanels-create',


    Give that a try.

  • Thank you for your patience in working through it Angel.  That was the ticket, getting into that create-actions.php and commenting out those lines, then in the create-actions.js and the record.js making sure the warnings don't come up, and it's done!



  • Is this upgrade-safe if you're directly editing a file not in the /custom directory?

    And for On Demand installing this through the Module Loader, is it possible to comment out that


              'layout' => 'subpanels-create',


    without overwriting the default file (perhaps uploading this to somewhere in /custom)?

  • Logan,

    Apologies, the point wasn't clear as the message was merely directing Eric to the file that would need to be customized. You would still need to make the change in the ./custom directory.

  • Hi Angel,

    Is there a way to keep RLI subpanel on Opportunity create view, BUT make it not required? As of now RLI has a couple required fields and does not allow you to save Opp without them completed, which means RLI created. If I make original RLI  module fields not required and save Opportunity with empty RLI fields, would it create empty RLI or there is another way to achieve this?



  • Hi Dmitrii Mikhalchenko 

    You can extend the controller modules/Opportunities/clients/base/views/create/create.js and override the method "getCustomSaveOptions". Basically you need to drop of the following line

    this._checkForRevenueLineItems(model, options);

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply Children