I would make no changes to your script. What you have should be sufficient. The remaining info can then either appear automatically via fields from the related customer table placed on your layout or via looked up data fields in Invoices defined to copy data from the customers table when Bill To Customer ID get's a new value.
Is this the Invoices.fp7 starter solution? Let me inow if that's the case and I'll open up that file and provide a more detailed answer based on what exists in that file.
It is the starter solution, yes. So far it doesn't show the Customer info. That is something I do in layout?
The script should result in all of the "bill to" customer fields automatically displaying data from the customer table. The "ship to" fields will not update unless we add one more step to your script to update the "Ship to customer ID" field with the same value.
What are you seeing on your layout when you run this script?
Do you see a value appear in the Bill To Customer ID field?
Have you modified the design of this starter solution in other ways besides adding this button and script?
Nothing appears. I have been messing around with this for days and I really doubt it is in all its correct settings at this point. I wish I had thought to make two and not mess around with one! I can't even make a new one because Filemaker 10 doesn't have these solutions and Filemaker 11 isn't available on the website anymore... Would you happen to know what the original settings are for Bill to Customer ID field?
Your set up details (those that I can see at least) seem correct and match the original file. A look at Manage | value lists for this value list may reveal other differences, however.
If you do not see any value appearing in the Bill to Customer ID field, then it is likely that a value is not being entered into it (maybe there is no value in the variable).
Take a close look at the client record that is current where you have put this button. If you haven't already done so, add the customer ID field directly to your customer layout and make sure that there is an ID number in that field to start with.