I don't know if it is easier to understand it like this:
if (syge/cpr != "")
if (syge/cpr == kursist/cprnr)
String x = kursist/id;
if (eaftale/kursistidfkey == x & status == "avalible")
syge/eaftale.settext = eaftale pkey nr.
There doesn't seem to be any need for the Copy [Select....] step as you never paste the copied data into a field anywhere in the script. In general, Copy and Paste steps should be avoided whenever possible they fail to work if the referenced field isn't present on the current layout and copy will replace any data the user has copied to the clipboard with the data your script has copied.
You might want to insert a Set Error Capture [on] step before you perform the first find and use:
If [ Get ( FoundCount ) > 0]
To confirm that any records where found.
Set Error Capture will keep FileMaker from interrupting your script with a message that no records were found.
Hi tnx for the help, i'll do that
but is this way of doing it right I mean with chaging layout and all, I was wondering what if some people don't have access to a layout and they run that script, what then :S
You can only perform a find on a table if the current layout refers to that table via Show Records From in Layout setup... so you have to switch layouts. You can hide the layout change by using freeze window at the start of your script.
If you use a layout to which some users won't have access permission, either create a different layout that refers to the same table (it can be blank as long as you don't use copy and paste and you can hide the layout from users by keeping it off the layout menu's list) or select the "run with full access" option for the script (Check box at bottom of script editor.)
Okay tnx I'll try that
IhaveanotherproblemnowI am tryingtocreateareport,andIneedtosortthedateby"<=to current date"or">=to current date"butit doesn'tseemtobeworking.
Or do I have to first perform a find then click on sort :S
Yes, find your records, then sort them.