Complex? easier way? can this be done in lotus script

FIELD SaveOptions:=1;

FIELD Stage:=Stage;

FIELD trequestor:=Requestor;

FIELD timplementor:=Implementor;

FIELD ttestperson:=TestPerson;

FIELD Counter:=“0”;

@SetField(“Counter”;“0”);

@Command( [EditDocument]; “1” );

@SetField (“Stage”; “Approved”);

@SetField(“SOMManagerApprovalDate”;@Today);

@SetField(“Implementor”; @Prompt([OkCancelEdit]; “Assign to:”; “Please assign this change…”; “”) );

@If(

(trequestor=ttestperson & trequestor=timplementor);@SetField(“Counter”;“1”);

(trequestor=timplementor);@SetField(“Counter”;“2”);

(trequestor=ttestperson);@SetField(“Counter”;“3”);

(timplementor=ttestperson);@SetField(“Counter”;“4”);

(trequestor!=ttestperson & trequestor!=timplementor);@SetField(“Counter”;“5”);

“”);

@If(Counter=“1”;

(@MailSend(Requestor;“”;“”;“Your Change Request # “+FSqNumber+” has been approved.” ; "The Change Request has been assigned to you. " +@NewLine+"You are also required to perform the testing. "+@NewLine+@NewLine+"Click on the doclink to view the following request: ";“ChangeTitle”+@NewLine+ChangeTitle;[IncludeDoclink]));

“”);

@If(Counter=“2”;

(@MailSend(Requestor;“”;“”;“Your Change Request # “+FSqNumber+” has been approved.” ; "The Change Request has been assigned to you. " +@NewLine+@NewLine+"Please contact the tester after the implementation. "++@NewLine+@NewLine+"Click on the doclink to view the following request: "+@NewLine+@NewLine;“ChangeTitle”+@NewLine+ChangeTitle;[IncludeDoclink]));

“”);

@If(Counter=“2”;

(@MailSend(TestPerson;“”;“”;“Change Request # “+FSqNumber+” has been assigned to you for testing.” ; " This change is to be implemented by " +Implementor+“,” +@NewLine+@NewLine+"You are only required to perform the testing for this change. "++@NewLine+@NewLine+"Click on the doclink to view the following request: "+@NewLine+@NewLine;“ChangeTitle”+@NewLine+@NewLine+ChangeTitle;[IncludeDoclink]));

“”);

@If(Counter=“3”;

(@MailSend(Requestor;“”;“”;“Your Change Request # “+FSqNumber+” has been approved.” ; “The Change Request has been assigned to “+Implementor+”.”+@NewLine+ +@NewLine+"You are also required to perform the testing. "+@NewLine+@NewLine+"Click on the doclink to view the following request: "+@NewLine+@NewLine;“ChangeTitle”+@NewLine+@NewLine+ChangeTitle;[IncludeDoclink]));

“”);

@If(Counter=“3”;

(@MailSend(Implementor;“”;“”;“Change Request # “+FSqNumber+” has been assigned to you…” ; “You are required to perform the work for this change request.”+@NewLine+@NewLine+"Click on the doclink to view the following request: ";“ChangeTitle”+@NewLine+@NewLine+ChangeTitle;[IncludeDoclink]));

“”);

Subject: complex? easier way? can this be done in lotus script

As you already have a working code in Formula language why you want to change it LotusScript? Formula language executes faster.There is no unwanted complexity in this code. It first evaluates scenario/workflow stage at which document is being saved, and then take an action appropriate to the stage. This code looks clean and good for me. In Lotus Script you will end up writing approx 200 lines code for this.

Am I missing something?

Regards,

Litty Joseph

Subject: RE: complex? easier way? can this be done in lotus script

Some of the code does not work with the browser. I have a lotus script in QuerySave and it want to add this there. It will be hard to mix.

Basically, I want to send 1 single message if Person=requestor=implementor=assignto, 2 messages if requestor =implementor only, 1 to requestor, 1 to implementor…and so on…

Do I need 3 arrays for requestor, implementer and assignto…cause all of them are multi-value fields; each might get slightly different message, depending on the counter…?

How do I compare who is in what? Need to advice…