Expand my Community achievements bar.

AEM FORMS AEMaaCS - Error handling with core form and components

Avatar

Level 10

Hi,

 

I am connecting to a CRM and invoking a function , using invoke service but unable to add an error handling function per the document or as we could with workflows 

 

Has anyone tried this ? I see usage of old form template vs new one , plus guidelib is not something that can be used. 

 

 

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/forms/adaptive-f...

 

 

 

thanks,

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

5 Replies

Avatar

Employee

Hi,

 

Can you please describe exactly where you are facing issues? Is the function visible but you're unable to drag and drop it, or are you unable to search for the function in the Rule Editor?



Vijay_Kumar_Jalagari_0-1719320442446.png

 

Hi @Vijay_Kumar_Jalagari  i ended up getting the custom function after a while perhaps caching of some sort . This is on core components template vs what you have which is adaptive. Invoke service in core is not working as expected and will be shipped out soon on AEMaaCS . Wrt errors, how do you display it on the field per the documentation online to say invalid id etc from handler , since I have no code editor and working on AEMaacs unsure how I could achieve field level validation 

 

did u install the pet sample on local ?

Avatar

Level 10

While this is not doable due to a bug with invoke service worked on local set up for old forms.

1. My understanding is that the error would need to come in from source in a json format, even if the source is CRM. ? @Vijay_Kumar_Jalagari 

2. if custom handler is used how do I invalidate the field. The field although marked as invalid is still something that can be submitted. 

 

 

If the response JSON follows the format below, the field will be marked invalid, and the error message will be displayed as described. For non-standard error responses, you should create a custom error handler function, restructure the response to match the example format, and invoke defaultErrorHandler.

 

 

 {
    errorCausedBy : "SERVER_SIDE_VALIDATION/SERVICE_INVOCATION_FAILURE"
    errors : [
        {
             somExpression  : <somexpr>
             errorMessage / errorMessages : <validationMsg> / [<validationMsg>, <validationMsg>]
        }
    ]
    originCode : <target error Code>
    originMessage : <unstructured error message returned by service>
    }

 

 

The problem @Vijay_Kumar_Jalagari  is that marking as invalid just gets cleared off when another field on the form is validated or when next is clicked in wizard .. does not block it or validate as it would if the field were required but empty