Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a layout that has a global field that I'm allowing users to put a code in to. I script looks like this:

Go to Layout ["Web_Registration"(SessionDB)]

Clear [select; SessionDB::Global_PinCode]

Refresh Window[]

However, when I view this layout on the web sometimes the "Global_PinCode" is empty and other times it is not. This is a supported script step on the web. Any ideas why it only works sometimes? Anybody else had these kinds of issues with IWP?

Thanks!

Posted

I would make a couple of changes:

- use Set Field( SessionDB::Global_PinCode; "" ) instead of Clear, and do it before you go to the layout. Since it's a global field (I assume it is), you can access it even from an unrelated layout, and unlike Clear, Set Field doesn't require that the field even be on the layout.

- use a Commit step after the Set Field (or Clear if you insist)

- if all else fails, try running the script with Full Access privileges

Posted

Seemed to do the trick. However I continue to have scripts that execute properly one time in IWP and another time it doesn't. It will leave the user on a layout as if it were to just stop processing the rest of the script. Even though all the steps are "web compatible".

Posted

Yes and every script step is "FileMaker compatible" but that doesn't mean all your scripts will magically work correctly. : That part is up to us!

Give me a specific example and we'll work on it.

Posted

Here is one that works sometimes and other times does not:


Set Variable [ $$SessionID; Value:SessionDB::SessionID ] 

# 

Go to Layout [ “CustomerDB” (CustomerDB) ] 

# 

Enter Find Mode [  ] 

# 

Insert Calculated Result [ CustomerDB::PINCODE; "=" & SessionDB::Global_PinCode ] 

# 

Perform Find [  ] 

# 

#One PIN code found. 

If [ Get ( FoundCount ) = 1 ] 

Set Variable [ $$REGID; Value:CustomerDB::RegistrationID ] 

Go to Layout [ “Web_RegistrationPg2_Single” (RegistrationsDB) ] 

New Record/Request 

Insert Calculated Result [ RegistrationsDB::SessionID; $$SessionID ] 

[ Select ] 

Insert Calculated Result [ RegistrationsDB::CustomerID; $$REGID ] 

[ Select ] 

Go to Field [ RegistrationsDB::SchoolBuilding ] 

Exit Script [  ] 

End If 

# 

#Multiple PIN codes found. 

If [ Get ( FoundCount ) > 1 ] 

Go to Layout [ “Web_RegistrationPg2_Multiple” (CustomerDB) ] 

Sort Records [ Specified Sort Order: CustomerDB::SchoolDistrict; ascending ] 

[ Restore; No dialog ] 

Go to Record/Request/Page 

[ First ] 

Exit Script [  ] 

End If 

# 

#No PIN codes found. 

If [ Get ( FoundCount ) = 0 ] 

Go to Layout [ “Web_NoMatchingPIN” (SessionDB) ] 

Exit Script [  ] 

End If 

# 



This hangs up right after the initial "Insert Calculated Result" at the very beginning. I can put the same "PINCODE" in every time and each time I get one of two things.

1. Either the script leaves the user in "Find Mode" on the "CustomerDB" layout and never completes the find.

OR

2. The find mode is completed and the user is taken to the appropriate layout.

Thanks for your help!

Posted

Same as my first post: something to do with Insert vs. Set Field and/or it's a problem with access privileges.

Is Global_PinCode actually a global? If not, it won't have any value in Find mode. You could try for example putting it on the layout to make sure there's really something there.

Debugging IWP is a PITA, but you could try putting a script step like this after the Insert:

Perform Script( error trap; Get ( LastError ) )

and the error trap script would be something like:

Set Field (some field on layout; Get ( ScriptParameter ) )

Pause (or halt)

Be sure to run error trap with full access.

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