Expand my Community achievements bar.

SOLVED

How to check the API functions definition?

Avatar

Level 3

Hi there, 

 

We need to change some js script based on our business need. However, when I review the code, there are functions can be called directly and I can't find the definition of these functions, for example, setMaxProgress(). So I wonder where I can find the diefinition of thoes functions?

 

Thanks in advance!

XL

1 Accepted Solution

Avatar

Correct answer by
Employee

Hello, 

 

setMaxProgress() is a core method we expose to JS server engine and we use to manage progress bar (I.e. when your install a package for example)

 

It takes a integer as input and return nothing

It seems we use it in following OOTB campaign libs : 

  • /usr/local/neolane/nl6/datakit/xtk/eng/js/package.js:700: setMaxProgress(this.entities.length);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1945: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1987: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:6888: setMaxProgress(1)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7168: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7609:setMaxProgress(objects[sSchemaName].length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:8355: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:250: setMaxProgress(10000)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:343:setMaxProgress(surveyToProcess.webApp.length() * 2 + 1)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/datakit/crm/eng/js/mscrmConnector.js:785:setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/datakit/crm/eng/js/structureAndCleansing.js:1201: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:633: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:706: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1080: setMaxProgress(nbEntity);
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1099: setMaxProgress(nbEntity + venumList.length);
  • /usr/local/neolane/nl6/deprecated/server/crm/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/deprecated/server/crm/mscrmConnector.js:1342: setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/deprecated/server/crm/structureAndCleansing.js:1200: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:634: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:707: setMaxProgress(xmlExtAccnt.enum.length())

CAUTION : Such methods are not publicly exposed and we can deprecate or remove them at any moment. This is the main reason why we do not document them. All publicly supported methods and function are documented in the public JS API here

 

Hope it will help

View solution in original post

8 Replies

Avatar

Community Advisor

Hi XL,

 

You can find all ACC functions in the API documentation.

If not, it's probably a local function used in one of the OOTB JS libraries



David Kangni

Avatar

Level 3

Thanks David,

 

Actually, I didn't find the definition of function

setMaxProgress()

from the document you sent. And from the url here, I can see the function. And I can't find it from our javascript libraries either.

 

Thanks again for your help

Avatar

Community Advisor

it's a jssp function 



David Kangni

Avatar

Level 3

Hi David,

 

Thanks for your reply. But I still can't find it in js of jssp libraries. Just curious where this function defined.

 

Thanks for your help

Avatar

Level 4

Hi @xliu ,

The setMaxProgress() seems to be a custom function. Are you using any libraries in your code? If there are any loadLibrary() at the beginning of the code, you may check inside those js code whether there is a definition for the function you are looking for. 
If you are using this in an HTML, then check the scripts that are loaded in the HTML and see if you could find the definition.

Avatar

Level 3

Hi Kris,

 

Thanks for your reply!

 

Actually there is no loadLibrary(), the function just can be called and works like this blog said. And I didn't find the defination of the function in ACC js and jssp libraries or files.

 

Thanks

Avatar

Correct answer by
Employee

Hello, 

 

setMaxProgress() is a core method we expose to JS server engine and we use to manage progress bar (I.e. when your install a package for example)

 

It takes a integer as input and return nothing

It seems we use it in following OOTB campaign libs : 

  • /usr/local/neolane/nl6/datakit/xtk/eng/js/package.js:700: setMaxProgress(this.entities.length);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1945: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/messageCenter.js:1987: setMaxProgress(res.delivery.length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:6888: setMaxProgress(1)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7168: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:7609:setMaxProgress(objects[sSchemaName].length() + 1);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/interaction.js:8355: setMaxProgress(100);
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:250: setMaxProgress(10000)
  • /usr/local/neolane/nl6/datakit/nms/eng/js/wkfSurvey.js:343:setMaxProgress(surveyToProcess.webApp.length() * 2 + 1)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/datakit/crm/eng/js/mscrmConnector.js:785:setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/datakit/crm/eng/js/structureAndCleansing.js:1201: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:633: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/datakit/crm/eng/js/common.js:706: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1080: setMaxProgress(nbEntity);
  • /usr/local/neolane/nl6/deprecated/server/crm/oodConnector.js:1099: setMaxProgress(nbEntity + venumList.length);
  • /usr/local/neolane/nl6/deprecated/server/crm/sfdcConnector.js:1290: setMaxProgress(nbEntity+1);
  • /usr/local/neolane/nl6/deprecated/server/crm/mscrmConnector.js:1342: setMaxProgress(ndElement.remoteTable.length());
  • /usr/local/neolane/nl6/deprecated/server/crm/structureAndCleansing.js:1200: setMaxProgress(this.NB_WKF_ACTIVITIES)
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:634: setMaxProgress(xmlExtAccnt.enum.length())
  • /usr/local/neolane/nl6/deprecated/server/crm/common.js:707: setMaxProgress(xmlExtAccnt.enum.length())

CAUTION : Such methods are not publicly exposed and we can deprecate or remove them at any moment. This is the main reason why we do not document them. All publicly supported methods and function are documented in the public JS API here

 

Hope it will help

Avatar

Level 3

Hi Chris,

 

That makes sense now.

 

Thank you very much for your help! Very appreciated.

 

Xihao