Brooklyn: Conditionally un-rendered required field causing error on save
I am testing Brooklyn in a sandbox. I have a popup where I create a new task record. I have a required field that is conditionally rendered only if a check box is checked. That checkbox is not checked, but the required field is still rendering. As a consequence, I can't save the record without completing that field.
2
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
Can I assume that this was working prior to Brooklyn being installed, or is this a problem that presented itself when you created it after installation?
If the checkbox is a UI-only field I may have experienced something similar. It may seem like a silly test, but have you tried exposing the field in your popup and switching it on and off to confirm whether it renders the required field in or out upon further prompting? Turned out in our case that despite creating the checkbox field, we hadn't actually instantiated its value anywhere. We had to use a field update action prior to the popup launching to make sure the checkbox gained a non-undefined value. Sorry if I'm barking completely up the wrong tree!
I have a few questions to drill down a bit more. First, is your conditionally-rendered field set as "required" from within Salesforce, or is it set as "required" via Skuid's own field settings? Second, is the checkbox you're using a ui-only field, or is it from Salesforce?
Also, if you're able to share screenshots of both pre- and post-Brooklyn update so we can see a bit more detail of what you're experiencing, that would be helpful too.
Mark
Are you working off of iteration 1.1?
Also, is the custom checkbox field something you can check/uncheck on your page, on the fly, to see the required field 'un-render?' If so, does the error still come up after the checkbox is unchecked?
https://community.skuid.com/skuid/topics/search-component-locked-up-with-unsaved-model-changes
I've done a lot more testing around this problem, and found it is also related to required fields that are conditionally being shown. Ours are UI fields and only required on the Skuid side, not Salesforce side.
Our application is a CPQ (quoting tool) and the search component is used to search for products and then the user configures them (gives additional required information) and then adds them to the quote.
For example:
User picks "Pack of Paper" from the search component, which searches the Product object. We pass the ID of the product to a new model called 'selectedProduct', set the ID condition and then query that model so we can get more information on it. Because this is product type "Paper" (field render condition show when selectedProduct model, field ProductType__c = "Paper",) we show a UI fields that says "How many sheets?" and the user must pick the number of sheets before adding the item to the quote. (we manipulate the pricing and/or part number based on the user's selection.)
Then user then picks "Extension Cord" from the search component. Passes the ID to the selected Product Model and requeries the model (completely replace). This is now product type "Cords" so the "How Many Sheets" UI field should disappear via conditional rendering, and instead "Cord Length" shows up - also a required field.
The problem is that the user is unable to select Extension Cord from the search component. It becomes unresponsive to the select action (searches just fine... just won't do anything when you select a product) and the console says 'uncaught exception: Model 'selectedProduct' has unsaved changes. To update this model's data, you must first save or cancel the changes'.
We have tried adding a "Cancel Model" action to the search component as the first select action and that didn't work.
When I make my UI field "How many Sheets" NOT required, then the extension cord is able to be selected. We must have the field required for our application, so this isn't a long term fix. But narrowing it down to the required field that is no longer rendered made me think it might be related to this problem.
We've been building this CPQ system for almost a year, and this week was our CRP testing, and we've run into quite a few snags like this. We'd love some help!