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

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

Recommended Posts

Posted

Hello,

I have a field (paid X)as a button to know when an expense record has been paid, it can be checked or unchecked. Two fields set up...

#1) paid X

calculates If (not IsEmpty (paid timestamp) = "X"

#2) paid timestamp

PAID SCRIPT

If [Get (AccountName) not equal to "janedoe" or "johndoe"

Set Field [paid timestamp: Get (CurrentTimeStamp)]

End If

Commit Records/Request [skip data entry validation; No dialog]

NOT PAID SCRIPT

If [Get (AccountName) not equal to "janedoe" or "johndoe"

Set Field [paid timestamp; ""]

End If

Commit Records/Request [skip data entry validation; No dialog]

The Script is...

Paid Unpaid

If [isEmpty (paid timestamp)]

Perform Script ["paid"]

Else

Perform Script ["Not Paid"]

End If

Commit Records/Request [skip data entry validation; No dialog]

This script works fine, but NOT in IWP. I've already tried the following...

1) all script steps are compatible

2) field privledges are set to modifiable in db accounts & privledges

3) script steps have commit records b/c IWP doesn't save on it's own.

Now what? Help! B)

Posted

If [Get (AccountName) not equal to "janedoe" or "johndoe"

Shouldn't that be written as:

Get (AccountName) <> "janedoe" and Get (AccountName) <> "johndoe"

How did FMP let you use your expression?

Posted

I think you missed the point...

There are 2 conditions to be met, whereas you have used the OR operator which makes only 1 condition.

Posted

That is my problem...I can't figure out which part of the script is not working. Normally I use custom dialog to trouble shoot my scripts, however, that script is not web compatible.

The script is not allowing me to put an X in the processed X field. I tested by inserting the timestamp into the comments field, which is set up as a text field. And that did not work either.

Get (Current Timestamp) shows to be web compatible, so I don't know why this doesn't work.

Any thoughts?

Posted

I can't figure out which part of the script is not working.

Disable selected parts to find out. This would be a lot easier if your three scripts were simplified into a single one:

If [ ]

Set Field [ paid timestamp ; Case ( not paid timestamp ; Get (CurrentTimeStamp) ) ]

Commit Records/Request [skip data entry validation; No dialog]

End If

The first thing to test is what happens when you disable the If[] and End If steps.

The script is not allowing me to put an X in the processed X field

Huh? Didn't you say this was a calculation field?

Get (Current Timestamp) shows to be web compatible

Huh? Get (Current Timestamp) is a function, not a script step - it is neither web compatible nor incompatible.

Posted

#1) There is a main user who will primarily be the one to check/un-check an expense as processed. Therefore, the other two users of the db I don't want to have the ability to use the check box. That is why I have the If statement for the account name. But at the same time, allow me the administrator, to use the function if necessary.

I tried the example you provided, thank you by the way...and the script still will not work in IWP. I also tried taking the IF statement out, didn't work either.

#2) Yes the processed X field is a calculated field, I apologize for not being clear. The X is put into the field IF a timestamp is in the processed timestamp field.

#3) I apologize for the confusion on web campatibility vs. not....basically meaning the script steps I'm using show to be compatible. Therefore, I am confused as to why this script works on my local db copy, but not on the web.

I also checked the accounts and privledges to make sure those particular fields (processed X and processed timestamp) are modifiable, and they are.

Thank you for all your help, I really appreciate it.

I don't know what else to try?

:

Posted

Are you able to set ANY field through IWP? What happens if you add a number field, and your script says:

Set Field [ Numberfield ; Random ]

Commit Records [ No dialog ]

Try this when logged in as admin AND when logged in as a user, to see if there's any difference.

the other two users of the db I don't want to have the ability to use the check box. That is why I have the If statement for the account name.

Instead of hardcoding account names into scripts, it would be better to define privilege sets and assign each account to the appropriate privilege set. Then use Get(PrivilegeSetName) to branch your script.

BTW, I don't know enough about IWP, but I do recall that IWP access requires extended privileges - I suppose you are aware of this and set it up correctly?

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