Notes Portal not advancing to correct row

Happy Monday.......

Can someone take a look at this file and clue me in on why the Add a Note [+} script isn't functioning correctly? I can't get the Notes portal to select the correct row to add a new note. It just doesn't do anything and then takes you to the first tab or sometimes it doesn't do anything. It does generate a new note, but it doesn't take you to a portal row to enter the note text.

It must be something small. I've been over it a thousand times and a fresh pair of eyes may help catch the mistake I'm making. Thank you so much!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will LovingPresident, Dedication Technologies, Inc.Commented:
Several points. You have a script that is almost right called "Add a New Note [+]". The first issue is that the variable is referencing the wrong field. You want to capture the Contact ID on the Contact record, not the one on the Notes field, so $ID_Contact = Opportunity Details::__pkOpportunityIDMATCH  not Notes::kf_ID_Contact  (and I do recommend that you change both of those fields to have exactly the same name, e.g. ID_Contact, Contact_ID, ContactID or zk_ContactID)

Second, the layout is not specified, it should be any layout based on Notes. The"Freeze Window" step before it shortens the time it takes to navigate to the Notes layout, create the new record, set the ContactID and then return, by preventing the display of the Notes layout.

Third, portal records will always sort to the creation order - meaning oldest first - unless you specify otherwise. You should probably set the portal to sort by creation Timestamp or serial number "Descending" if you want the most recent on top.

Fourth, turn off Allow creation of records in this table...." for BOTH sides of the relationship but leave the delete on the right side. The whole idea of using a button is to prevent/avoid having the user scroll to the end of the portal and being able to click in last row to create a new record. You want more control than that which is why there is the button and script. It prevents users from scrolling or creating blank records with no actually note text.

Finally, I click on the Notes field in the Portal, gave it a name "Note" and then used a "Go to Object" script step rather than "Go to Field". You can name any object on a layout and use "Go to Object" to move to it. Very useful when you want to navigate to an object on another tab but on the same layout.

 Relationship Diagram
Revised Script stepsNotes-Example.fmp12

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_Astrid_Author Commented:
Perfect! Thanks again for helping me understand what I was doing wrong. It works perfectly now and makes sense. I appreciate it as always!
_Astrid_Author Commented:
Invaluable assistance as always!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.