Hi Bison,
sorry to keep asking questions, but I just want to be clear as to your objectives.
From your table and data, I assume that a salesperson can be created by an admin (eg salesperson with UserID 2), or a dealer (eg salesperson with UserID 4).
You want to link salespersons with the dealer who inserted the record, (what about if salesperson was created by an admin ?)
I am trying to work out why you have 2 separate fields recording FH_id and SA_id.
Am I correct in saying that the only time a value is stored in SA_id, is when the user is a salesperson, and that the only time a value is stored in FH_id is when the user is a dealer or a salesperson, (where the userid of the dealer inserting the record is stored)
What is the purpose of the UserGroupID, does this identify admins/dealers/salespersons ?
If I am logged in, my userid should be stored as a session value.
So If I am a dealer, when I create a salesperson, my userid can also be stored in the record, so you can identify which salespersons I added/
changing the trigger conditions.
When you add an insert record behaviour, the trigger is typicaly something like..
<?php if (isset($_POST["Insert"]) || isset($_POST["Insert_x"])) {
[[insert code block]]
} ?>
what you can do is change the parameters of the ‘if’ statement so that the insert code is only triggered if (for example) the value of a posted text field equals a desired value. If the criteria is not met, the trigger will not fire.