help with My Contacts training course

help with My Contacts training course

  
I can not figure out what I did to MyContacts. In my contacts page it only shows one contact.
Thanks

John
Hi John

It's either the recordlist that only has one record, or it's the table records limit that was set to 1.

Eitherway, you can check that by doing a debug session and placing breakpoints on the Query that feeds the table records, and the table record itself.

Check if the query ha multiple records, and if the Linecount property of the table records is always different than 1.

If in doubt, just upload your espace file in this forum topic so we can take a quick look.

Cheers

Miguel Simões João
thanks Here is my File.

John
Hi John

If you do a Test Query on the GetContacts query in the preparation of the Contact_List screen, how many records do you get?

Have you tried debugging the espace with a breakpoint at that query? How many records will the recordlist have?

I couldn't find nothing abnormal on your espace.

Cheers

Miguel Simões João
Ups

I've spoke too soon .... I think I found the problem.

When you're creating a new contact, you're using the Contact_Edit screen, and you're always pulling the the first record of the contacts Entity, and then you're editing that record. IN truth, you're never creating a new contact.

The reason is because the GetContact query in the Contact_Edit screen preparation action, has an always true condition: you've set the input parameter ContactId = ContactId, which is always true, returning all available rows in that query. Then you use the first row as a source for creating a new contact, but are in fact updating an existing contact.

The query condition should be like CONTACT.Id = ContactId instead. This way, you'll get the contact for editing if it already exists, and if it's a new contact (ContactId is null), then you'll not get any row from the database, creating a new one when you press the save button.

Change the query and check if the problem persists.

Cheers

Miguel Simões João
Thanks a lot. I spent hours trying to find it. I am going to fix it and continue on with the training.. 

Thanks again 

John