Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

script button inside portal with selfrelation


This topic is 7937 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

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

Same with the Go to Field steps.

Posted

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....

Posted

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

Posted

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.

Posted

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

Posted

Sorry for the glitch.

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

Dj

This topic is 7937 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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