Gary Weisbrodt Posted August 30, 2004 Posted August 30, 2004 I am creating a new recipe in a portal on the persons layout. Only the name of the recipe is created. From here I want to go to the layout where information is added. I have tried a script attached to button: Commit records/request Go to related record (show only related records) also tried it without show only The script takes me to the correct layout but always to the first record. Seems to me that I may need to do a find, but have failed to create a find that picks up the recipe name and finds itself in the layout. The portal is in the layout of the person creating the recipe and is related through the person key.
-Queue- Posted August 30, 2004 Posted August 30, 2004 Once you Commit (I assume you mean Exit Record/Request, since your profile shows version 6), you are no longer in a portal row. So going to the first related record means the first related record for the person. If commitment is an issue, try setting a global number with Status(CurrentPortalRow), then Exit Record/Request, Go to Field [any one in the portal], Go to Portal Row [based on global number field], then Go to Related Record [show only related, relationship].
Gary Weisbrodt Posted August 31, 2004 Author Posted August 31, 2004 Queue sorry. I have reset my profile accordingly to FM 7 and Jaguar. Is your advice still the same?
-Queue- Posted August 31, 2004 Posted August 31, 2004 Yes, but Exit will be Commit and Status will be Get.
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 I have never done this. So I tried and failed with this script. Set field [Get ( PortalRowNumber )] CommitRecords/Request Go to Portal Row [select; no dialogue; Recipe::Portal Row Number_g] Go to Related Record
-Queue- Posted September 1, 2004 Posted September 1, 2004 You don't have a field specified to set with Get(PortalRowNumber). If there is more than one portal on your layout, first Go to Field [relationship::field] for one that is in the portal, and then Go to Portal Row and GTRR [show; relationship].
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 Ok I have added Go to Field Go to Field [Recipe::Portal Row number_g] Set field [Get ( PortalRowNumber )] CommitRecords/Request Go to Portal Row [select; no dialogue; Recipe::Portal Row Number_g] Go to Related Record [show only related records... I end up in the layout but still at the first record.
-Queue- Posted September 1, 2004 Posted September 1, 2004 No, look at the order of the steps in my first post. You are assumably in a portal row when the button is clicked, correct? So you Set Field [Recipe::gPortalRowNumber; Get(PortalRowNumber)] Commit Records/Requests Go to Field [any related field in the portal] <- gets you back into the portal Go to Portal Row [select; no dialog; Recipe::gPortalRowNumber] <- gets you into the right row Go to Related Record [show; relationship]
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 The Portal row Number did not populate the field. I notice that you do not leave spaces between words in our field names?
-Queue- Posted September 1, 2004 Posted September 1, 2004 Where is the button located? Within each portal row? It is a good habit not to use spaces. Use underscores _ if necessary. When you put your data online, it will make things much easier.
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 The button is in each portal row.
-Queue- Posted September 1, 2004 Posted September 1, 2004 See attached working sample. An alternative might be to use a script parameter of Get(PortalRowNumber). Test.zip
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 Is it important to use a Global field to contain the Portal Row Number? My efforts still only take me to the first record.
-Queue- Posted September 1, 2004 Posted September 1, 2004 Not necessarily. It just utilizes less space. Here's a version using a script parameter instead. Make sure that the Go to Field step specifies a field that is actually in the portal, not just related. Test2.zip
Gary Weisbrodt Posted September 1, 2004 Author Posted September 1, 2004 I was experimenting with your original test and took the Serial field out of the portal and your test still worked. I'll have a look at your new file after supper. cheers
-Queue- Posted September 1, 2004 Posted September 1, 2004 Hmm, so it does. I would suspect that is not intentional functionality though, and wouldn't rely on it in case it's fixed later on. If you get to the end of your wits, feel free to stuff your file and attach it here. Maybe we'll see something that isn't obvious.
Gary Weisbrodt Posted September 2, 2004 Author Posted September 2, 2004 Good Morning I noticed another difference in our test and my application. Your relationships in the test are many to many where mine is a one to many relationship. attaching a snapshot of the table graph
Gary Weisbrodt Posted September 2, 2004 Author Posted September 2, 2004 Hi Tried out your suggestions in the secont test file using the script patameter and it worked. Thank you ever so much for your assistance. I'm looking forward to the day when I understand why it has worked.
-Queue- Posted September 2, 2004 Posted September 2, 2004 I don't know how to change the TO diagram to show only one-to-many. Can that even be done? Mine defaulted to many-to-many.
Gary Weisbrodt Posted September 2, 2004 Author Posted September 2, 2004 Strange, mine defaults to one to many. In fact conversations with db architects suggest to me that many to many are somewhat of a strange bread to deal with.
-Queue- Posted September 2, 2004 Posted September 2, 2004 Not necessarily strange, but not the most common. I have no idea what criteria FM uses to determine which type it should be. But that shouldn't have any bearing on how it behaves if there ends up being only one parent record for each child.
Ender Posted September 6, 2004 Posted September 6, 2004 Queue, Gary, I learnt this one recently. The TOG will show a one to many instead of a many to many if the key is defined as an auto-entered serial number, it is set to be unique, or it is a global.
-Queue- Posted September 6, 2004 Posted September 6, 2004 Thanks Ender. That makes sense, too. My examples usually use an auto-entered calculation of Get(RecordID) instead of an auto-entered serial.
Recommended Posts
This topic is 7383 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