Multiple Choice Part 2

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
gatenet
Veteran Member
Posts: 45
Joined: 2016-07-26 09:34
Location: Greece
Contact:

Multiple Choice Part 2

Post by gatenet » 2018-05-05 08:35

Hello Appginies, I am working on a project tha impliments sales of services, I want to connect 3 tables like this
Table 1: Services Category(fields: id, service category)
Table 2: Services Plans(fileds: id, service category, plan name, duration, price)
Table 3: Offers. In this table i want the user to be able to choose from the other 2 tables, so what is the best practice to do, shall i make several fields like service 1, service 2 etc with fields from the second table like plan name 1, plan name 2 etc and price 1, price 2 etc?
Do you have another suggestion? I am a little bit stuck here.
Thank you in advanced

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Multiple Choice Part 2

Post by pbottcher » 2018-05-07 06:26

Hi gatenet,
can you make an example of how you would expect the user to choose his offer? Are the service categories in "Service Category" and "Service Plans" related or independent?

regards
Pascal
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

gatenet
Veteran Member
Posts: 45
Joined: 2016-07-26 09:34
Location: Greece
Contact:

Re: Multiple Choice Part 2

Post by gatenet » 2018-05-07 06:43

Hi there pbottcher, thank you for your reply,
the 2 tables are related and so the user when choose a service category then the service plan shows only the plans related to service category

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Multiple Choice Part 2

Post by pbottcher » 2018-05-07 08:00

Hi gatenet,

so you could add the tables in appgini as follows:

Table Service Category ->
ID (primary key)
service category (your definition)

Table Service Plan ->
ID (primary key)
service category (as lookup field to the service category field of the service category table)
plan name (your definition)
duration (your defintion)
price (your definition)

Table Offers ->
ID (primary key)
service category (as lookup field to the service category field of the service category table)
plan name (as lookup field to the plan name of the service plan table with the filter set to the service category field)
duration (as lookup field to the duration of the service plan table with the autofill set)
price (as lookup to the price of the service plan table with the autofill set)

hope that covers what you expect.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

gatenet
Veteran Member
Posts: 45
Joined: 2016-07-26 09:34
Location: Greece
Contact:

Re: Multiple Choice Part 2

Post by gatenet » 2018-05-07 08:34

Thank you again for your reply
i already did that but the problem is if its a good practice to have multiple fields connected with the same tables. in my situation if the user wants to pick more than one service and service plan should i have service 1,2,3,4 etc? or there is another way?
Thank you again

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Multiple Choice Part 2

Post by pbottcher » 2018-05-07 08:53

Hi,

my opinion is that you should try to have the information required stored in one place (or as few as possible) and reference this information from all other required place. So you keep your data maintenance reduced and do not have to change the same value in multiple places.
Regarding the selection of multiple service/service plans, it depends how flexible you want to have this.
The most flexible would be if the user creates one record per service/service plan required.
If you use multiple fields in one record, this limits you to what the user will be able to request.

regards
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply