Jump to content

Previously Working Script Does Not Work in FMP v7


Nelly
 Share

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

Recommended Posts

Hi Guys, having a problem with a very simple script that will not work in FMP7 whereas it worked fine in FMP6;

If(IsEmpty(Invoice Paid Date);Int(Get(CurrentDate)-Invoice Date);0)

If an invoice has NOT been paid, the above should return a value equal to the amount of days since the invoice was raised. If the invoice has been paid it should return a value of '0'. In FMP6 the script read as If(IsEmpty(Invoice Paid Date);Status(Status(CurrentDate)-Invoice Date);0) and if the invoice date was also blank then the calculation field would remain empty, however, in FMP7 if the Invoice Date field is blank the sript returns a series of numbers such as '731690'.

Can anyone shed any light on why FMP7 messes this up and what I can do to correct the problem? Cheers.

FileMaker Version: 7

Platform: Mac OS X Panther

Link to comment
Share on other sites

Excellent, worked perfectly. Thanks v much!

PS: What is the difference (or reason for using)

IsEmpty(Invoice Paid Date)

instead of

[FieldName]=""

I tend to use the latter in calculations especially If statements but wondered if I should be using the IsEmpty syntax?

Cheers

Link to comment
Share on other sites

Nelly->

FieldName = "" will only work reliably for text fields. A good programming practice is to always use IsEmpty(), it's guaranteed to return what you expect. I used to use = "" and wondered why certain calcs blew up...

Link to comment
Share on other sites

This topic is 6482 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
 Share

×
×
  • Create New...

Important Information

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