9 years ago
9
Topic

Hello Octopoos -

Can I use a value from another table/content type as a default value for a field? If so, how?

I have defined the following forms/content types (they have more fields, but I've simplified their descriptions to include only those that are relevant):

(User) “Sales Manager” with the following field:
- sales_manager_dealer_admin (JForm User)

(Free) “Dealer” with the following fields:
- dealer_admin (JForm User)
- dealer_inventory_tax_rate (Text)

(Free) “Deal” with the following field:
- deal_inventory_tax_rate (Text)

When the current user "Sales Manager" creates a "Deal", the initial default value of ‘deal_inventory_tax_rate’ should be equal to ‘dealer_inventory_tax_rate’ from "Dealer" where dealer_admin = sales_manager_dealer_admin.

I know I can assign a fixed default value to ‘deal_inventory_tax_rate’ in the Deal content type, but how can I use a dynamic value that is obtained from another content type / table? Note that I only want to use it as a default (starting) value, and allow the Sales Manager to edit the initial value, if desired, before saving the Deal. Also, there will be only one matching value in the Dealer table.


Thank you!

Get a Book for SEBLOD

9 replies have been added to this thread, and the topic is marked as solved.
You should subscribe to a club in order to read all posts.