New skuid opportunity page amount on the opportunity not locked after opportunity lines are added

  • 1
  • Problem
  • Updated 2 years ago
  • Acknowledged
We created a custom skuid opportunity page to replace the salesforce default opportunity page. On the default salesforce page opportunity when opportunity line items are added the amount field on the opportunity uses the amount off the opportunity line item and locks it so users can't update the amount field. On the skuid opportunity page we added amount however it is not getting locked when opportunity line items are being added. 
Photo of Shane Horan

Shane Horan

  • 80 Points 75 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matt Brown

Matt Brown, Employee

  • 798 Points 500 badge 2x thumb
Shane, how was the amount field being locked before? Apex trigger?
(Edited)
Photo of Shane Horan

Shane Horan

  • 80 Points 75 badge 2x thumb
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,260 Points 5k badge 2x thumb
Shane~

I have been able to reproduce the error you are seeing. I have alerted our developers of this and this will be fixed on a future release. We will let you know when the fix is available.

Thanks for reporting this issue to us to help make Skuid a better product!!!
Karen
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,260 Points 5k badge 2x thumb
Shane~

Here is a workaround if you are using the Amount field in a Field Editor (versus using it in a table which would be much more difficult to implement this on your own.

For a Field Editor, it would be easy to implement this at a per-page level using Conditional Rendering. The approach is this:

1. Have either a Model or Child Relationship to pull in the Line Items for an Opportunity. If you're not using the Line Items in the page any other way, limit the Model / Child Relationship to just get 1 row, since you only need to know if there's 1 row to determine how to Conditionally Render the Amount field.

2. Add the Amount field twice to a Field Editor, a Read-Only and a non-Read-Only version. Add Conditional Rendering to the Fields based on whether your Line Items model has data rows, or based on whether the Child Relationship has rows (the Child Relationship-based Conditional Rendering is trickier, but can be done with a Ui-Only Formula Field e.g. "HasLineItems__ui" using a formula like this IF({{OpportunityLineItems.totalSize}}==0,false,true)

Hope that helps ...
Karen