Update Field based on two other fields

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I currently have 3 fields setup in the products model for our 3 different pricing tiers (p1,p2,p3). These are used for standard price sheet mail merges. 

I would like to eliminate having our salespeople from manually entering the price when creating opportunities. They should be able to enter the quantity and the price automatically update based on the quantity. What would be the best way to accomplish this? 
Photo of David Jordan

David Jordan

  • 148 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
David.   This is going to take some Javascript to get done.  But not to worry.  I don't think it will be that tough. 

For starters - you should go here:  http://help.skuidify.com/m/getting-started/l/151288-copy-paste-individual-sample-pages-you-can-see-i...
This is a set of starter pages.  Look for the opportunity detail page there. 
Note that there is a link to a javascript file that you will need to set up as a static resource. 

The javascript in that page takes the product price and prepopulates it into a line item based on the product selected, and calculates total price. 

In your case,  I believe you'd need to determine what pricing tier you were using and use the appropriate field as the basis for your calculation.  A little more complicated,  but not bad.. 

Hopefully that gets you started. 
Photo of David Jordan

David Jordan

  • 148 Points 100 badge 2x thumb
Hi Rob, as someone who is not familiar with javascript, would this be something you think I could tackle alone? If not, can you send me in any direction to get someone to help write the javascript code? 

Thanks for your reply! 
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Anyone on the community want to reach out to David to offer some help? 

David, the javascript here is attainable, but there are some wrinkles associated with the Salesforce opportunity line item process that you need to take care of.  We've done it in the file I sent you,  but not for exactly your scenario.  
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
David I can help you with the Javascript just try to post as detailed a description as possible of what you're trying to do. Videos and screenshots are really helpful as well.