I am assuming this relationship here:
Customer::CustomerID = Deliveries::CustomerID
1) There are several ways that you can detect whether or not any related records exist:
IF [ IsEmpty ( Deliveries::CustomerID ) //any field in Deliveries that is never empty will work ]
# put script to go to deliveries layout and create a new record here. Copy the current customer ID into a variable before changing layouts so your script can put this value into the appropriate field in the new deliveries record to link it to your current customer record.
PUt Go to Related Records here
Go to Related Records
If [Get ( Lasterror ) // GTRR Failed ]
# Put same script described for no related records in OPtion A here.
2) Yes you can. You can use a calculation field with: Count (Deliveries::CustomerID) as the merge field. If you have FileMaker 11 or newer, you can also put a variable as merge text on top of your button and use a conditional format expression to assign the record count to the variable.
You can also use a conditional format to change the color of the button to show whether or not any related records exist and a tool tip can be defined that uses the count calculation to put up a different tool tip message depending on whether or not any related delivery records exist.
Thanks Phil, looks like thats the solution. Also looks like I cant decipher it.....lol..... But I will try, and try, and try.
As always, thanks for your help. I shouldve just hired you from the get go. Or just send a check.
BTW, I'm not sure of the rules, so I'll ask generically.. Is someone who posts, allowed to contact a member, who may or may not have their own business, to hire them for a project?
For such contacts, you can click their forum name or avatar graphic an send them a private message.