arguments passed to snippet when you click on calendar

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
I have a calendar with 2 different kinds of events. So use the include page control in the popup forms for the 2 event sources. This works great.... but it implies that the popup form as the event id to pass as a parameter to the included form... which doesn't work when its a new event.

I thought I could use the "run snippet then open popup" option... but I can't figure out how to get the date and time that have been clicked on when the user clicks on the calendar. I dumped the arguments that get passed in the click and I can see quite a bit of data there, but not the date and time that were clicked on.  Am I missing them... or is there no way to get them ?

Once I can figure out how to get them I figure I can create the new event record and then open the popup and pass it the id so it will be able to populate the included form.

Thanks


Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,004 Points 20k badge 2x thumb
The arguments passed to the Snippet run before a custom popup is shown are:

  • calendar
  • eventSource
  • event
  • model
  • row
You should be able to examine row or event to get details about the event record that is being shown, which will at this point in execution already have values for its Start Date and End Date field s, whatever the particular API Names are for the Start Date and End Date fields are on the object you're using for your Event Source.

So for instance if your model is on a custom object with fields Start__c and End__c, then you should be able to look at row.Start__c to see the Start Date that the user selected and row.End__c to see the End Date that the user selected.



(Edited)
Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb
Ah
The problem was I had not set the fields for start and end.... so they did not show in the javascript object.
They do now.
Thanks Zach