1

On Sitecore 9.2.0, I have created a custom field, based on the relevant tutorial (https://doc.sitecore.com/developers/92/sitecore-experience-manager/en/walkthrough--creating-a-custom-rating-element-with-property-editor.html).

When I try to add this field into a form via the Forms UI, I see in the network tab that the relevant API call fails with a status code of 400 (bad request). All OOTB fields work fine. Sitecore logs report absolutely nothing, event viewer reports absolutely nothing.

I am obviously missing something. Any insights on where to look?

  • Can you turn on the Sitecore logs to DEBUG and see if it reports any error? – Ahmad Zia Dec 13 '19 at 0:53
  • @AhmadZia Tried that. No data related to the action. It seems that for some reason this request doesn't register on IIS. Tried a OOTB field addition. The url structure is exactly the same (obviously, different fieldTypeId and TemplateId), so I am guessing there's something wrong in the processing itself. – Yiangos Dec 13 '19 at 13:50
  • for the 400 request , open chrome dev tools and check the response in Preview tab – Abhay Dhar Dec 16 '19 at 6:19
  • Which browser do you use? Try Firefox or other one if you are using Chrome – Peter Procházka Dec 16 '19 at 9:23
  • 1
    To all that provided insight, I found the root cause by decompiling the relevant DLL, I've answered my own question below. – Yiangos Dec 18 '19 at 20:10
1

It turns out that for the Form editor to work, all field type templates must have a standard values. By decompiling the DLL that contains the action for the API controller for the SPEAK interface of the form editor, I found that internally it runs a pipeline, and the first processor has an Assert that throws if the template for the field type does not have a (empty) standard values. Adding standard values made the error go away.

A bit more informative error than just 400 Bad Request would have been more helpful, methinks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.