I have a piece of code that was working in R5 but, does not work in R6. The code is run from an outline entry in the view preview pane. It is supposed to verify that the user has the correct document highlighted before it will allow them to create another document. Even if the document is highlighted it does not recognize it in R6. Any help/insight would be greatly appreciated. Here is the code:AT_Exist:=“”;
@If(Form_Desc != “IT Acceptance Test and Approval”;
@Do(@Prompt([Ok];“Select a Valid IT Acceptance Test and Approval”;“Please ensure that a valid and completed IT Acceptance Test and Approval Document is selected first before creating a User Acceptance Test and Approval document. Please try again.”); @Return(“”));
@If(Form_Desc != “IT Acceptance Test and Approval” | Doc_Status != “Completed”;
@Do(@Prompt([Ok];“IT Acceptance Test and Approval Not Complete”;“Please ensure that the IT Acceptance Test and Approval highlighted has been approved and completed before creating an Acceptance document. Please try again.”); @Return(“”));
@Do(@SetField(“AT_Exist”;@DbLookup(“Notes”:“NoCache”;@DbName;“ATLHV”;Work_Order_No +UR_No;1));
@If(@IsError AT_Exist); @Command([Compose];“AT”);
@Do(@Prompt([Ok];“A User Acceptance Test and Approval Document Exists”;"Currently there is already an existing User Acceptance Test and Approval document for Work Order " + Work_Order_No + " under User Requirement " + UR_No + “. Please try again.” );
@Return(""))))))
Thanks in Advance,
Dawn
Subject: Code worked in R5 not working in R6.
Can you try posting the code again? Maybe pasting directly? I see at least one error in what you have here that would prevent the formula from ever saving in R5 or ND6.
Subject: RE: Code worked in R5 not working in R6.
Here you go:AT_Exist:=“”;
@If(Form_Desc != “IT Acceptance Test and Approval”;
@Do(@Prompt([Ok];“Select a Valid IT Acceptance Test and Approval”;“Please ensure that a valid and completed IT Acceptance Test and Approval Document is selected first before creating a User Acceptance Test and Approval document. Please try again.”); @Return(“”));
@If(Form_Desc != “IT Acceptance Test and Approval” | Doc_Status != “Completed”;
@Do(@Prompt([Ok];“IT Acceptance Test and Approval Not Complete”;“Please ensure that the IT Acceptance Test and Approval highlighted has been approved and completed before creating an Acceptance document. Please try again.”);
@Return(“”));
@Do(@Set(“AT_Exist”;
@DbLookup(“Notes”:“NoCache”;@DbName;“ATLHV”;Work_Order_No +UR_No;1));
@If(@IsError AT_Exist);
@Command([Compose];“AT”);
@Do(@Prompt([Ok];“A User Acceptance Test and Approval Document Exists”;"Currently there is already an existing User Acceptance Test and Approval document for Work Order " + Work_Order_No + " under User Requirement " + UR_No + “. Please try again.” );
@Return(“”))))))
Hope this is better. I just changed the @Setfield back because, in the original one it was @set. Thanks so much for your help.
Dawn
Subject: RE: Code worked in R5 not working in R6.
There appears to be a missing set of parentheses in @IsError(AT_Exist) (it is now @If(@IsError AT_Exist), which is what I was referring to earlier. (Also, you can reassign variables without @Set now, so you might want to give that a try.)
Subject: In actual code it is there!
I am not sure how that parenthesis got taken out when I posted but, it is there. That is not the issue.
Thanks anyway, Any other ideas would be greatly appreciated.