SFDC Validation Rule Error Messages and Tab Sets

  • 1
  • Problem
  • Updated 10 months ago
  • Solved
  • (Edited)
I have built new SFDC validation rules to give custom error messages to our customers when they use our community. We use Skuid pages rather than native layouts. I have a Tab Set component with multiple tabs and use conditional rendering to segment the UX. The validation rule error messages display fine on the first tab of the Tab Set, but they fail to display in the second or third tabs. I know the validation rules are working as expected, but they fail to display the errors only when I am inside the second or third tabs. 
>>I am using Skuid version 10.0.5<<
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
  • frustrated

Posted 1 year ago

  • 1
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
My first guess is it isn't the tabs themselves creating the problem, although anything is possible. You may need to provide information about the components within those tabs.

Where I have seen validation messages fail to appear is when the model whose object has the error does not have a visible field in the UI. This might be where a popup displays a field editor for a child object but the parent object is updated in the action framework. The SFDC throws an error on the parent, but the popup is not displaying that object. I think the workaround is to include a field editor for the parent object in the popup, but you may be able to conditionally render any fields from being displayed - or just not show any.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Pete, is this a situation where a field with a validation error is present in several tabs on the page, and the error message doesn't show above all of these instances of the field? I have tried to reproduce the issue you're describing, but we could use a bit more information about your scenario to be able to do so. In the process, I noticed that the setup for the validation rule itself will let you specify which field the error message will show above. I overlooked this setting at first, and so the validation error messages weren't showing 'inline' because this setting was defaulted to some other field, and not the field that had the error. Could your error messages perhaps be attached to a field that's not being brought into the Skuid page?

Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Thanks Mark & Mike. I have double checked that the user profile has access to all of the fields in SF, and made sure that all of the fields with validation rules are in the page. And no I don't have the fields replicated throughout the page in other areas, they are only on the page once. All of the validation rule error's are selected as showing inline next to the field. 
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Pete,

I'm testing this in 10.0.10, and I'm seeing validation errors appear above the appropriate field, if I'm on the tab that displays that field. I also see an error display at the top of the page.  Is there any chance you could share a few screenshots to illustrate the actions you're taking and the expected vs. actual behavior? I can share the XML for my page, but unless you have the same custom fields and validation rules, it won't be useful for you. Here's what I see:








Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Yes I have experienced that problem as well. Where the error message will display inline where it should be, but also displays at the top or bottom of the page. Hang on and I will post something for you Mark. Thanks
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Mark this is a picture of the validation rules working properly. This is the same page, all I did was remove all rendering conditions and strip out the tab set so everything is in one flowing page.
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
This is the same page before I stripped the tab set out and removed the rendering conditions. You can see that there are no error messages displaying behind the error message. But clearly they are working.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
It looks like there might be a custom theme in use here - would you be able to test this page with a default theme? (The theme I used was our Lightning theme, for example). 
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
You are correct. We use a custom theme.
Photo of Will.I.Yam

Will.I.Yam

  • 216 Points 100 badge 2x thumb
Hey Pete - It looks like the action framework (maybe on a save?) is erroring and it's not actually getting to the save state to throw the validations.  Do you know what action has that error pop up for "Oops... we missed something."
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Hey Will. The Oops message is an 'On Error' action message for when it is saved to the model. See my attachment for the actions sequence. 
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
All of the validation rules are only positioned so they only trigger according to the field update that the button commits for that section. It grabs the NOW value and if there is an error it sets the field value back to blank. Here is an example f the validation rules
Photo of Will.I.Yam

Will.I.Yam

  • 216 Points 100 badge 2x thumb
In the "Save Changes in Model: HFApp" with the error out of "Show message and block UI," is there a time out for it? Also what's that other thing doing? Maybe I can get login access?
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Yes it only times out for a few seconds. The other thing is a field update which sets the value back to blank. Since that Date/Time field is used solely for rendering purposes, if it does not get reset back to blank then the user will get locked. And yes if you have time that would be great!
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hello Pete, it's been a while, but I wanted to check back in and see if this issue is still unresolved for you. If so, can you share a status update to bring us up to speed?
Photo of Praveen Pannala

Praveen Pannala

  • 580 Points 500 badge 2x thumb
@Mark, Am also running into same issue what Pete had.We are using 11.0.3 version of skuid. We have several tabs on the page. Here is my scenario.

1) We added the button to top of the page in a button set. 
2) We have several page include components in each tab. Button set created above saves the models from page include aswell.
3) If I make a change in 1 of the page include component to match the validation rule, when i press save it does not show error message and my changes are not saved,
4) I navigated to all the tabs and clicked save, but they are still not any error message.
5) Now if I make change on some fields on first tab and hit save then will show me the error message related to page include tab validation.

I checked the debug logs and every time when i clicked the save there was validation error message shown in the logs but same message is not showing on the skuid page.
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Mark I was able to figure this out (workaround?). Because I was using SFDC validation rules and skuid UI conditional rendering with the same field, the rendering would not work properly. So I changed my design to include a new field (checkbox) in SFDC to get around this. Essentially, my button now includes two separate update actions. One that is used solely for SFDC validation rules, and the other which is used solely for conditional rendering (checkbox). Since making this change, everything is working as needed. I do wish we could have done it with just one SFDC field, but hey, at least it's working! Hope this is helpful Praveen.
Photo of Praveen Pannala

Praveen Pannala

  • 580 Points 500 badge 2x thumb
@Pete, Thank you for responding on it. I will try this but also update models which are part of page include from the master page save button.

I tried removing the page include and added the other models to my page and everything was working fine.

I think there could be some issue with page includes models being updated from the page containing it.
Photo of Pete Bennett

Pete Bennett

  • 310 Points 250 badge 2x thumb
Sounds good Praveen. Good luck with your project!