State names suddenly wrong

  • 3
  • Problem
  • Updated 2 years ago
  • Solved
The previously accurate state codes I was showing on my SKUID-ified Contact layout now gives me random (seemingly Italian) state names instead of the correct USA states.



However, when editing the picklist, the correct value is shown:



This is confusing my users greatly, any advice on how to deal with this would be appreciated.


Thanks!
Eulogio
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
  • confused

Posted 2 years ago

  • 3
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,542 Points 10k badge 2x thumb
Eulogio,

I am working with a customer who sees this issue when viewing the State/Province Code through another object (like showing a related Account's State/Province Code on a Contact detail page).  I am not seeing this in a field editor.

One thing that you should check is that you have added the 'MailingCountryCode' field to your field editor.  Make sure that it has 'United States' showing.  If this field is not set, then the 'MailingStateCode' will not show the right value.

What version of Skuid are you using?

Thanks,

Bill
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,542 Points 10k badge 2x thumb
Eulogio,

I wanted to update my comment.  In my developer org., I have enabled State and Country Pick Lists.  I am seeing the same issue as you.

I have a list of Accounts in a table.  The ShippingStateCode field shows as province in another country even though I have the ShippingCountryCode field set to 'United States'.  I have Skuid 11.0.3 installed.

Skuid,

Will you take a look.

Thanks,

Bill

Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
Hi Bill,

I did include the StateCode and CountryCode fields in my field editor. This was working fine a couple of months ago, so I suspect either Salesforce or Skuid came out with an update that disrupted this.

I enabled State and Country picklists at the beginning of this year, and was able to use them properly in Skuid.

I have 11.0.1 installed, and based on your experience, it doesn't sound like updating will fix this problem. Hoping for an official response soon.


Thanks!
Eulogio
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Eulogio. Have you recently updated Skuid to 11.0.1, and did the issue begin at that time? 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
Hi Mark,

I did recently update to 11.0.1 at the beginning of this month, but I did that hoping it would resolve this issue. I've been experiencing this for at least 3 months now I believe. Do you have any idea what may be causing this?


Thanks!
Eulogio
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
I'm trying to reproduce the issue now. If I can, I'll then try to do the same in other Skuid versions. Salesforce also pushes frequent maintenance releases of their own, so we don't know yet what has changed. If you can pinpoint when this issue first surfaced for you, that will help in investigating the cause. 

Were there changes to your org's settings, or the Account fields & settings that may have had an effect? I know Bill is seeing the same issue, but I'm looking to rule out as many possible causes for the issue as I can. 
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Also, which Skuid version were you using prior to upgrading to 11.0.1?
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
I believe it was 9.5.10?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Eulogio and Bill, I can see the difference in performance between an org using Skuid 11.0.1 and an org using 9.5.6. Version 9.5.6 is behaving as expected, while it seems that 11.0.1 is rendering a state code without referencing its country code for context. More investigation will need to happen to pinpoint what has changed, but I will share this with our development team. We will update this conversation once we have more information, or a fix has been made available. Thank you very much for surfacing this issue. 
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,542 Points 10k badge 2x thumb
Mark,

I am glad you were able to replicate the issue.  Thanks for the update.

Best!

Bill
Photo of Daniel Camp

Daniel Camp

  • 542 Points 500 badge 2x thumb
Mark - any update here. We at AFL updated our production environment to Millau today and we are seeing this issue.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Daniel,

This is an issue that our engineers are currently working to resolve in a future release. I don't have a timeframe for you yet, but I will keep you posted on this topic as more information is available. I will pass along the information that your production environment is affected. 
Photo of Daniel Camp

Daniel Camp

  • 542 Points 500 badge 2x thumb
Mark - any update here?
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,542 Points 10k badge 2x thumb
All,

Just confirming that I still see a problem with the State name rendering in Skuid 11.0.5.

Thanks,

Bill
Photo of Daniel Camp

Daniel Camp

  • 542 Points 500 badge 2x thumb
We are on 11.0.3. Does an upgrade to 11.0.5 fix it?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Daniel, Eulogio and Bill,

Thank you for your patience. A fix for this is scheduled for our next maintenance release, and we'll be sure to update this conversation to confirm when it's available.

-Mark
Photo of Ashwat

Ashwat

  • 768 Points 500 badge 2x thumb
@Mark has this been solved with 11.0.6?

Millau (11.0.6) - Release Notes

Bug Fixes

  • [CORE-937] - Deck components inside a drawer, inside a popup cause their drawers to duplicate instead of close
  • [CORE-1116] - State/territory code fields in Orgs that use "State and Country/Territory Picklists" aren't using Country Code for context
  • [CORE-1117] - Table Column Summaries should be disabled in "Mobile Responsive" view
  • [CORE-1191] - jQuery Rules applied to input, select and textarea elements in a popup
  • [CORE-1234] - Microsoft Excel DST: Excel Date formats for DATE and DATETIME fields are formatted incorrectly
  • [CORE-1256] - Page breaking JavaScript exception in Lightning Community Builder
  • [CORE-1258] - Feedback button positioning is cut off in left/right position
  • [CORE-1267] - Offline in VF does not load if Feedback is enabled
  • [CORE-1334] - User Licensing / Perm Set Auto Assignment does not work for Community User Self Registration
Does the 2nd bullet point correspond to this issue?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Official Response
Hello Ashwat,

Thank you for pointing this out. The release notes for 11.0.6 did list the second bullet point, referencing a fix to this issue. However, the fix for this issue was actually present in Skuid release 11.1.1, not 11.0.6. Both versions were released concurrently this week. We apologize if this was misleading, and we've corrected this information on the release notes page. Please feel free to give 11.1.1 a try in a non-critical sandbox to verify resolution. 

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading.
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
I can confirm that 11.1.1 fixed the bug for me, thanks!
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Eulogio, are there custom render snippets being used here? Or, any other model condition, conditional rendering, or custom code that would depend on model data being present? If so, the page might be having a sync issue, where a model is perhaps being loaded 'client-side' (after pageload), but a custom field render snippet, or almost any render condition, or something like that, is trying to look at the model's records. The condition or snippet may be looking for the model's records before/during pageload, before the records have been loaded. Does that make sense?
(Edited)
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
Yep that makes sense, I guess I'm confused as to why this is an issue now when it wasn't before.

I have another page that is experiencing similar issues, where a static resource is no longer being loaded correctly:
skuid__SkuidJS:5 There was a problem rendering a component of type skuidpage: jSignature is unable to find import plugin with for format 'null'

Is there something I should be doing differently with these pages compared to earlier Skuid versions?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hmm, did you recently refresh a sandbox by any chance? There was a known Salesforce issue (now resolved) that affected the process of copying some static resources into the new sandbox. Here is the information about that issue: https://success.salesforce.com/issues_view?id=a1p3A0000018BvQQAU

It would have affected sandboxes that were created between around February 13 - 21. 
However, if you were affected by this, I would expect all Skuid pages to be affected.
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
It looks like jSignature is a jQuery plugin you might be using in this page. It sounds like the plugin isn't finding a valid format value, but I'm not sure where that would be coming from in your case. 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
This is all occurring in production, and again, it was functioning before updating to 11.1.1. Not sure if there should be another way I'm loading these libraries or if there's some other dependency I should be including with the new update.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Eulogio, can you share any more information about the way you're loading jSignature into Skuid? Is there a 'format' parameter jSignature needs? If so, where's that coming from?
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
I have the jSignature package stored as a zipped static resource in Salesforce. I initialize my signature components on pageload via a component snippet and call my jSignature methods here. I was never using a 'format' parameter before, not sure what parameter the error message is referring to.

For some additional context, here are some screenshots of the error I'm seeing and what the debug console shows for those initial 2 errors:



Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Hi Eulogio, 

Since this error message is being thrown by jSignature, have you looked for any further information on what the error means? A bit of Googling leads me to believe that jSignature isn't getting the data in the right format (see here for example, and the best answer there provides a link to a lot more detail). If the data is in the wrong format, (if the above link is relevant: base 64 vs base 30, for example), then the next question is, where is jSignature getting its data from, and what has changed? 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
I'm feeding jSignature data from SF records which store my signatures. jSignature hasn't been updated in about 5 years and the data I'm using in my model hasn't changed in a few years either, so I don't think it's any updates that I've done that is causing problems.

The errors popping up here are also popping up in other Skuid pages I had built at least a year ago:



Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Eulogio,

I understand that there haven't been changes to jSignature or the model data. When we run into inter-operability issues like this between different packages & plugins, it can be tricky to find exactly where the pieces are failing to integrate. 

I'm thinking that perhaps jSignature was looking for a Salesforce field that's no longer loading before pageload. If your jSignature component is loading on pageload, but the data that's providing the signature itself is being loaded client-side, then the component may be looking for the signature before its model has loaded. Can you check any relevant models to see if they're being loaded client-side?

If so, one test you can try if you're comfortable with a bit of console scripting is to run a command to re-render your custom component once the page has been completely loaded. To do this, find out your custom component's unique Id, then enter the command skuid.$C('your-component-id-here').render() into your browser console to force it to renderIf the issue is that the model data isn't ready in time for the component, then trying this should let the component render successfully.

Edit: If you find that the model data is loading too late, then try setting the model so it does NOT load client side. 
(Edited)
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
Thanks for the explanation Mark, the context was really helpful. I'm not loading any models client-side, and was unable to get the component to render using the command you provided.

Do you have any other advice on debugging this problem? I appreciate all the help you've provided thus far, but I also understand how difficult something like this is to fix from afar and certainly don't want you spending too much time on this if I can do any of this myself.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 12,352 Points 10k badge 2x thumb
Are you seeing the error message in pages that don't use jSignature? 

In a situation where I can't figure out exactly which component, model, or snippet is causing the error: (involves editing the page's XML)
  • Clone the page
  • Open the XML editor for the page
  • Comment out all snippets, save changes, and load a preview of the page. 
  • If the error is gone, then remove your comment tags from the snippet XML, and instead comment out one snippet at a time. 
  • Reload the page preview after each snippet has been commented out. 
  • Does the error still happen? If it doesn't, then the snippet you just commented out is causing the error, and you'll need to debug that snippet. In this case, where do you see [something].records in the snippet? Whatever that [something] is, it's not being defined at the time the snippet is running.
