Jump to content

Help with Integer to create an action in a script


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

Recommended Posts

Hi all, I want to create an action as part of a script that operates if the result of a calculation produces an integer such that:

If[ Field A / Field B = Integer ]

Show Custom Dialog [xxxxxx]

Exit Script

Can anyone assist please

Link to comment
Share on other sites

24 minutes ago, Oyseka said:

if the result of a calculation produces an integer

If the calculation is a division - as it is in your example -  then the result will be an integer when there is no remainder. Once you restate the problem like that, the solution becomes obvious:

If [ not Mod ( Field A ; Field B ) ]
  Show Custom Dialog [xxxxxx]
  Exit Script
Rnd If

In a more general case, a number is an integer when:

Int ( number ) = number

 

Edited by comment
Link to comment
Share on other sites

Thank you comment but I am dorf and do not understand your solution. Perhaps I can give more information.

I have a counter field for customer services which , normally , when it reaches 12 i.e. the twelfth month, produces a updated annual quote then resets to one. There is always one customer however that has a different requirement and this one wants a quarterly quote only. So as I have the mechanism in place, on this particular  customer I want to set the script that if we have finished the second service and produced the next monthly quote, as the service counter is now set to 3 have a calculation that says if the result of Field (The counter) divided by 3 is an integer tell the PCO that a new quarterly Quote is required and take them to the Correct layout. This would then produce the 4 quotes per year for this customer 

Link to comment
Share on other sites

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