Web form

I am quite new to Lotus Development. I have 2 forms one is filled by a requestor having various fields and an airwaybill number that I’m using it to search with. Then I has a second form that only one field where you can input the airway bill number and search on a view where the first form data was entered. The second form is loaded via web browser.

When the number is found in view I change the status and when It was not found I need to send a mail to certain users with the number entered in the field on the web.

I’m using this coding in a button on the web form:

@SetField(“awbnum”;awb_chk);

tmp_res:=@DbLookup(“”:“NoCache”;“”:“”;“airwaybill”;awb_chk;1;[FailSilent]);

@If (tmp_res = awb_chk;@SetField(“status_view”;“Parcel Found”);@SetField(“status_view”;“Parcel Not Found - Email Sent”):@PostedCommand([ToolsRunMacro]; “mail2”)

);

tmp_resa:=@DbLookup(“”:“NoCache”;“”:“”;“airwaybill”;awb_chk;5);

@SetField(“requestor_view”;@If (@IsError(tmp_resa);“…”;tmp_resa));

tmp_resb:=@DbLookup(“”:“NoCache”;“”:“”;“airwaybill”;awb_chk;6);

@SetField(“cmmts_view”;@If (@IsError(tmp_resb);“…”;tmp_resb));

tmp_res1:=@DbLookup(“”:“NoCache”;“”:“”;“airwaybill”;awb_chk;2);

@If(status_view = “Parcel Found”; @SetDocField( tmp_res1; “status” ; “Parcel Arrived” );

“”)

Then when it’s not found I have an agent that send mails. Can some one help please??

Thanks

Subject: A few general suggestions

Firstly, it s considered poor etiquette to post your question on three forums at the same time. If you specify which release of Notes or Domino you are using, it gives everyone more chance of giving you an accurate answer.

Secondly, if you are doing four @DbLookups in one formula, to the same view, with the same key, you are wasting a lot of processing, especially as you specify “NoCache” on all of them.

In fact, as column 2 of your “airwaybill” view is the DocumentUniqueID, why not just retrieve that in the first @DbLookup, and use “@GetDocField” for the other four? Or you could create one column in your view with all four required values concatenated, and then split them up once retrieved. Then you only have to do one @DbLookup.

Next, this line -

@If (tmp_res = awb_chk;@SetField(“status_view”;“Parcel Found”);@SetField(“status_view”;“Parcel Not Found - Email Sent”):@PostedCommand([ToolsRunMacro]; “mail2”)

);

You can’t use a colon to separate lines that you want to execute, you need to use "@Do()"so you need to change that to -

@If (tmp_res = awb_chk;@SetField(“status_view”;“Parcel Found”);@Do(@SetField(“status_view”;“Parcel Not Found - Email Sent”);@PostedCommand([ToolsRunMacro]; “mail2”))

);

Lastly, for now, you haven’t actually asked a question. I presume that your code isn’t working, but you don’t say what is happening, if you are getting an error message etc.

With more information, people will be able to help you better.

Looking forward to hearing from you again,

Phil