locked
I need to add misc charges on opportunity product. Can anybody help me with that ? RRS feed

  • Question

  • I need to add misc charges on opportunity product.

     I tried to add new field ' misc chrg' and  changed the on load,  save , on change events to calculate extended amount  ' baseamount - discount +misc chrg  ' .  but it  did not work fine. Extended amount is calculated automatically by subtracting discounts only.

    can anybody help me ? its urgent.

    thanks in advance.

    Thursday, November 4, 2010 9:21 PM

Answers

  • So, I just tested it.  There is no way to override the price.  The reason you're getting the error is because the "ispriceoverridden" attribute doesn't exist on the Opportunity Product form, and won't even work if you add it onto the form with a customization (that's because no supporting scripts exist).  I apologize for overlooking which Product record we were working with; I initially thought it was the Quote Product, not the Opportunity Product.

    Even if you forcibly submit different values to the server for the Price Per Unit, Amount, or Extended Amount fields... they are ignored, and replaced with the pricing calculation performed at the server.  So, I think it's safe to say that there is no supported way to perform the customization you seek.

    I recommend, instead, using an alternate Opportunity Product entry to itemize "Misc Charges".  If you require the ability to override a price, do it from the Quote, Order, or Invoice records.  Those all support overriding the price of a line item.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, November 5, 2010 10:28 PM
    Moderator

All replies

  • Hi,

    You have to do two things in your java script

    1. Overide the price

    crmForm.all.ispriceoverridden.DataValue =1;

    2. Force Submitt

    crmForm.all.extendedamount.ForceSubmit = true;

    Regards

    Faisal

    Friday, November 5, 2010 1:46 PM
  • hi

    tanks for your response.

    i tried to use crmForm.all.extendedamount.ForceSubmit = true; in my onsave event, i am getting  ERROR: 'crmForm.all.ispriceoverridden is null or not an object.

    thanks,

    Sandeep .

    Friday, November 5, 2010 5:25 PM
  • Did you add the code to the Quote or Quote Product.  "ispriceoverridden" is a locked attribute on the Quote Product form, so it should be there at all times, regardless of customizations.  You should be able to place the following code in the Address Bar of a Quote Product window (press F11 if you don't see the Address Bar) and receive a "true" or "false" response:

    javascript:alert(crmForm.all.ispriceoverridden.DataValue);
    


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, November 5, 2010 5:44 PM
    Moderator
  • i didnot let me write anything in the addressbar.
    Friday, November 5, 2010 6:20 PM
  • If you have IE 8, or IE 7 (with the Developer Toolbar installed), you can press F12 and get a Developer window with a Script tab.  There, you should be able to put the code:

    alert(crmForm.all.ispriceoverridden.DataValue);
    
    


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, November 5, 2010 6:28 PM
    Moderator
  • thanks for your quick reply.  but still i cant write anything in the script.
    Friday, November 5, 2010 6:51 PM
  • can you please send me some more details. if possible any example.

    thanks,

    sandeep.

    Friday, November 5, 2010 9:15 PM
  • So, I just tested it.  There is no way to override the price.  The reason you're getting the error is because the "ispriceoverridden" attribute doesn't exist on the Opportunity Product form, and won't even work if you add it onto the form with a customization (that's because no supporting scripts exist).  I apologize for overlooking which Product record we were working with; I initially thought it was the Quote Product, not the Opportunity Product.

    Even if you forcibly submit different values to the server for the Price Per Unit, Amount, or Extended Amount fields... they are ignored, and replaced with the pricing calculation performed at the server.  So, I think it's safe to say that there is no supported way to perform the customization you seek.

    I recommend, instead, using an alternate Opportunity Product entry to itemize "Misc Charges".  If you require the ability to override a price, do it from the Quote, Order, or Invoice records.  Those all support overriding the price of a line item.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, November 5, 2010 10:28 PM
    Moderator
  • thanx alot.

    i really appreciate your help.

     

    Sandeep

    Tuesday, November 9, 2010 4:30 PM
  • Note that price can be overridden in CRM 2011 Opportunity Products...

     


    Warm Regards,Paul (xRM Ranger). {"a wiz": "must wiz"}
    Tuesday, November 9, 2010 8:07 PM
  • hi DavidBerry

    Can i add misc chrg to quote products?

    Tuesday, November 9, 2010 8:10 PM
  • I'm sure the calculation parameters for Quotes occur at the platform as they do for the Opportunity.  So, you'll need to use some combination of the price override and a custom field to do this on a product-by-product basis.  What you may lose, however, is the base-price of the item (since the price-override only opens up the "Price Per Unit" field for modification, and you need to be concerned about multiple-application of the "misc" charge.)

    Perhaps the best approach for Quote Product-specific "misc" charges, would be to capture the "Price Per Unit" in another custom field (e.g. "Base Price Per Unit"), and add this together with the "Misc Charge Per Unit" field, into the natural "Price Per Unit" field.  That would trickle down into the Amount and Extended Amount fields naturally.

    I maintain, however, that perhaps you should consider one of several alternate approaches:

    1. Use a new Price List; this works only if your "misc" charge is identical across many different situations, but may be impractical when the "misc" charge is dynamic
    2. Use another "Write-In" Quote Product to itemize Misc Charges; this may not be ideal if your intent is to conceal the charges from the customer (however, you could filter these from a report or document generation based on some flagging attribute), or directly associate the charges with specific line items
    3. Create a way to connect Quote Products to each other.  I've found this is only possible using an "intermediary" entity (since Quote Products are incapable of being on the "N" side of a relationship).  That way, you could incorporate option number 2, while being able to maintain the association between Quote Products that represent both the individual product, and its related "Misc" charge.

    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Tuesday, November 9, 2010 8:49 PM
    Moderator
  • Hi DavidBerry

    i tried a new way to add misc chrg on the opportunity products.i have created a new attribute to enter discount. and already existing manualdiscount field is using to store discount- miscchrg.   ie instead of making change in the extended amount i am trying to change manualdiscount field, so that extended amount ll be automatically calculated from base amount and manualdiscountfield. for this i need to change the manualdiscount attribute , so that it can accept  negative values too. ( for eg: if i dnt wanna give any discount but still want to add misc chrg 1000 then manualdiscount ll be calculated as  discount- misc chrg ie 0- 1000 = -1000 then extended amount ll be calculated as baseamount- manualdiscount ie baseamount- (-1000) . is it sounds right to you or not?

    Wednesday, November 10, 2010 3:42 PM
  • sdhaliwal,

    That doesn't sound right to me.  But it might work.  You can update the "manualdiscountamount" attribute on the Quote Product, and the "discountamount" attribute on the Quote (you must do both) to accept a negative value.  It'd set it's Minimum Value to "-1,000,000,000,000.00" and see how that works for you.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Wednesday, November 10, 2010 5:34 PM
    Moderator
  • i am back with same question . Is there ANY  way to add misc chrg on opportunity product.

    thanks

    sandeep

    Tuesday, November 30, 2010 3:44 PM