August 30, 200421 yr 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.
August 30, 200421 yr 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].
August 31, 200421 yr Author Queue sorry. I have reset my profile accordingly to FM 7 and Jaguar. Is your advice still the same?
September 1, 200421 yr Author 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
September 1, 200421 yr 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].
September 1, 200421 yr Author 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.
September 1, 200421 yr 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]
September 1, 200421 yr Author The Portal row Number did not populate the field. I notice that you do not leave spaces between words in our field names?
September 1, 200421 yr 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.
September 1, 200421 yr See attached working sample. An alternative might be to use a script parameter of Get(PortalRowNumber). Test.zip
September 1, 200421 yr Author Is it important to use a Global field to contain the Portal Row Number? My efforts still only take me to the first record.
September 1, 200421 yr 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
September 1, 200421 yr Author 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
September 1, 200421 yr 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.
September 2, 200421 yr Author 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
September 2, 200421 yr Author 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.
September 2, 200421 yr 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.
September 2, 200421 yr Author 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.
September 2, 200421 yr 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.
September 6, 200421 yr 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.
September 6, 200421 yr Thanks Ender. That makes sense, too. My examples usually use an auto-entered calculation of Get(RecordID) instead of an auto-entered serial.
Create an account or sign in to comment