boyblunder Posted October 15, 2007 Posted October 15, 2007 I have a ContactsID in my Contacts Table and a ContactsID in my Orders Tables. What I want to be able to do is click on a button on my Contacts layout and go that ContactID in my Orders layout. Thank you, Carl
Fitch Posted October 15, 2007 Posted October 15, 2007 Presumably the two tables are related, so use Go to Related Record.
boyblunder Posted October 15, 2007 Author Posted October 15, 2007 Hi Fitch, I'm on my Contact layout and I set up the "Go To Related Record so it reads. Get related record from: Contacts Show record using layout: The layout I want in the Invoice table is not shown. None of the Invoice layouts are. I have a feeling that's not good! Carl
LaRetta Posted October 15, 2007 Posted October 15, 2007 I'm on my Contact layout and I set up the "Go To Related Record so it reads. Get related record from: Contacts [color:blue]< --- change that to Invoices "get my related record from my Invoices table occurrence"
boyblunder Posted October 16, 2007 Author Posted October 16, 2007 Hi LaRetta, Ok I changed it so if I’m in my contacts layout and call the script the script is, Get related record from: Invoices Show Record using layout: Invoice Entry Show only related records: is checked Match current record only: is checked Nothing happens. Is there some other part of the script that is needed? Carl
LaRetta Posted October 16, 2007 Posted October 16, 2007 Have you made sure, in your graph, that they are joined on ContactID? And have you made sure you have a record in your Invoice table which has a ContactID field with this current contact's ID in it? If you still can't figure it out, it might be easier to just zip and attach your file. The problem will be something simple; not to worry, we'll figure it out. :wink2:
comment Posted October 16, 2007 Posted October 16, 2007 I hope this is not too obvious, but does a related record exist?
boyblunder Posted October 16, 2007 Author Posted October 16, 2007 Hi The relationships graph shows the Contacts table and Invoices Table are related “=” by both ContactID and CustomerID”. The layouts are Contacts Entry::Contacts and Invoice Entry::Invoices. The ContactId in the Contacts file also exists as a ContactsID match in the Invoice file. A copy/paste works perfectly if that means anything. This system is built on a separation model but I’m told that makes no difference. I did go to the relationship graph in the Data file to make sure it matched up relationally with Interface file graph and it does. Carl
LaRetta Posted October 16, 2007 Posted October 16, 2007 (edited) Does a related record exist? That's why I asked, "And have you made sure you have a record in your Invoice table which has a ContactID field with this current contact's ID in it?" I probably didn't ask it very clearly. The relationships graph shows the Contacts table and Invoices Table are related “=” by both ContactID and CustomerID”. Why related on both? If ONE of those keys is blank, it will not relate. If you want invoices that match ONLY the Contact, then you need to use a different relationship; one based upon only ContactID between the two. You would create a new Invoices table occurrence, possibly calling it Invoices for Contact. Relate on ContactID using =. The script would be something like: If [ not IsEmpty ( Invoices for Contact::ContactID ) ] Go To Related Records [ Invoices For Contact ; using layout [color:green]'based upon ANY invoices layout' ] Else Show Custom Dialog [ OK ; "No invoices for this Contact" ] End If ... but again, I question what you are doing and why. In a proper relational structure, there should be no need for both ContactID and CustomerID to reside within the Invoice ... at least I don't THINK it should be needed. Update: Corrected portion in green. LaRetta Edited October 16, 2007 by Guest
LaRetta Posted October 16, 2007 Posted October 16, 2007 I did go to the relationship graph in the Data file to make sure it matched up relationally with Interface file graph and it does. Ummm. I wonder why you would need to go to your data file at all. Your join should NOT take place in the data file; but rather in the interface file. You should have your layouts for your Invoices within your Interface file. You would place a table occurrence of your Invoices file in your Interface file (do so by adding an external data source, ie, adding your data file as a file reference), dropping a table occurrence of your Invoices within your graph and then join Invoices to Contacts within Interfaces. Again, since you are so unclear on how to pull this together, you could be missing any number of little things which can make this break. Attaching your file will save everyone a lot of guesswork. :wink2:
boyblunder Posted October 16, 2007 Author Posted October 16, 2007 That was it! Once I took the CompanyID out of the relationship it worked perfectly. I'm getting to understand things a little better and you guys have been a great help. Thanks to all of you for your help. Carl
Recommended Posts
This topic is 6249 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now