Jump to content
Per Waagø

FM pro 15 - find mode variables

Recommended Posts

Hi. 

I seem to find variating answers to this topic, so here I try again.

How do I use a variable to perform a find in a script? I want to use the field contents of the current record to search for similar records. 

Background: We send a lot of people out to different countries and I want to make a script that makes an excel sheet with various data based on the country field of the current record. Hence, if the current record is going to France, I want to see everybody that we currently have in France etc. However, we have two return dates so I need to do two searches: 

1. Country+ departure date <=// + arrival date >=//  

2. Country+ departure date <=// + Extended arrival date >=//  

Is it really true that perform find cannot handle a variable?

Hope you can help.

Share this post


Link to post
Share on other sites
10 minutes ago, Per Waagø said:

Is it really true that perform find cannot handle a variable?

No, it is not true - see: http://www.filemaker.com/help/15/fmp/en/#page/FMP_Help%2Fspecify-edit-find-requests.html%23 However, it is often more convenient to use the variable for setting a field in Find mode rather than in a stored find request.

I am afraid I did not understand your pseudo-code for the two searches you want to do.

Share this post


Link to post
Share on other sites

comment,

 

Do I understand correctly that this is available in FM 15, but not in FM 14?  It looks like it to me based on the FM 14 help files....if so, arggh :(

Another question - when I try to use "set field"in find mode in a script, I get an error telling me my find criteria are not valid.

 

Enter Find Mode [ ]

Set Field [TargetTable::FieldToSearch; FieldWithSearchCriterion]

Perform Find [ ]

 

What am I doing wrong?

 

 

Share this post


Link to post
Share on other sites

Is 'FieldWithSearchCriterion' a global? If not, it will have no value in Find Mode.

Share this post


Link to post
Share on other sites
17 minutes ago, chemparrot said:

Do I understand correctly that this is available in FM 15, but not in FM 14?

If by "this" you mean the use of variables in scripted find requests, it's been available since version 11.

 

21 minutes ago, chemparrot said:

Enter Find Mode [ ]

Set Field [TargetTable::FieldToSearch; FieldWithSearchCriterion]

Perform Find [ ]

This can only work if FieldWithSearchCriterion is a global field (as Fitch posted while I was writing this). You probably want to do:

Set Variable [ $searchValue ; TargetTable::FieldWithSearchCriterion ]
Enter Find Mode [ ]
Set Field [TargetTable::FieldToSearch; $searchValue]
Perform Find [ ] 

 

Share this post


Link to post
Share on other sites

Ah.  Thanks so much to both of you!

 

I wish the help files were better, I can see the help for FM 15 includes examples, but the help for FM 14 does not, which is why I thought it wasn't available. But passing it as a variable is a nice idea.

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • By kims
      I am working on a script that will build a document based on a value from a drop down list.
      I have a layout that contains a Document Subtype. If a certain subtype is selected from the drop down list for this record, then I want my script to be able to pull from a specific container holding the appropriate document for that type. Then I can use Doc Append to combine the two documents. Each document would be custom then to the subtype.
      I'm pretty new at FileMaker so I'm still trying to figure a lot of things out and still trying to understand how to put things together and why it will/will not work.
      I was originally using Case but then I realized that was probably not the correct thing to do. It would either append both types of documents or one, but it wasn't always the correct one.
       
      Any guidance would be greatly appreciated.
       
      If this helps, I want something that will do this:
       
      If Subtype = a, b, or c, then append Doc 1
      If subtype = d, e, or f, then append Doc 2
      and so on...
    • By Asu
      Hello FM experts, 
      this is a concept step for a more complex script but I need a script that has 2 independent features:
      1: it selects the field it is attached to as a button
      2: it can be attached to any arbitrary field and it does the same on that field.  
      The imaginary script step would be this:
      Select field [the one I am attached to] The problem I am running into is that "go to field" can not be defined by calculation, while "go to object" gets confusing between the script and the field being grouped, as the problem detailed here [https://www.soliantconsulting.com/blog/story-about-go-to-object] seems to be a complicating factor.
       
      Thanks
      Asu
    • By jcarter
      Hi Guys,
      I've been using CloudMail for a couple of years now to send marketing campaigns for my company. Just recently I have moved to remote hosting with AWS and now my server is offsite I have noticed some performance issues with cloudmail and a few other areas of my solution.
      To address these issues I have started using server-side scripts to perform labour intensive tasks such as creating bulk records (20,000) at one time. This has resulted in excellent performance once again.
      The problem I can't seem to fix is sending my email campaigns using server-side scripts. I have confirmed the plugin is installed etc on the server and with quite a bit of trial and error, I am still unable to send the campaigns.
      Does anyone have a sample script they use, or any advise how I can get this working?
      I appreciate any help and thanks in advance
      Regards,
      Jason
       
    • By naio
      My solution is build according to the 'separation model', so I would like to keep control of the local file containing the layout and presentation of the data hosted in the server.
      I wonder if I could have a script to control wether the local file gets its structure, layout or scripting modified, so I need a function to control when a change to the file has been made before giving it a version number. When the file gets open only to work with the hosted data it's not a new version.
       
    • By Oyseka
      Hi all, I have a requirement to reduce the size of a database by removing records from the work system and importing them into an offline archive system but don't know how to automate the scripting between the files.
      Database 1 is a work system where, among other things, service records are created during a service and any problems found during the service are annotated and photographed on mobile devices. At the end of the service a summary report of all actions carried out and any problems that require the customers attention is produced, signed by the customer and emailed to them.
      With about 450-600 photographs taken each month the file size will ballon very quickly so I have created a new database which is a duplicate of the photos file which contains all the required information to link to both a customer, particular service and operator and I want to find records in the work database which are over a certain number of days old, open the external file and import those records then return to the work file and delete the found set.
  • Who Viewed the Topic

    5 members have viewed this topic:
    Will Xu  Ron Cates  Punith baskar  oscar23445  jddel 
×

Important Information

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