I'm trying to create an AEM Form which POSTs directly to a Salesforce endpoint (action "Submit to REST endpoint). But I get an exception from guideContainer.af.internalsubmit.jsp which says:
com.adobe.aemds.guide.utils.XMLUtils Invalid Xpath Syntax: 00N0Q000000tYMk
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: 00N0Q000000tYMk could not be formatted as a number.
'00N0Q000000tYMk' is the name of the input, which I want to post and which is necessary for salesforce.
How can I prevent this exception? Any suggestions?
Thanks for your help!
Sorry, but I don't really know what you mean with "form data model test editor". Can you explain?
My AEM version: Adobe Experience Manager 188.8.131.52 with AEM Forms 184.108.40.206 Add-on for OSX
The recommended approach is to create DataSource using swagge file. Then use this data source to create form data model
The following video should give you a good understanding. Although the video is created using AEM Forms Cloud Service, the steps are the same for AEM Forms on premise version
Thanks for you answer. But do I really need such an effort to connect to SF? I only have a tiny form for a newsletter subscription with less inputs. I don't need any authorization at SF. I only have to send the OID as a hidden field to SF.
If I create a simple HTML file with a form and post it to SF, it works. But if I manually create a form at AEM forms, I get the error from my message above. It seems that AEM Forms has problems with the SF-like input names like 00N0Q000000tYMk. But why?
so your SFDC instance does not need any authorization? What objects are you trying to create in SFDC?
what is the submot action of the form that you have created in AEM forms?
I have no knowledge about SF but I also implemented a similar Post to SF in the past for another customer (via the AEM Backend, not AEM Forms). He provided which data they needed (which parameter names, which fields are required, the oid etc) and the endpoint and I did there also a simple post and it worked.
And now I try it for another customer but via AEM Forms. I try to send simple values like first name, last name or email address. But some field names have no "speaking name" they have typical SF names like "00N0Q000000tYMk", which AEM Forms isn't able to handle.
The submit action I selected is "Submit to REST endpoint" with the checkbox "Enable POST request" ticked.
if you are creating lead object in salesforce on form submission, you are better off creating the integration using the form data model method that I sent you earlier. its not that hard, the lead object is already defined for you in the swagger file. All you need to do is the create connected app in salesforce and use its credentials in the AEM Forms cloud configuration.
As to your approach- it should also work AEM Forms simply forwards the request to the POST url specified in the submit options