Go to row

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 4
Joined: Sat Jun 11, 2011 4:15 pm
PostPosted: Sun Jul 24, 2011 5:23 pm
I have been able to integrate the calendar into my solution and it works great so far. It reads from my Events table. However let's say there are three customers with the same event, then three rows will appear in the month view on the calendar. That's ok. However when I click on, say, the 2nd row, the Event Detail layout will pop out, but it is on the first record in the set. No matter which row I click in the month view day, it always goes to the first Events record. If I scroll wheel, then I can go to the other records in the set.

I've tried setting a variable with the recordnumber in the beginning of the "Click in Event" script and then going to that record number at the end, but it appears the variable is always setting to 1, or the first row, even if I click the 2nd or 3rd row for example.

Can someone explain why this might be happening? Thank you!
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Mon Jul 25, 2011 9:07 am
Hey Kenneth,

Sorry I'm not quite following you here. Can you attach some screen shots to give me some more info...I'll have another cup of coffee as well :wink:

Thanks!
Posts: 4
Joined: Sat Jun 11, 2011 4:15 pm
PostPosted: Mon Jul 25, 2011 9:54 pm
JasonYoung wrote:Hey Kenneth,

Sorry I'm not quite following you here. Can you attach some screen shots to give me some more info...I'll have another cup of coffee as well :wink:

Thanks!


Thanks for the reply. I'm sorry I wasn't able to explain it right. Here are some screens to show you what I mean. Please see the attachment "Calendar.jpeg." Notice on the month view that on the 31st there are multiple items called "test." these were put on the calendar as a result of a script that inserts event items for each customer if they fit certain search criteria. So each line is for a different customer. However each line I click on shows the same row on the Event Detail layout that pops out for the item. See EventDetails.jpeg. Once the layout pops out, I can scroll through the related records and they're all there but no matter what row I click on in the 31st, it always goes to Christine Sanchez, the first row of the related set.

To make it go to the same row when it pops out the event details layout, I tried to change the Click in Event script to set a variable at the beginning with the recordnumber, then go to that same one when the layout pops out, but its like a click doesn't actually activate the row selected, since it appears to set the first record every time.

I would like it to go to the row number that I clicked in the month view of the calendar. My ignorance comes from the fact that I honestly don't understand how the calendar setup works basically, but I love how I was able to just snap it in.

Sorry again, I hope that explains it better. Thank you for showing patience with me.
Attachments
calendar.JPG
calendar.JPG (130.92 KiB) Viewed 6492 times
EventDetails.JPG
EventDetails.JPG (121.87 KiB) Viewed 6492 times
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Tue Jul 26, 2011 7:24 am
Hi Kenneth,

Thanks for the details. Unless there's an overlap (which you can't have in month view) or the events have the same id, then it should only bring up one event.

In the script Click in / Drag Event we use the variable $sc_Row (defined by CalendarRows::RowNumber )
and $sc_Column ( defined by Get ( ActiveRepetitionNumber ) ) to determine which "slot" you clicked in.

ClickIn.png
ClickIn.png (122.67 KiB) Viewed 6491 times


We then use the row and column to figure out the primary key/UID of the event:

ClickIn2.png
ClickIn2.png (68.05 KiB) Viewed 6491 times


Once we have the id, we then use it to find and scroll to the event if there are overlaps:

ClickIn3.png
ClickIn3.png (56.6 KiB) Viewed 6491 times


It seems like it might be something with the ids (not unique maybe?)

Let me know if any of that helps,
-Jason
Posts: 4
Joined: Sat Jun 11, 2011 4:15 pm
PostPosted: Tue Jul 26, 2011 9:23 pm
JasonYoung wrote:It seems like it might be something with the ids (not unique maybe?)


Yep. That's indeed what it is. Each eventID is not unique. The Events table, which is the data source, is also sort of a "join tabe" as well. So the eventID will not be unique but each record is marked with the CustomerID it belongs to.

I would prefer not to change this structure but I will if I have to. I thought of setting it to the row from the $sc_Row variable but it goes to like row thirty-whatever. Another way I thought was maybe setting a variable in the Click In/Drag in script for the fk_CustomerID and then doing a find/constrain in the click in event script Still brainstorming on the least invasive way. If you have suggestions I'd love to hear them.

I do appreciate the help a lot!
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Wed Jul 27, 2011 7:27 am
Hi Kenneth,

I'm not a purist by any means, but we typically want to have a unique id (primary key) for every record, and there's a fair amount of our code that assumes these are going to be unique, so I'm afraid you will run into other problems.

You're not going to be able to capture the fk_CustomerID Click In/Drag in script, because there's no direct relationship back to the events from the calendar views (except "sort of" in day view). We're just reading the global variables that we've built, and we don't write the fk_CustomerID to them.

I think the tried and true unique id is the way to go here,
Jason
Posts: 4
Joined: Sat Jun 11, 2011 4:15 pm
PostPosted: Thu Jul 28, 2011 3:33 pm
JasonYoung wrote:Hi Kenneth,

I'm not a purist by any means, but we typically want to have a unique id (primary key) for every record, and there's a fair amount of our code that assumes these are going to be unique, so I'm afraid you will run into other problems.

You're not going to be able to capture the fk_CustomerID Click In/Drag in script, because there's no direct relationship back to the events from the calendar views (except "sort of" in day view). We're just reading the global variables that we've built, and we don't write the fk_CustomerID to them.

I think the tried and true unique id is the way to go here,
Jason


Boo!

jk, I will work towards that. Thansk for the help.
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Thu Jul 28, 2011 3:40 pm
8)

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: