简体   繁体   中英

How to call an external Javascript function in a dynamic action?

I have a dynamic action set to trigger when a user presses a button. However I am well above the limit for the JavaScript I can put into the text box. I have uploaded my function as a .js file to the static file shared components part of the application.

However, I am at a loss as to how to now call that function when the dynamic action triggers. Also my JavaScript relies on form entries on the page it's being called from as it uses that data as variables.

How can I set the page to be able to call the function from the external .js file? Preferably in as step-by-step fashion as possible as I am still very new to Apex.

You did well to add it to the static files, but you have to tell your app that you have an external js file.

There are two options to do this:

  1. In the page properties if you are only going to use the function on that page. Editing the javascript File URLs option

在此处输入图片说明

  1. In shared Components, in the details of User Interface Attributes.If you are going to use the function throughout the application.

在此处输入图片说明

After that, simply use your function on the trigger

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM