Error while calling PluginHelper.retrieveSettings

Hello,

I am calling a new method:
PluginHelper.retrieveSettings(retrieveSettingsError, retrieveSettingsSuccessful, options)
I think it is introduced in 8 or above. I am getting an error:

Uncaught TypeError: retrieveSettingsError is not a function

Can someone please tell me how to use this method.

It looks like it is expecting a function pointer for the first two parameters.

function success() {
console.log(“success”);
}
function failed() {
console.log(“failed”);
}

PluginHelper.retrieveSettings(success, failed, options);

Thanks @kcwong , can you please let me know what option is and how to use it? because when I went to pluginHelper.xhtml, IIQ is referring to a Map pluginName and pluginId from options, and post that just refferring to pluginId and prior to installation we won’t be having pluginId.

So, basically please help me with, if we can use this method to read settings from manifest file rather than calling an API to get the settings.

I am still on 7.3 so I don’t know. I’m just telling you what your error message means.

According to this thread no known documentation exists for PluginHelper in 7.0:
https://community.sailpoint.com/t5/IdentityIQ-Forum/PluginHelper-methods-documentation/td-p/12357

If 8.x has better documentation, you should refer to that. Or try reading the JavaScript source code as suggested by the thread.

@kcwong.
Unfortunately, this new method isn’t discussed on this thread, but anyways thanks for the help.

@ashishbhatia what version are you currently running?

Hello @jordan.violet , we are using 8.1.

Seems like this method is for internal use for IIQ and works on plugin settings forms

Looks like an old thread, but I thought I’d post my findings in hope that it helps someone in the future. First of all, there’s a lot of confusion out there as to which methods the PluginHelper has and how they operate. If you look at the (home) page source in any browser, you will see PluginHelper javascript inset there with all the methods and their implementations, so there shouldn’t be any guessing around what the methods do or how they do it.

Secondly, it is correct that the retrieveSettings method is more or less reserved for internal use, because in its original form it only works on the plugins page because it grabs plugin name and id from the URL. However, the “options” argument discussed in this thread allows you to override the name and id of the plugin. This is not entirely helpful, however, because the plugin id is (normally) going to be different in each environment, so you can’t really hard code it in your JavaScript snippet. There are ways around that, but none of them are straightforward and reusable. But if you override the name and id and pass that to the method, it does work.

Your easiest OOTB way of retrieving the settings would be to create a REST service as part of your plugin that will return your plugin settings in whatever shape or form that is most suitable for your needs.

2 Likes