@Prompt inside another @Prompt

Hi, I’m trying to create a button that when pressed prompts the user to select yes or no, then if they say yes I want the formula to set 3 field values, one of which is based on another @Prompt, my code is below. The problem I’m having is that I am getting the secong prompt whether I select Yes or No on the first…

@Prompt([YESNO];“Close Claim”;“Do you wish to close this claim?”);@Do(@SetField(“HiddenStatus”;“1”);@SetField(“DateClosed”;@Today);@SetField(“Status1”;@Prompt([OkCancelCombo];“Approval”;“Accept or Reject”;“”;“Accepted”:“Rejected”)))

Any help greatly appreciated as i’ve been staring at this all morning and I don’t seem to be getting anywhere, thanks

Mike

Subject: @Prompt inside another @Prompt

Mike try this:


ans:=@Prompt([YESNO];“Close Claim”;“Do you wish to close this claim?”);

@IF(ans;

@Do(@SetField("HiddenStatus";"1");

    @SetField("DateClosed";@Today);

    @SetField("Status1";@Prompt([OkCancelCombo];"Approval";"Accept or Reject";"";"Accepted":"Rejected")

    );

Null

)


Subject: RE: @Prompt inside another @Prompt

Thats fantastic, thank you for your help and quick response

Subject: @Prompt inside another @Prompt Extra

I have now integrated the previous formula into the complete one that I wish to use, the only thing I cannot figure out now is how to get it to save the document after the final prompt aswell as at the end (last part of the If statement, here’s my formula, any help much appreciated:

@Command([ViewRefreshFields]);

@If(BillTo=“”;@Prompt([Ok];“Reminder”;“Customer To Bill To Empty”);

ShipTo=“”;@Prompt([Ok];“Reminder”;“ShipTo Empty”);

ClaimValue=“”;@Prompt([Ok];“Reminder”;“Zero Claim Value”);

(@Prompt([YesNo];“Close Claim”;“Do you wish to close this claim?”));

@Do(@SetField(“HiddenStatus”;“1”);

@SetField(“DateClosed”;@Today);

@Command([ViewRefreshFields]);

@SetField(“Status1”;@Prompt([OkCancelCombo];“Approval”;“Accept or Reject”;“Rejected”;“Accepted”:“Rejected”)

));

@PostedCommand([FileSave])&@PostedCommand([FileCloseWindow])

)

Subject: RE: @Prompt inside another @Prompt Extra

Mike try use one @If for the checks and one to save and close. Like this:


@If(BillTo=“”;@Prompt(…);

ShipTo="";@Prompt(...);     

ClaimValue="";@Prompt(...); 

@Prompt([YesNo];...);@Do(...);

Null);

@If(@Command([FileSave]);@Command([FileCloseWindow]);Null)


I’m not sure you need to use @PostedCommands, just try both.

Giorgio

Subject: RE: @Prompt inside another @Prompt Extra

Thanks for your help but we have now decided that the save and close should be a seperate operation, once you have closed the document.