The issue could be unrelated to snippets. If that's the case, I'd take a similar approach, but instead, I'd comment out one model at a time, and reload the page to see if removing that model causes the error to go away. If that also fails, I would then try the same process on the page's components. The goal is to find the piece of the page that's causing the issue, then look for anything unusual about it. 

We call this the 'brute force' method, and it's slow-going, but it's very helpful when you're not sure where to start. 

One other important thing to mention is a difference between pre 10.0 versions of skuid. In versions prior to 10.0, "null" was returned more liberally for several APIs—even being returned for properties that were not set. By standard conventions, undefined should have been returned for these unset properties. This behavior has been corrected.
If your code explicitly checks for the null value on undefined properties, you’ll need to update it accordingly.

This is explained more clearly in this document, and the suggested approach is included as well:
https://docs.skuid.com/v10.0.0/en/release-notes.html#undefined-vs-null

I have a feeling some code on your page is checking whether something is null. In newer versions of Skuid, that check should also look for whether the thing is undefined. I've had good luck using the 'falsy' check explained in the link above.
(Edited)
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,906 Points 1k badge 2x thumb
Ok quick update to this: while 11.1.1 Skuid package fixed the state issue I was seeing, I'm now getting an error on my Contact detail page I created a few years ago.

1. There was a problem rendering a component of type skuidpage: Cannot read property 'records' of undefined

I went through any javascript i had and made sure I wasn't causing this issue. The only indication of where this error occurs in my Javascript debug console is this:

A@skuid__SkuidJS:5

Sounds like this is something happening with Skuid packages, do you know what could be causing this?


Thanks!
Eulogio
Photo of Ashwat

Ashwat

  • 768 Points 500 badge 2x thumb
ON the skuid releases page, there is no install link for 11.1.1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
There was a SFDC bug that caused significant problems with 11.1.1.   We removed the package until SFDC fixes the problem on their end.  More information about the issue can be found here:  https://community.skuid.com/skuid/topics/challenge-with-11-1-1-version

We are targeting releasing an updated package today...