@Prompt - Show Message One Time

Can anyone explain why the followng code does not work as I would like it to. I am trying to display a message one time with @Prompt. The code is in a computed text field.

n := 1;

@While(n <= 1;

@If(FixedPricingYears1 = “2 years” : “3 years” : “4 years” : “5 years” : “6 years” : “7 years” : “8 years” : “9 years” : “10 years” : “11 years” : “12 years” : “13 years” : “14 years” : “15 years” : “16 years” : “17 years” : “18 years” : “19 years” : “20 years” : “21 years” : “22 years” : “23 years” : “24 years” : “25 years”; @Prompt([Ok]; “CMS Reminder” ; “This Conract must be signed per (DSA) Policy.”); “”);

n := n + 1)

I welcome any and all comments.

Thanks

BRYANT

Subject: @Prompt - Show Message One Time

Question is, when do you expect the prompt box to appear?

As per your code, this will only happen, if a pair-wise comparision of FixedPricingYears1 and your list returns true. If FixedPricingYears1 contains one value only, this should work as expected. If it can contain multiple values, and any match should be sufficient to display the prompt box, then change your if condition to

FixedPricingYears1 *= “2 years” : “3 years” : …

Subject: RE: @Prompt - Show Message One Time

The code that you see works correctly. There are no issues with it.

All I want to do is display the @prompt message one time if the condition is met. The formula is working correctly. However, the formula will continuously display the @prompt message every time a user tries to enter data in other fields.

Subject: RE: @Prompt - Show Message One Time

When, how and where is this code be called?

Subject: @Prompt - Show Message One Time

You should indicate in what way it doesn’t work.

First off, why have a loop at all? It’s only being run once.

Secondly, what are the possible ranges of FixedPricingYears1?

That selection criteria should be simplified if possible.

e.g. @If(@Contains(FixedPricingYears1; " years"); …

Thirdly, if you have problems with the @Prompt within the @If, or if you would rather have the code laid out in an easier-to-read form, consider using the negative check to escape the formula,

i.e.

@If( ! @Contains(FixedPricingYears1; " years");

@Return(“”); “”);

@Prompt([Ok]; “CMS Reminder” ; “This Conract must be signed per (DSA) Policy”);

BTW, Contract is misspelled.

Subject: RE: @Prompt - Show Message One Time

Thank you for your help…

However, your focusing on issues that I am not concerned with.

All I want to do is display the @prompt message one time if the condition is met. The formula is working correctly. However, the formula will continuously display the @prompt message every time a user tries to enter data in other fields.

Subject: RE: @Prompt - Show Message One Time

Well, that’s what’s going to happen, if

  1. your specification is as precise as “Can anyone explain why the following code does not work as I would like it to.”

and

  1. your code sample contains obvious nonsense, which you don’t dare to explain.

Still, you didn’t even mention, WHERE you put this code. Hint: It might just attribute to the problem … :wink: