Uncaught TypeError: Cannot read property 'indexOf' of undefined(...)

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
Hi,

I have this page that does not work only for 1 specific profile.

Looking in console i see error: 
Uncaught TypeError: Cannot read property 'indexOf' of undefined(...)

When looking at details of error in console, here pretty print version:



Would anyone know why i'm getting this?

Thank you
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
  • confused

Posted 2 years ago

  • 1
Photo of Jannik Gysi

Jannik Gysi

  • 594 Points 500 badge 2x thumb
Hi Dave

Can you provide us some more information about your page?
  • What do you want to display?
  • It looks like this happens on a specific field, are you able to determine on which one?
  • What version of Skuid are you on?
  • Is the failing profile custom or standard?
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hello Jannik,

Thank you for your response:

  • What do you want to display?  a skuid page with Models based on lead and account objects and 1 custom object named funding
  • It looks like this happens on a specific field, are you able to determine on which one? I've tried but cannot determine which field
  • What version of Skuid are you on? 8.13
  • Is the failing profile custom or standard? Custom, but this profile has no issue seeing almost any other page
Thank you
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi again,

As you mentioned the issue is with a specific field, I decided to go the stupid/simple way of finding issue

So i deleted model, per model , and ofc it was the last 1 that was the culprit :D

Once that was narrowed down, I found the issue being in a specific lookup field named: Sales Partner

If I left in table layout, it would cause this error

If i remove for table layout it works

Now the real question is why?

Sometimes this field will have no data in it , and this seems to be the reason it bugs out, but I do not understand logic of it

If possible please explain

Thank you
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
Is that console error coming from a snippet that is running on this page?  Perhaps your profile doesn't have access to the Sales Partner field.  I would check field security of this field by going to salesforce setup > security controls > field accessibility and look at it from that profile's perspective.  If you have a snippet trying to deal with a field that the user can't see, it will throw an error.
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Thank you,

Actually it was first thing I checked, and they have access to it.

It's only when any row on table which sales partner's  field has a blank value in it, that it causes an issue
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
@skuid support, Any chance someone can look into this issue for me please?

Thx