Saturday, November 2, 2024

How To Create Your Java Script Function And Web Resource

 To used java script you have to create a web resource and functions. Follow below steps to create script web resource and function.

Creation of Java Script File:

1. Open VS Code and Visual Studio => Write the below code, Here I am using VS Code Editor.

2. Now save this file as java script => press ctrl+s to save this file on VS Code Editor and save it as below screenshot.

3. In the Download folder one java script file is created with name "D365MyFirstScript"


Creation of Java Script Web Resource:

1. Go to https://make.powerapps.com/  => Solutions => Open your Solution (Here my solution name is Mintech Customization).

2. Click on New => More => Web Resource.

3. In the New Web Resource upload the created Java Script file and fill the all remaining details, as below screenshot.

Now next step to call your Java Script function.


Calling Of Java Script Web Resource Function:

Here I am calling this Java Script function on Account entity form Load.

1. Open your Account entity main form => OnLoad => Event Handler

2. Now add your Web Resource by clicking on Add Library
3. Search of your newly created Web Resource file name and add it.

4. Select your Web Resource and function name as below.

5. Now go to your Account entity and open any record, Here I am open the "A. Datum Corporation" record, Your script will be read the Account name field value and display this value into alert dialog box as below.





No comments:

Post a Comment

What Is A Column In Dynamics 365 CRM?

 In This Post we are going to Explain