Prefill service using FDM to fill the table | Community
Skip to main content
ShaileshBassi
New Participant
June 28, 2022
Solved

Prefill service using FDM to fill the table

  • June 28, 2022
  • 3 replies
  • 1738 views

Trying to implement the use case mentioned in the document i.e. https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/introduction.html?lang=en

But I am not able to get the table prepopulated with the data.

I have followed the similar steps mentioned in the document. Below are the screenshots

 

 

When doing the "Test Model Object", it is showing me the result as present in the MySQL server

 

can anyone please help with any pointers, what could be missing over here to get the prefill of the form and its beneficiary table.

Thanks

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MorisMonk

Then your form is not using the custom template (FDMDemo).
See https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/get-request-parameter.html?lang=en

 

I am assuming you did not use the sample form, link on https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/create-adaptive-form.html?lang=en

If you did, then check following:

- Form properties, Form Model is set to that which you created.

- Adaptive form container, Prefill Service is set to "Form Data Model Prefill service".

- All form fields are bound properly.

3 replies

New Participant
June 29, 2022

As already mentioned check error.log for errors.

It's a little tricky tutorial to follow.

Are you seeing the following line in your stdout.log

Adobe !!!There is a empID parameter in the request 207



ShaileshBassi
New Participant
June 29, 2022

@morismonk No, I am not getting this in the stdout.log file.

Thanks

MorisMonkAccepted solution
New Participant
June 29, 2022

Then your form is not using the custom template (FDMDemo).
See https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/get-request-parameter.html?lang=en

 

I am assuming you did not use the sample form, link on https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/create-adaptive-form.html?lang=en

If you did, then check following:

- Form properties, Form Model is set to that which you created.

- Adaptive form container, Prefill Service is set to "Form Data Model Prefill service".

- All form fields are bound properly.

Lavanya_Pejjayi
Employee
June 29, 2022

Hello  shaileshbassi,

 

I suggest you check the logs if any error is coming up or

 

you can also check at form properties whether it is pointing to the right FDM  model schema or not? 

 

Thanks,

 

ShaileshBassi
New Participant
June 29, 2022

There is only a warning message in the logs i.e.

28.06.2022 23:37:24.351 *WARN* [[0:0:0:0:0:0:0:1] [1656439643644] GET /content/dam/formsanddocuments/training/af-with-fdm-employee-association-beneficiary/jcr:content HTTP/1.1] org.apache.sling.models.impl.ModelAdapterFactory Could not adapt to model
org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.adobe.fd.ccm.channels.web.impl.model.v1.WebChannelImpl
	at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:754) [org.apache.sling.models.impl:1.4.16]
	at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:428) [org.apache.sling.models.impl:1.4.16]
	at org.apache.sling.models.impl.ModelAdapterFactory.getAdapter(ModelAdapterFactory.java:270) [org.apache.sling.models.impl:1.4.16]
	at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:143) [org.apache.sling.adapter:2.1.10]
	at org.apache.sling.api.adapter.SlingAdaptable.adaptTo(SlingAdaptable.java:104) [org.apache.sling.api:2.22.0]
	at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource.adaptTo(JcrNodeResource.java:156) [org.apache.sling.jcr.resource:3.0.18]
	
	
Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject protected org.apache.sling.api.SlingHttpServletRequest com.adobe.fd.ccm.channels.web.impl.model.v1.WebChannelImpl.slingRequest
		at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:738) [org.apache.sling.models.impl:1.4.16]
		... 378 common frames omitted
	Caused by: org.apache.sling.models.factory.ModelClassException: Could not adapt from class org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource to interface org.apache.sling.api.SlingHttpServletRequest
		at org.apache.sling.models.impl.ModelAdapterFactory.adapt(ModelAdapterFactory.java:1064) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory.adaptIfNecessary(ModelAdapterFactory.java:1034) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory.setField(ModelAdapterFactory.java:977) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory.access$200(ModelAdapterFactory.java:115) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory$SetFieldCallback.inject(ModelAdapterFactory.java:475) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory.injectElement(ModelAdapterFactory.java:575) [org.apache.sling.models.impl:1.4.16]
		at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:733) [org.apache.sling.models.impl:1.4.16]
		... 378 common frames omitted

Thanks

sunil_kumar_
New Participant
June 28, 2022

@shaileshbassi Can you check logs and error coming in