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

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

Recommended Posts

Posted

Needing help generating a script that will do the following:

 

I have a bunch of merge fields (which contain text, that the user defines in another layout) on a layout. 

 

I want to set the merge field item as a button.

 

When the user taps the button (on iPad), I want the script to insert the text of the merge field, into a "TxNotes" field.

 

Preferably, I want to have a single script that can be applied to each of the merge field buttons, inserting the merge field text of the particular button.

 

Currently, I have an individual script for each button, which inserts the contents of the associated field - however, I need a considerable number of buttons, so want to economise on script usage.

 

Current script (per button) is:

 

Insert Calculated Result [Visit Notes::TxNotes; CAA::R1C1 & " "]

Go to Object [Object Name: "AL"]

 

.......whereby the referenced field value CAA::R1C1 is different for each button. (i.e. R1C1 = row 1 column 1 of the button layout, other fields are R1C2, R1C3, R2C1 etc).

 

I'm thinking I need to set up a global variable, say $$mergefieldvalue, that corresponds to either the actual text of the button being tapped, or at least points to the original field that the merge field corresponds to.

 

Because there will be around 64 individual buttons, spread over 4 layouts, I am after an option that slows the ipad down the least. I don't mind doing an individual script for each button if it results in faster execution - just wondered if a single generic script would be as effective,

 

and how to possibly use a merge field value in a calculation (if possible).

 

TIA

Posted

an example file or screenshot would be nice...  You don't really mean a merge field do you (i.e. the kind of text that you can add in Layout mode with the command Insert >. Merge Field... )? 

 

Do you mean that you have conventional field of text, and that you'd first like to click on some point within the text, to place the insertion point where text is to be inserted?  Then you want to select a button in order to automatically insert text from another field into the text field at cursor's the insertion point?  

 

If so, then maybe the attached file is what you're after.

merge.fmp12.zip

Posted

Actually Matthew,

 

That is exactly what I want.

 

You can see the layout below, shows a heap of button graphics with a merge-field value forming the label for the button.

 

Instead of having a unique script for each button, (which inserts the text value of the merge-field's original field value), and thus needing each script to point to the corresponding unique field value for insertion into the TxNotes field, I was just hoping there may be an expression that will allow me to have a generic script, applied to each button, that would simply insert the text value of the merge-field label contents.

 

Just trying to save myself a lot of script writing (there's 3 other pages with this sort of button labelling!)

 

 

(Image below is in Edit Layout view)

 

EquineChirov52-L.jpg

 

an example file or screenshot would be nice...  You don't really mean a merge field do you (i.e. the kind of text that you can add in Layout mode with the command Insert >. Merge Field... )? 

 

Do you mean that you have conventional field of text, and that you'd first like to click on some point within the text, to place the insertion point where text is to be inserted?  Then you want to select a button in order to automatically insert text from another field into the text field at cursor's the insertion point?  

 

If so, then maybe the attached file is what you're after.

Posted

Sorry, I meant to reply earlier... I can see what you mean about a lot of buttons!  

 

I think the fact that you have a bunch of merge fields as labels is kind of irrelevant.  You can still use the basic approach that I showed in my example file.  The same script is used for each of the buttons. However, each button uses a different script parameter to tell the script which data field to transmit.  In your case the script parameters would be "CAL::R1C1", "CAL::R1C2", etc. 

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