Jump to content

Insert values from portal


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

Recommended Posts

Here’s what I have: a text field on a layout and a portal of related values (names of people) along side the text field.

Here’s what needs to happen: when I click a name in the portal a value from that related record is inserted into the text field wherever the cursor was located prior to clicking the name.

Here’s what’s happening: using the Insert Calculated Result script, regardless of which name I select in the portal or where the cursor is located in the text field, the first name in the portal is always placed at the end of the text.

With Filemaker I knows there’s a way. I’m just hoping it’s not to complicated. Thanks for your help. It is really appreciated.

Link to comment
Share on other sites

If the button was outside of the portal, then it could be done with a script such as:

If [Get (ActiveFieldName) = "targetfield"]

Set Variable ($start; Get (ActiveSelectionStart)

Insert Calculated Result [select; targetfield; $start; 0; field_data_insert ]

Set Selection [ targetfield; Start Position: $start + Length ( field_data_insert ); End Position: $start + Length ( field_data_insert ) - 1 )

End If

But, the issue that arises is that once the user clicks in the portal, the active field is no longer active. This can be done in FM8.5 because of the new 'Object' naming feature but I dont think it can be done with FM8.

Link to comment
Share on other sites

I think you’re correct. I tinkered with the Get(ActiveSelectionStart) using the Set Variable and no value was returned whenever I clicked on the portal. Oh well, I thought there might be a work around with FM8. I don’t see us upgrading to 8.5 for a while. For now I can append records with the set field but I was hoping for more flexibility with the insert calculated results.

Thanks for your input.

Link to comment
Share on other sites

This topic is 5711 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.