Bug with after close actions feature?

  • 1
  • Problem
  • Updated 2 years ago
I have an after close action set up on a popup which should cancel changes on the opportunity model. However, I've been able to reproduce scenarios where the changes are not cancelled. This is leading to some issues where records can be saved with incorrect or incomplete data.

Are there any known bugs or considerations for using after close actions? 
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Kathryn, which version of Skuid are you working with? 

If you've got an after-close action that cancels changes, do you have any save actions or save buttons available prior to when that close happens? The reason I ask is that the "cancel changes" action wouldn't be able to retroactively undo changes that were already saved. 
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb
The right model is selected. I don't know if all after-close actions are being affected but I couldn't find any pattern either. 

The pages do have js snippets, but to be clear, rather than changes being saved automatically, what is happening is that after closing the popup, the save button on our main page remains enabled. The expected action is that the button is not enabled because the changes to the model should be cancelled once the popup is closed.

Other than pushing a newer Skuid version out is there anything else I can do?
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hi Kathryn -

There's lots that can be done to troubleshoot this.  I'll echo Mark's comments above and discourage pushing a new version of Skuid to your production orgs.  Instead, if you would like, spin up a new sandbox with latest Skuid and see if the problem exists.  

Either way, it should be possible to troubleshoot and identify root cause on 8.11.

Along those lines, a few questions:

1) You mentioned you can reproduce the issue.  Are you able to reliably reproduce the issue (e.g. same set of steps each time trigger the problem)?
2) Is there any output in the browser console window?  What could be happening is that a JS exception is being thrown which aborts the remaining actions (including the cancel) to fire.  From an end-user perspective, all appears normal but under the covers, things went awry.  Please check the browser console and let us know if there is anything.  If there is, please include a screenshot
3) How many fields are being updated on the popup that are supposed to be cancelled?
4) Is one (or more) of the fields a picklist?
5) What other actions are in the after close sequence?  Can you copy/paste a screenshot of the entire action sequence please?

Having the information above will give lead us to the next set of steps to take.
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb
Hi Barry,

Thanks for your thoughts. 

1. It took a while but I reproduced again today, so it looks like it's not something failing on specific opportunities. Once I have reproduced on an opportunity, I can continue reproducing reliably, however there is no obvious trigger for reproducing.
2. No JS errors or errors in the network console, sadly.
3. The popup contains about 3 fields.
4. Yes, one is a picklist.
5. The only after close action is cancelling the changes.

Thanks again!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hi Kathryn -

Thanks for the answers.  We are getting close to isolating the issue but are at a fork in the road so to speak regarding which path to take to finalize the identification and resolve.  

In order to determine which side of the fork we'll travel, a few additional questions:

1) You said that the changes should cancel but they are not cancelling.  Reading further in to some of your comments, do you say they aren't cancelling because the "save button" on the main page isn't getting disabled and/or because you've manually inspected the model and confirmed that the fields themselves are not reverting to their previous values?

2) Is this a new page or new functionality added or an existing page or is this an existing page that used to work but now is not working?

3) In your answer to #2 above (inspecting the browser console), you mentioned there were no errors in the network console.  Can you also confirm that there are no errors in the browser console (not the network tab but the console tab)?  Or maybe this is what you meant when you said "network console"?

4) What are the conditions that you have on the "Save" button on the main page?

Thanks!
(Edited)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hi Kathryn -

I remembered that we hadn't heard back from you on this so thought I would lend a couple more thoughts to this just in case you circle back and/or someone else encounters the same issue.

I'm going to make some assumptions before I suggest what might be causing the issue:

1) You have a "save" button marked with a condition to be "enabled" when the model has "unsaved changes"

2) You have a picklist marked to required and not to allow "None"

3) after the popup closes, the "save" button is enabled even though model changes were cancelled

4) the data in the model itself for the non-pick list fields has reverted back to its original values

5) The data in the picklist field is different than what it was originally.  Most likely, its original value was "blank/empty" but after close it's the "default" value for the picklist

If all the above are true, then the likely cause of your issue is described here https://community.skuid.com/skuid/topics/model-haschanges-immediately-after-cancel-changes-due-to-re....  In short, because the picklist field is required and was blank to begin with, Skuid applies a value to it.  This results in the model having changes even though changes were cancelled.

There is dialogue in that other post for Skuid to provide a solution for this issue.  Your scenario is another use case where having a solution becomes more important.  I'll update the other post to link to this post for visibility in hopes that a solution will be forthcoming.

If the above assumptions and reasoning aren't correct for your situation, please let us know and we can continue to dig deeper.