Your reference to a "weeks" table suggests that it's my calendar example that you are working with. Is it?
It uses a Weeks table where there is one record for each week of the year in a list view with 7 portals that show events for Sunday - Saturday of the same week.
These are filtered portals that filter by day of the week from the date field in the events table. Since the dates field is not visible in the portal itself (which would be redundant on a calendar) you don't have the fields that you'd need to create an event record let alone link it to a specific customer.
I suggest adding a button or buttons that either open a small modal window or (better) a popover where you can enter the needed data--including a drop down list or pop up menu of customers with customer ID's and names, into global fields and then a "save" button in the window or popover creates the new events record and transfers the data from the global fields into the new event record.
Good spot, it's a cool calendar and great to work with, thanks for sharing.
I've got to the point of a popover - it's able to use this to expand an entry on the calendar and view the details behind the 'header' (portal row field), which in this case is the customer name. On the same row, you click a button and the popover explodes out. You're able to edit the work, change the dates etc so it moves around the calendar.
I've tried using the button method previously as you've suggested but the sequence of events was to click this button, see the popover, go to enter details and then fail. It would fail with the same message that the field could not be modified.
If I understand correctly, I'd normally see that message when I try to type directly to a calculated field.
I'm not certain whether FM has created the record or not at this point, or has failed part way through on its attempt to write a new record to the Work table. It's odd that I can use exactly the same popover on the customer record to add projects, but not via the calendar. I just wonder if the Events::cDate to Weeks join is the issue here (seeing as the cDate wouldn't be a value until I enter something)? That's a guess based on pure supposition and the position of the moon...
Thanks in advance
This isn't what I am suggesting for adding a NEW event to the calendar.
This popover would be outside the portal and you'd put global fields on it for each field needed for one of your events. A "save" button placed inside the popover would run a script like this:
Go to Layout ["events" (Events)]
Set Field [Events::EventDate ; globals::gEventDate ]
Set Field [Events::CustomerID ; globals::gCustomerID]
add as many set field steps as you have global fields in the popover
Go to layout [original layout]
You could set up one popover in the header for the entire calendar or individual popovers for each day of the week portal. If you use this second approach, an OnObjectEnter trigger set on the Popover panel could enter the date for that day of the week into the global date field for you.
That'll do it. Thanks wise one ;)