Custom Fields

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
starquest321
User
Posts: 140

Custom Fields

Post by starquest321 »

Someone suggested that there is a way to allow custom fields based on view that is not in the database. This will allow users to add some additional fields. Is that possible? Anyone know how?


mobhar
User
Posts: 11905

Post by mobhar »

At the moment, you can use "ListOptions_Load" and "ListOptions_Rendered" serve events to add the additional fields/columns. Read "Server Events and Client Scripts" in the help file for further information and example of code.


starquest321
User
Posts: 140

Post by starquest321 »

I am speaking about something a little different. Lets say an agent wants to create some custom fields on the fly. For example:
Table: Customer

Fields: Name, Email, Phone, Custom1, Custom2, Custom3

Now I want agent to be able to define those custom fields with for example: Wifename, Wifeemail, Wifephone

Then when he adds data he will get instead of custom...wife....

The agent can define he own custom values for fields.


mobhar
User
Posts: 11905

Post by mobhar »

This actually can be achieved by designing your tables which can be related between one to another by using "one-to-many" relationship.

For example, you can link your "Customer" table to the "CustomFields" table (for example) that contains the custom fields that belong to the certain user. You can then create a database View to get the information from both the tables, so that the view will contain the fields you mentioned earlier.

For input new record Add page, then you can use "Master/Detail Add" feature. The same way also for Edit page, use "Master/Detail Edit" feature.


Post Reply