Sam Posted December 9, 2004 Posted December 9, 2004 I'm trying to create a music schedule that will view all musicians scheduled to play from todays date and all dates in the future, in a portal. My tables are Music Schedule and Music Schedule line item. My relationship is (Music Schedule) "Todays Date" greater or equal to (Music Schedule line item) "Date". I want to be able to schedule musicians in the portal, but when I type in the future date in date field, it reverts back to todays date. Thanks for your help!
-Queue- Posted December 9, 2004 Posted December 9, 2004 Wouldn't you want your relationship to be Schedule::Date <= LineItem::Date? If you use >=, then the portal will show all dates up to Date, inclusively.
Sam Posted December 9, 2004 Author Posted December 9, 2004 You are right! I tried it and now my only problem is when I type in the date field a future date and tab out of it, it changes the date to todays date. If click out of the table and back into the date field, changing the date again, the new date is accepted. What is up with this? Sam
-Queue- Posted December 9, 2004 Posted December 9, 2004 Does the date field have any auto-enter options on it? Does this only happen when you create a new record or also when modifying an existing one? If you press Enter instead of Tab, what happens?
Sam Posted December 9, 2004 Author Posted December 9, 2004 The date field does not have any auto-enter ptions on it. It only happens when creating a new record. Once the record is created and it displays todays date, I can go back into the date field and change the date and it accepts it. It does the same thing when I hit the enter or tab key.
-Queue- Posted December 9, 2004 Posted December 9, 2004 Is the date field local to the current layout's TO or is it a related field? If there are no auto-enter options or scripts setting the field, it doesn't make sense why it would default to anything. What happens if you create a record and don't enter a date, then commit the record?
Sam Posted December 9, 2004 Author Posted December 9, 2004 The date field is in the related TO. I've attached the file "Service Planning.Fp7.zip" to this reply. Would you mind taking a look at it? Sam ServicePlannning.fp7.zip
Sam Posted December 10, 2004 Author Posted December 10, 2004 Here is the file again attached to this reply. Something went wrong with the other one. Sam ServicePlannning.fp7.zip
-Queue- Posted December 10, 2004 Posted December 10, 2004 It seems that since the relationship is based on Date, a new related record forces the date to be equal to the parent's date. Once the related record is committed, then the date can be changed as desired. Normally a relationship such as this would be for veiwing purposes only. Additions would be created via a unique serial relationship or at least one that used = not <= or >=, etc. A related record needs to be created and committed before you attempt to change the date. So you could attach the related Date field to a script to Go to Layout ["Music LineItem" (Music Schedule Line Item)] New Record/Request Set Field [Music Schedule Line Item::Date; Get(CurrentDate)] Commit Records/Requests [skip; No dialog] Go to Layout ["Music Schedule" (Music Schedule)] Go to Field [Music Schedule Line Item::Date] Go to Portal Row [Last] Go to Portal Row [Previous] Set Field [ ; ""] Note that Set Field has no target field specified, so the currently selected field will be nullified. You could also make the related Date auto-enter the Creation Date. Then you can remove the Set Field [Music Schedule Line Item::Date; Get(CurrentDate)] portion of the script.
-Queue- Posted December 10, 2004 Posted December 10, 2004 I should add that the related Date should be removed from the Tab Order.
Recommended Posts
This topic is 7551 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now