Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

script button inside portal with selfrelation

Featured Replies

FM give so many suprises. confused.gif The button just won't work!

I've scouted the forum for solutions but couldn't find any (that I understood). There must be a solution somewhere, cause I think my problem is common. Please point it out to me or help me with a reply!

I've go about 15 Text fields. And 20 buttons with different Insert Text strings.

The script simply inserts a sentance into the field where the cursor is blinking.

All fine.

The problem comes that I have put these buttons into a selfrelated Portal.

I just don't know how I can get the buttons to work again.

I've tried Set field, Perform External script, Go to field, etc. But it won't put the text into the active field again. As soon as I click inside the portal, the active fields get deactivated.

I'm not able to use Go To Field with a [specified field] because then I would have to make about 15 different Go To Field scripts, kinda crazy I think.

Perhaps the answer is really easy, but you just got to know it. Please advise me! laugh.gif

Thanks in advance.

The Set Field step needs to specify the field through the portal relationship:

Set Field [selfjoin::field1, ...]

Same with the Go to Field steps.

  • Author

Thank you Vaughan,

Just a quick check to see if I've done it right, because I can't get the Insert Text and Go to field function to work. Which is a bit of a problem for me. I want each of the 20 buttons to add text in a field, not subsitute the contents of a field.

I created a Relationship

ID = ???:ID with the name Selfjoin

ID is a Unique Number Field

The portal that contains all the buttons has a different Relationship.

Using Selfjoin Relationship on the Specified Field Field1. Duplicated this 14 times with Field2, Field3 etc. specified, to place the text into the field where the cursor currently is. This only works with the Set field.

Like you said:

Set Field ["Selfjoin::field1", ""any text""]

Set Field ["Selfjoin::field2", ""any text""]

Set Field ["Selfjoin::field3", ""any text""]

etc.

This wil put "any text" in all the 15 fields.

Actually I just want to ADD text in the active field.

I think I'm almost there....

Well since you have placed buttons inside an portal there is no way to preserve active field when clicking on them.

I don't see many other choice other than creating sufficent number of buttons outside of portal( or having some numeric indicator for selecting proper related record) each adding text into active field from different related record,

Dj

  • Author

Didn't expect this problem to be such a nutcracker.

By now I've traced the problem down to be able to know which of the 15 fields was LAST active when the button in the portal is clicked on.

Perhaps somebody has this figured this out which makes it possible to use Insert Text script from a portal.

Well,

I just created a sample that has a self join portal.

If you use set field but don't specify the field, just the calculation

Set Field, "", "This is my text for this field"

It remembers the field that is currently active.

HTH

Good catch Andy. This can the kind of solution I was looking for one of my files.

Thanks

Sorry for the glitch.

Didn't realize that the fields are actually inside the portal containing the buttons.

Dj

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.