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

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

Recommended Posts

Posted

The following script works in FMP 6 but not 7...its something simple but I just cant make it work. what am I missing?

There are two files. SR_Lead and SR_Contract the join is on Lead Number in both files. The script checks to see if I have aan existing contract record related to the lead record. If not it lets me build a new contract record if so it takes me to the existing contract record.

In Version 7 it is not doing the check for the existing SR_Contract record. The problem is likely in the If [Get (Last error)=101 ] statement but I can't figure out what is haywire

Posted

If you got an error the select window step is between the "gtrr" and the "if" thus the get(last error) would not show it.

You could use a global to store the error before selecting a window and use the global in the if.

Posted

You can also test for the existence of a related record instead of performing the step and retrieving the error.

If [not IsEmpty(SR_Contract Record::serial)]

Show Custom Dialog ["You can not create a new contract..."]

Else

Perform Script ["New Contract"]

End If

Posted

...How do I store an error in a global? and once I have it how do I get the srcipt to act the way it is supposed to?

Also I tried this:

If [not IsEmpty(SR_Contract Record::serial)]

Show Custom Dialog ["You can not create a new contract..."]

Else

Perform Script ["New Contract"]

End If

and it didn't work....it is all there?

Posted

.How do I store an error in a global?

Well is it needed?? Hardly!!!! What I usually make a condition just before the GTRR to count the number of related records based on the newly entered key ...or as -Queue- suggest looks if a serialnumber is availiable ...if none exists perform the subscript.

So get rid of the line containing the Get(LastError) ...it's a waste of steps if measures exists to prevent the error in the first place.

--sd

Posted

Can you elaborate on "it didn't work"?

You will need to substitute your related unique ID field name for 'serial', in case this is your issue.

Those steps are merely the core of the idea. If you need to perform more steps after the Perform Script, then by all means, add them.

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