Make Revenue Line Item 'Unit Price' editable after the Relationship is populated with Product Catalogue record?

Posting here (dev) after initially looking at this from admin and also found an admin page with the same question:

How can I make the unit price editable after a revenue line item is created? 

We do not just have one unit price for each product, instead we sell via Partners and each of those has their own price list - for the same product.  So each product can have many prices.  (Note that ERP system is SAP by Design and we dont have integration to that)

So, I am wondering if anybody else knows a solution for this?  Ideally I think the following would work nicely:

  • From Opportuinity> Add the Revenue Line Item (RLI) (from dashlet on side panel)..
  • In RLI the Product (catalogue record) is selected but the Unit Price is not editable. (Hoping it can be).
  • If Unit Price could be populated from the Catalogue, but then edited it would allow our sales folk the ability to alter the price per each project.I then do not need a unit price - it could be zero?  Though i do not know the impact that will have on Forecasts further down the road.

Note - with no product (catalogue item) relationship the Unit price can be manually added...

I am scared of breaking forecasts or quotes which we have not yet configured for this.

-We have looked at vardefs but see nothing which seems to make the Unit Price do what it does.

-I don't think the Unit Price field's formula in studio seems to effect this kind of desired change.

-We can Inspect the field in browser and remove disable for that fields input... but then it doesnt really work correctly with regard to Best/Likely/Worst etc..  and if you save and come back in again its still only looking at the Unit price from the relationship.

Any suggestions very welcome!   I am stuck.

Other options are:

- to import all our dealer price lists (200+!) into the catalogue... that's alot of duplication, what about price annual updates, and even then sales will still alter the prices by using discounts per project... but this not very slick either.

-Or I can import an MRSP price which they discount from... same un-slick approach. Plus they create these mrsp's per currency so that throws up its own questions too...

Thanks for any other advice on this one...!

Luke Ridgway     Admin

john Fieldsend    Dev

Parents Reply Children
  • Thanks Andre for the extra information. But I couldn't get it to work properly. I created a custom vardefs for the product_template_name field: 

     // created: 2021-10-19 07:43:03
    $dictionary['RevenueLineItem']['fields']['product_template_name']['populate_list']= array(
        'name' => 'name',
        'category_id' => 'category_id',
        'category_name' => 'category_name',
        'mft_part_num' => 'mft_part_num',
        'list_price' => 'list_price',
        'cost_price' => 'cost_price',
        'list_usdollar' => 'list_usdollar',
        'cost_usdollar' => 'cost_usdollar',
        'currency_id' => 'currency_id',
        'base_rate' => 'base_rate',
        'tax_class' => 'tax_class',
        'weight' => 'weight',
        'manufacturer_id' => 'manufacturer_id',
        'manufacturer_name' => 'manufacturer_name',
        'type_id' => 'type_id',
        'type_name' => 'type_name',
        'service_start_date' => 'service_start_date',
        'service_end_date' => 'service_end_date',
        'service_duration_value' => ['service_duration_value', 'catalog_service_duration_value'],
        'service_duration_unit' => ['service_duration_unit', 'catalog_service_duration_unit'],
        'renewable' => 'renewable',
        'service' => 'service',

    As you can see I removed the discount_price fields from the populate list. For some reason that didn't work after a Q&R. So I checked the revenuelineitems  bean object and noticed the following: 

         * Handle the mapping of the fields from the product template to the product
        protected function mapFieldsFromProductTemplate()
            if ($this->product_template_id && (
                $this->fetched_row === false || $this->fetched_row['product_template_id'] != $this->product_template_id
            )) {
                /* @var $pt ProductTemplate */
                $pt = BeanFactory::getBean('ProductTemplates', $this->product_template_id);
                $this->category_id = $pt->category_id;
                $this->mft_part_num = $pt->mft_part_num;
                $this->list_price = SugarCurrency::convertAmount($pt->list_price, $pt->currency_id, $this->currency_id);
                $this->cost_price = SugarCurrency::convertAmount($pt->cost_price, $pt->currency_id, $this->currency_id);
                $this->discount_price = SugarCurrency::convertAmount($pt->discount_price, $pt->currency_id, $this->currency_id); // discount_price = unit price on the front end...
                $this->list_usdollar = $pt->list_usdollar;
                $this->cost_usdollar = $pt->cost_usdollar;
                $this->discount_usdollar = $pt->discount_usdollar;
                $this->tax_class = $pt->tax_class;
                $this->weight = $pt->weight;

    As you can see here the discount is always retrieved and overwritten in certain situations. So what I did was to disable the assignment of discount_price and this seems to work. But i'm not to happy to change core bean files. Is there something I missed which should get the populate_list vardefs working?