Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Document Types and customer-facing forms? View modes: 
User avatar
Member
Member
matthew.newby-crl - 5/6/2013 10:27:28 AM
   
Document Types and customer-facing forms?
I'm a developer starting to use Kentico for the first time, so yes, I AM new here! :-) I need to create a number of customer-facing forms which, while targeted at different segments of our customer base, will share a lot of common fields. I've been experimenting with creating document types to minimize the number of fields I need to create, but I'm having trouble finding out how to use those document types when creating customer-facing forms. I'm sure I'm missing something basic, but I'm also having trouble finding documentation/articles that talk about doing this. There's plenty on document types and a fair amount on bizforms, but I haven't found what I'm looking for yet. I'd appreciate any guidance you could give me to point me at existing documentation.

Example:

Customer Contact document type contains contact name, email, phone, alternate contact name, email, phone, and company address (street address 1/2, city, state/province, zip/postal code).

Shipping document type inherits Customer Contact fields, adds a checkbox to indicate a different shipping address, then a category containing shipping address fields similar to the company address fields. Side issue: I tried setting the visibility of the category based on the value of the checkbox (if it's not checked, don't show the fields), but that doesn't seem to behave like I wanted on the form -- I wanted to click the checkbox and have the fields in this address block appear. Instead, it looks like I have to check the box in CMS Desk, save the document, then when I open it again, at that point the address fields show up. It's not dynamic when the form is being filled out initially...

Billing document type inherits Shipping fields (which also gets the Customer Contact fields), adds a checkbox to indicate a different billing address, and a category containing all the billing address fields.

These three document types are then the general document types that can be used as the basis for the various forms I need to create. So, a request for information might be a new document type that inherits the Shipping document type so that we've got fields for the customer contact, as well as potentially a different shipping address to send literature to. On the other hand, a product order document type would be based on the Billing document type, since we may need to send product to one location, while sending the billing invoice to another location.

When I create the form for the end document types, I can see those forms via the CMS Desk, but I haven't been able to figure out how to add them as customer-facing forms that the public can see. If I go to add a Form using the CMS Desk interface, the document type forms are not available to be picked. On the other hand, if I attempt to add a new form there, I see a similar screen for adding fields, but I can't see where to pick the document type fields that I've already created.

What am I missing?

-matt

User avatar
Member
Member
matthew.newby-crl - 5/10/2013 10:14:45 AM
   
RE:Document Types and customer-facing forms?
With thanks to one of Kentico's trainers for clarifying the situation, I'd like to turn my question into an official feature request!

Here's what he had to say:

From what I can tell, the 3 docTypes that you created look great (especially how you configured inheritance and dependent fields). But docTypes are for Content Admins to complete (using the Form tab in CMS Desk) while Online Forms are for site visitors to complete. It looks to me like you want site visitors to complete the fields, so create them using the Forms module instead of as new docTypes.

DocTypes and Online Forms (the Forms module/button on Tools tab) are separate entities as far as Kentico is concerned (they have separate db tables in SQL). By default, there is no mechanism in the system to inherit the fields from a docType into an Online Form. That being said, you can copy/map those db columns from the docType to the Online Form using SQL Server Mgmt Studio.

Hopefully this makes sense, and explains why the form/docType doesn’t show up as an option in the Web part properties dialog (only forms created using the Forms module will appear in the list of available forms to display on the page, but not docTypes).

So you kind of have to first decide which user type (Content Admin or site visitor) is expected to complete the fields.


So, the feature request would be to give site visitor forms the same kind of inheritance capabilities as Document Types.

A second feature request would be to allow admins to develop form “snippets”, that is, HTML layouts for the fields in the document/form type that can also be inherited by derived types, stored somewhat like a macro. So, our Customer Contact form type would not only include the fields for customer name, phone, email, company name and company address, but also the HTML layout to present those fields to the site visitor (but without the HTML form tag wrapper). Then the Shipping document/form type could add the shipping address fields, and the HTML layout for gathering that data could simply put the pseudo-macro at the top of the layout, then show the shipping fields below that, etc. This kind of inheritance of both data elements and presentation would allow for consistency across all the final derived forms, as well as ensuring that changes made to the base classes propagate to all the final forms without having to revisit each one and make the same edits over and over.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/11/2013 1:21:50 AM
   
RE:Document Types and customer-facing forms?
Hello,

1. You can use the Forms module as mentioned. However, have you considered using the user contributions? It is like a wiki - where you can allow the web site editors to add the documents - basically providing them with the form for filling out the document type fields. However, this will create a document in the content tree. From your description is not clear how you want to manage the data after the submission. For more about user contributions please see here.

2. This is not clear to me - what you want to exactly achieve? For both, document types and forms mentioned above you can use either custom layout for the final form or use alternative forms. (alternative forms, custom layout).

Best regards,
Juraj Ondrus