Jump to content
Oyseka

Help with Integer to create an action in a script

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

Share this post


Link to post
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

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

The expression =

not Mod ( Counter ; 3 )

will return true when Counter is divisible by 3 (e.g. 0, 3, 6, 9, 12, etc.).

Share this post


Link to post
Share on other sites

Wow, how cool is that. Sorry comment I was fixated on Integer. Thank you for your help once again

Share this post


Link to post
Share on other sites

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

  • Who Viewed the Topic

    2 members have viewed this topic:
    reynir  DavidTO 
×

Important Information

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