Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

custom function for the rules editor

Avatar

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
joell91868939
Level 3

06-03-2017

I tried creating a custom function for the rules editor using the doc example, but the side panel didn’t contain the functions:
https://helpx.adobe.com/aem-forms/6-2/rule-editor.html

Do I need to initialize it? There is a  some form of hook that is missing here…

Replies

Avatar

Avatar
Validate 1
Level 2
PriyankP
Level 2

Like

1 like

Total Posts

28 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
PriyankP
Level 2

Like

1 like

Total Posts

28 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
PriyankP
Level 2

06-03-2017

You can create a client-lib for your adaptive form and create a custom js file. Once you assign the clientLib to Adaptive Form, all the functions that you define within it should appear in the Rule editor. Please see my screenshots. 

Avatar

Avatar
Validate 1
Level 2
PriyankP
Level 2

Like

1 like

Total Posts

28 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
PriyankP
Level 2

Like

1 like

Total Posts

28 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
PriyankP
Level 2

06-03-2017

You can create a client-lib for your adaptive form and create a custom js file. Once you assign the clientLib to Adaptive Form, all the functions that you define within it should appear in the Rule editor. Please see my screenshots. 

Avatar

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
joell91868939
Level 3

06-03-2017

A client library has been created respectively but the issue I am having is that the custom function is not appearing on the touch UI rules editor sidebar. 

I used the following jsdoc sample:

"=============================="

var area;
//Some codes later
/** */
area = function(len) {
    return len*len;
};

"=============================="

but it is not working.

Avatar

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 3
joell91868939
Level 3

Likes

6 likes

Total Posts

55 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
joell91868939
Level 3

06-03-2017

A client library has been created respectively but the issue I am having is that the custom function is not appearing on the touch UI rules editor sidebar. 

I used the following jsdoc sample:

"=============================="

var area;
//Some codes later
/** */
area = function(len) {
    return len*len;
};

"=============================="

but it is not working.

Avatar

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
Anish_Somani
Level 2

06-03-2017

Hi,

1. Could you move the package to apps/ folder for once and try.

2. Is the client lib added to guideContainer property in AF authoring.

Please try this once. This should work fine.

Avatar

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
Anish_Somani
Level 2

06-03-2017

Hi,

1. Could you move the package to apps/ folder for once and try.

2. Is the client lib added to guideContainer property in AF authoring.

Please try this once. This should work fine.

Avatar

Avatar
Boost 10
Level 3
Love_Sharma
Level 3

Likes

12 likes

Total Posts

47 posts

Correct Reply

4 solutions
Top badges earned
Boost 10
Ignite 5
Ignite 3
Ignite 1
Validate 1
View profile

Avatar
Boost 10
Level 3
Love_Sharma
Level 3

Likes

12 likes

Total Posts

47 posts

Correct Reply

4 solutions
Top badges earned
Boost 10
Ignite 5
Ignite 3
Ignite 1
Validate 1
View profile
Love_Sharma
Level 3

06-03-2019

Posting for future reference. I faced same issue but when I hard reload my form editor, function appears. Also, if I change something in custom JS, function will disappear from dropdown. I again hard reload and it will show.