Help with prompt

Hi everyone,I have a view with a “Resolved” button that should alert the user via a prompt if the Cause field is not filled in. If the Cause field is filled in, there are 4 fields that should then poplulate. The form opens automatically in Edit Mode because of Postopen script, but I’m selecting the document to Resolve from the view so it’s not open. I’ve tried many things but can’t get this to work; I’m most probably a moron. Anyway, here is my code; I would appreciate any help you can give me. Thanks!

@If(“Cause” = “”;

@Do(

@Prompt([Ok]; “What’s the cause?”; “You must fill in the cause if you are resolving this issue.”));

@Return(“”);

FIELD Status:=6;

FIELD Resolved:=“Yes”;

FIELD ResolvedOn:=@Today;

FIELD ReOpen:=“No”)

Subject: Help with prompt

try it like this:

@If(Cause = “”;

@Return(

@Prompt([Ok]; “What’s the cause?”; “You must fill in the cause if you are resolving this issue.”)); “”);

@SetField(“Status”; 6);

@SetField(“Resolved”; “Yes”);

@SetField(“ResolvedOn”; @Today);

@SetField(“ReOpen”; “No”)

Subject: RE: Help with prompt

Both solutions work just fine, now that I (duh!) took the quote marks off the field name. Thanks for that Jerry. I guess I need lots more practice doing this. Thanks again all of you for your help.

Subject: Help with prompt

Please try this and see if it works or not:

@If(“Cause” = “”;

@Prompt([Ok]; “What’s the cause?”; “You must fill in the cause if you are resolving this issue.”);

@Do (@SetField (“Status”; 6); @SetField (“Resolved”; “Yes”); @SetField (“ResolvedOn”; @Today); @SetField (“ReOpen”; “No”)))

HTH

Subject: RE: Help with prompt

Hi and thanks for the help. I tested the code which did not work. The prompt was ignored and the fields were populated. The Cause field is a radio button if that makes any difference.

Subject: RE: Help with prompt

Jerry’s right, we need to remove the “” from Cause. Please try this:

@If(Cause = “”;

@Prompt([Ok]; “What’s the cause?”; “You must fill in the cause if you are resolving this issue.”);

@Do (@SetField (“Status”; 6); @SetField (“Resolved”; “Yes”); @SetField (“ResolvedOn”; @Today); @SetField (“ReOpen”; “No”)))

Subject: RE: Help with prompt

If Cause in

@If(“Cause” = “”

is a field name or a variable, it should not be enclosed in quotes.