aem-core-forms-components icon indicating copy to clipboard operation
aem-core-forms-components copied to clipboard

Custom Functions Error in adaptive Forms

Open shravanthprasad opened this issue 1 year ago • 7 comments

Expected Behaviour

Rule editor to set value of component using function output

Actual Behaviour

Error function not found image

Reproduce Scenario (including but not limited to)

1.Create a client library with a custom function 2.Add clientlibrary to form container 3.Go to form field and click on rule editor 4.Create a rule and set value of field from function output 5.Close 6.Switch to preview mode

Steps to Reproduce

Platform and Version

AEM 6.5.17 Core components version 2.23.4 Form Core Components version 1.1.32

AEM Version (mention the exact version in case of cloud SDK)

AEM 6.5.17

AEM Forms Version

1.1.32

Sample Code that illustrates the problem

/**

  • test function 1
  • @name testFunction1 test function 1
  • @return {string} */ function testFunction1() { return "test"; }

Logs taken while reproducing problem

shravanthprasad avatar Feb 02 '24 08:02 shravanthprasad

@shravanthprasad, we have a test collateral for this use case. You can review the test specification at https://github.com/adobe/aem-core-forms-components/blob/master/ui.tests/test-module/specs/customFunctionTest.spec.js and the corresponding form collateral at https://github.com/adobe/aem-core-forms-components/blob/master/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/af2-custom-function/basic/.content.xml, along with the client library available at https://github.com/adobe/aem-core-forms-components/tree/master/it/apps/src/main/content/jcr_root/apps/forms-core-components-it/clientlibs/clientlib-it-custom-function

rismehta avatar Feb 06 '24 06:02 rismehta

@shravanthprasad, can you attempt the use case on version 6.5.19? According to version metrics, (https://github.com/adobe/aem-core-forms-components/blob/release/650/VERSIONS.md) support for 1.1.32 is only available after 6.5.18.

rismehta avatar Feb 06 '24 06:02 rismehta

@shravanthprasad, can you attempt the use case on version 6.5.19? According to version metrics, (https://github.com/adobe/aem-core-forms-components/blob/release/650/VERSIONS.md) support for 1.1.32 is only available after 6.5.18.

Hi @rismehta - Thanks for your response. We are on AEM 6.5.17 currently and upgrade to 6.5.19 is planned in second half of 2024. Downgraded to version 1.1.26 and I still see the same issue. Upon further analysis, I see the servlet(AdaptiveFormCustomFunctionProviderServlet) is not present in bundle(com.adobe.aem.com.adobe.aem.forms.af.rest) which handles the custom function request http://localhost:4502/adobe/forms/af/customfunctions/L2NvbnRlbnQvZm9ybXMvYWYvbm93LWFlbS1mb3Jtcy9yaXNlLXVw The bundle version is 0.0.90 in AEM 6.5.17

shravanthprasad avatar Feb 06 '24 07:02 shravanthprasad

@rismehta - We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

shravanthprasad avatar Feb 06 '24 07:02 shravanthprasad

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

rismehta avatar Feb 19 '24 05:02 rismehta

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

Thanks @rismehta - We have raised a support ticket.

shravanthprasad avatar Feb 20 '24 09:02 shravanthprasad

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

Thanks @rismehta - We have raised a support ticket.

We've created a new release, built upon version 6.5.17, for the custom function. You can find it at https://github.com/adobe/aem-core-forms-components/releases/tag/core-forms-components-reactor-1.1.27-wcmB008. This release incorporates a workaround involving the hardcoding of the function name.

rismehta avatar Mar 11 '24 12:03 rismehta