This topic contains 10 replies, has 2 voices, and was last updated by Barbara Cooney 8 years, 4 months ago.
-
AuthorPosts
-
August 22, 2016 at 9:36 am #73158
Barbara CooneyI have a transaction “Service Visit” and I would like to have a Create Event button which would take the user to the Calendar and add a new event (populating the foreign id_service_visit).
Once the Service Visit has a related event, the button will toggle to View Event. That’ll simply take the user to the existing event in the Calendar.
Not sure how to do this and presume I’m tapping into the soSIMPLE Calendar Actions script, but don’t see how.
tia, Barbara
-
August 22, 2016 at 11:37 am #73160
I’m not sure if you’re using WebDirect or FileMaker Pro/Go.
If you’re using FileMaker Pro client, everything is script-based:
- Create a script that populates the id_service_visit (as either a global field, global variable, or by basing the layout on the Service Visit record) then lands you in the calendar view
- When you drag or double-click an area on the calendar, the soSIMPLE Action Script will run
- The first thing you can do in that script is set a variable to the id_service_visit. If you set it right at the top, you’re still in context of your current record.
- In the content of the script, you will see a section that says “else if ($type=”New”)” – in that section you can set your foreign key field to the variable you set at the top of the script
To toggle the New/Update button, you’d have to check the existence of a related event attached to the Service Visit. If there is one, just use your own script to go to and edit the event. If there isn’t, then go to the calendar layout as above.
Does that answer your question?
-
August 22, 2016 at 2:08 pm #73161
Barbara CooneyNot sure that I follow the Edit workflow. How would my own script pass the event_id to the Action script and leave the user in an open Edit Event window?
-
August 22, 2016 at 5:29 pm #73162
I may need to know more about your workflow to answer more specifically. But in general, this is the way it works:
The client side script (“soSIMPLE Action Script”) runs every time you do anything in the calendar – drag, double-click, etc.. When that script runs, you’re in the context of whatever layout you’re on when you double-clicked, and whatever record. You’ve also got whatever variables you’ve already set within FileMaker. So not only does that script know everything about the double-click action you just took in the calendar, it also is a regular FileMaker script that knows about your current context in FileMaker.
Like anything FileMaker-based, you’ve got a lot of flexibility in how you use that script.
My suggestion was to set a global variable or global field before you get to the calendar layout, representing the primary key of the service record. Then when the Action script runs, you can set a foreign key field to the number you stored in a global.
You would insert that after
else if ($type=”New”)
– that’s the section of the script creates a new record.More information about the Action Script:
http://www.paradisepartners.com/products/calendar-documentation/calendar-builder-reference/data-sources/filemaker-fields/scripts/action-script/Attachments:
You must be logged in to view attached files. -
August 22, 2016 at 6:04 pm #73169
BarbaraI have the “Create in Calendar” part working.
SeedCode has a feature where you can “view Event in Calendar.” It takes you to the date in the Calendar and shows the Edit Event window. I was trying to see if I could get that to work with SoSimple.
I can easily edit an event, but I cannot see how to navigate the calendar to the date of the event. For example, the service date is 3 months ago, I need to navigate to the Calendar and show that date.
-
August 22, 2016 at 11:35 pm #73172
I see what you’re trying to do!
Add the following to the end of the URL, and you will jump right to that date:
#date=2016-12-24You can even choose a specific view.
Here’s more details:
http://www.sosimplesoftwar.com/products/calendar-documentation/calendar-builder-reference/adjusting-your-calendar/url-anchors-for-date-and-view-links/If your clients choose to use the MBS plugin that we include, you can also send you a script step that will select the event in the calendar (highlights it in a specific color).
If you’re not using the plugin, we can also customize the calendar to select an event by adding an id to the url.
Let me know if you need either of these things, or anything else.
-
August 23, 2016 at 8:57 am #73180
Barbara CooneyI have seen this post. However, I don’t know how I modify the url? What url? Where? Which script? Is it sent to a script via a parameter? eli5, please. And yes, we’ll be using the MBS plugin. Can’t see why not.
-
August 23, 2016 at 7:11 pm #73183
Hi again.
I just wanted to be sure we’re on the same page.
From previous posts, my understanding is that you’re performing a custom integration as we do on our 5-minute integration page. Is this correct?
http://www.sosimplesoftware.com/products/calendar-documentation/how-to-guides/five-minute-integration-server-powered/The resulting layout object, at the end of the tutorial, is a web viewer with a URL (double-click the web viewer to see the url). You can alter that URL by changing the calculation of the web viewer to reference fields or variables, or using the script step “set web viewer”.
https://www.filemaker.com/help/15/fmp/en/index.html#page/FMP_Help%2Fset-web-viewer.htmlIf you’re using the soSIMPLE Calendar file (and not the custom integration) we use the “set web viewer” step in many of our scripts.
Please let me know which method you are using so I can further assist you.
-
August 25, 2016 at 10:06 am #73188
BarbaraHi Ken,
Ah, the fog is clearing. I’m doing a custom integration. I’m trying to get as much functionality built so that I can demo the Calendar to my client. This is the last technique I think I’ll need.
Since I have not yet purchased a license, I do not have access to your scripting in the demo file.
-
August 25, 2016 at 10:13 am #73190
OK. For custom integration, you don’t need developer access to the soSIMPLE Calendar file.
Were you able to modify the url with either of the methods I mention?
- Modify the calculation of the web viewer object
- Include the “set web viewer” script step in your workflow
Thanks.
Ken
-
August 25, 2016 at 11:52 am #73191
Barbara CooneyYes. I can now jump from my transaction to the correct date on the calendar and pop the edit event window.
However, the event does not show on the calendar and the date doesn’t highlight. I can add new events and they show, as do events this month. (perhaps there’s a limit to the events from the past that are loaded?)
-
AuthorPosts
You must be logged in to reply to this topic.