Guest
14 Jan 2014 05:44

Let me start off by saying I assume that Cobalt Types are really database tables and Type Fields are actually fields/columns in a table.

I am building a system that requires a one-to-many relationship between tables. For the sake of example, I want to create a Type called "Customer" with fields like Customer Number (unique), First Name, Last Name, Address, etc. I create another Type called "Payments", which contain fields like Customer Number, Payment Type, Payment Amount, etc.

  1. How do I create a form that allows the user to choose a customer from a list of Customer records? I'd like to use a text field that suggests as the user types (AJAX) or at least a dropdown field (although with hundreds or thousands of customers, that could be too much).

  2. How can I create a page that filters ONLY Customer records a user enters and not records that other users have entered?

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
14 Jan 2014 10:28

Let me start off by saying I assume that Cobalt Types are really database tables and Type Fields are actually fields/columns in a table.

Physically not. It is represented this way for better intuitivity but it is not. It is has vertical type structure not horizontal.

  1. YOu need to use Relation fields. Use parent for customer and child for payments.

  2. In type parameters on Submission tab, set Who can see - special. This is default access value for new created articles. Author of the article is considered as special in Cobalt even though he is only Registered.

This setting will allow users to access only their own articles.

There is another parameter in section. Who can see restricted records in the list. This parameter may allow to see articles that user has no access to in the list. YOu can configure it so that even in the list it is not shown.

Powered by Cobalt