Uncaught TypeError: Cannot read property 'outputValues' of undefined

  • 3
  • Problem
  • Updated 3 years ago
I have a global action button 'credit pull' in a table. i am calling my apex class from,
global action button--> action type=run multiple actions-->Run Custom apex action--> my class name.

when i click on credit pull global action, i am getting an error like Uncaught TypeError: Cannot read property 'outputValues' of undefined

can any one help me, come out from this issue.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb

Posted 4 years ago

  • 3
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
I am also receiving this error when using a Skuid action to run a custom apex action that is referencing an InvocableMethod. Anyone have any updates on how to resolve this error?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,828 Points 20k badge 2x thumb
Can either of you post a screenshot of this error with the browser console exposed so we can see the javascript stack trace? 
Can you also post a screenshot of the action configuration (Specifically the "run custom Apex action" detail properties. 

Thanks. 
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Yes, Here is the configuration of the action in Skuid: 



And the corresponding error in the console: 


Let me know if you need any additional info!

Thanks
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Hi Rob, 

Just curious if you have any updates around this error? Any potential fix or workaround?

Thanks!
Photo of Chandra V

Chandra V, Champion

  • 7,650 Points 5k badge 2x thumb
bump
Photo of Chandra V

Chandra V, Champion

  • 7,650 Points 5k badge 2x thumb
Checking on this issue (that Ross is working on for us.)  This issue was a bug caught in our live community, and it would be great if we could get this looked at.  FYI - the console error is thrown as a system admin as well.

We have a custom apex action being called form a tab click, and the console shows the uncaught error that Ross posted the screen shot of.  I can send the org ID over if someone can take a look....  Thanks!
Photo of Jack Sanford

Jack Sanford, Champion

  • 9,766 Points 5k badge 2x thumb
Was everyone's error in community? Or has anyone gotten this error in non-community environments? We've had a lot of issues running Apex that relies on the AJAX toolkit in communities.
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
We originally caught the bug inside the community, but the error is also occurring when previewing the page in standard Salesforce as a Sys Admin, so I don't think the problem is unique to the community. 
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,550 Points 10k badge 2x thumb
Hi Chandra and Ross,

This looks like an issue with how Skuid is handling custom apex actions. What parameters does your apex action take, and what is your apex action returning? If you could post just the first line of your apex function, that could help us debug.
(Edited)
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Yes here is the signature for our Apex action. It is a void method with no parameters so it does not take anything in nor return anything. 

@InvocableMethod

public static void obtainNotificationPreferences() {

Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,550 Points 10k badge 2x thumb
Ok, I'll have to dig a bit more, but I think this may be a bug with how skuid handles methods that do not return anything.

I bet if you changed it to public static String obtainNotificationPreferences() and then returned an empty string or something, you wouldn't get the error.
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Thanks Ben, I just updated the method to return a List<String> but it looks like we are still receiving the error...
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,550 Points 10k badge 2x thumb
Ok, I figured this one out. It looks like there's a bug with how Skuid works with actions that don't take any parameters. If you just change your action to take a List<String> parameter, and send in some dummy data, it should work. We'll try to get this patched in a patch release of Skuid.
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Thank you Ben, This has resolved the Uncaught Type error for output values. That being said, I am now receiving a Post request error 404 (bad request). This may be an issue with my apex action, so I am going to do some more debugging but wanted to let you know as well in case you have any info about this. 
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,550 Points 10k badge 2x thumb
You might want to try deleting that action step and re-building it in Skuid. There may be some inconsistencies with the input now that the signature of the apex action has changed.
Photo of Ross Freeman

Ross Freeman

  • 154 Points 100 badge 2x thumb
Ben, recreating the action step altogether did the trick, we are now able to successfully launch the apex action from the Skuid action when the page is accessed in standard Salesforce environment. When we run the action from a page within the Salesforce Community, we receive an error 503 (service unavailable). I see above Jack Sandford is having issues running this kind of Ajax request from Communities, do you have any information about this?

Thanks. 
Photo of Jack Sanford

Jack Sanford, Champion

  • 9,766 Points 5k badge 2x thumb
Ross - are you loading the AJAX toolkit as an external Javascript resource? I'm not sure this helps in community but is needed sometimes. Add a new javascript, with a Resource Location of External, and a URL of " /soap/ajax/37.0/apex.js "
Photo of Jack Sanford

Jack Sanford, Champion

  • 9,766 Points 5k badge 2x thumb
Also if you can post your console log for when you try and run this in community that could be helpful
Photo of Chandra V

Chandra V, Champion

  • 7,650 Points 5k badge 2x thumb
Jack - I added the javascript resource (as version 36, since it matched the error but also tried version 37) and it is still throwing the same error.




The error:



I did check and ensure the community profile has access to this Apex class, and it does.