Skip to main content
Nintex Community Menu Bar
Question

Uncaught Type Error: Cannot read property 'execute' of undefined

  • July 11, 2024
  • 5 replies
  • 49 views

Forum|alt.badge.img

This discussion was created from comments split from: Uncaught+TypeError:+Cannot+read+property+‘execute’+of+undefined.

5 replies

Forum|alt.badge.img+1

I’m facing the same exception, I have written javascript code on a button to call the apex class method.

Please find the script below,

var appMdel = skuid.model.getModel(‘Application’);
var appId = appMdel.data[0].Id;

var result = sforce.apex.execute(‘Button_Utility’,‘updateCollateralLeanAmount’,
{
appId : appId
});
window.location.reload();

The same script I have moved to another button is working as excepted. Please help me with this, why skuid is misbehaving like this.


annajosephine
Nintex Employee
Forum|alt.badge.img+18
  • Nintex Employee
  • July 12, 2024

Hi @SandyPanda

  • , thanks for bringing this issue to our attention.

    What version of Skuid are you using? Are you building in api v1 or v2?

Are there any differences between your two buttons? (e.g. a part of different components, in a popup, etc.)

Forum|alt.badge.img+1

Hi @“Anna Wiersema”
On every page, I do use the API version of V1 only and ngUI module. And my button is on the popup page. Please reply asap. I’m still having the same problem on many pages.


Forum|alt.badge.img+1

So basically, What i notice is sforce.apex.execute is working in custom skuid pages. But not in predefined or existing pages like i mentioned earlier ngUI module. Can you please do needful for me. Anyone, please reply.


annajosephine
Nintex Employee
Forum|alt.badge.img+18
  • Nintex Employee
  • July 12, 2024

Hey @SandyPanda, this sounds like this might be a namespace thing.

If the ngUI pages come from a managed package, and your custom Apex is coming from outside of the managed package, then you will have to specify the namespace when you’re targeting the Apex method.