Jump to content

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

Recommended Posts

Posted

I have a calculation:

DepTotReq / PurchasePrice * 100

which gives me a percent of the deposit to the purchase price.

What I now what to do is create a message to appear where the deposit is greater than 10% of the purchase price.

If(PercentFlag > "10", "This will be an instalment contract because the deposit exceeds 10% of the price. Notify client of effect before returning contract to client", "")

Question 1 - this calc is not working, it's putting it all of the time where percentflag does not equal to 10. I have also tried putting the 10 as a field but it still wouldn't work.

Question 2 - Is there a way of showing a message? So far the text above just comes in in bright red on the record.

Cheers

Posted

Ermmm, this is not a good way to do percentages. It should be just...

DepTotReq / PurchasePrice

... then format the field to display the number as a percentage.

If you multiply by 100 then you're going to have to remember to divide by 100 again whenever the value is used in a calculation, otherwise the result will have an error of two orders of magnitude.

Moving on, to answer your question... the quotes turns the number into literal text, which you then cannot use in a maths calculation. You want PercentFlag > 10 without quotes around the 10.

When you ask about showing a message, you mean an alert? Why not use the field validation and specify a custom message? Otherwise a script will be needed, and that may need a plugin if you want it to run after entering or leaving the field.

Alternatively and easiest is to just display the "message" in a field on your layout, in a calculated text field.

Posted

Hi Kiwiora! Hi Vaughan!

I don't think I'd put that long sentence in a calculation - wouldn't it just waste resources or processor cycles? Instead, you might consider storing it in a global text field - no need to hard code it into a calc and then you can easily change your messages. wink.gif Then use a calculation to display it if the record matches the calc critera. It

Posted

If you are using these calculations as part of a script, don't forget that you can automatically send an email to the client, eliminating just one more thing that you have to do during the day. You could also add the client phone number to the custom message mentioned in Vaughan's solution.....

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