Web document Submission problem

Hi,In the Following code if I remove the ‘alert’ message, the documnet does not get submitted, adding the alert message documents get submitted nice. How can I solve this…any Idea. Thanks.

if(document.forms[0].Query_String.value==‘OpenDocument’){

window.document.forms[0].submit();

var PID= document.forms[0].MasterDocID.value;

alert(‘Major Market Updated.’);

window.location =ODB()+‘/AllDocID/’+PID+‘?OpenDocument’;

} else if

Subject: Web document Submission problem

You might want to swap the var PID and the submit statement.

Subject: RE: Web document Submission problem

It does not help …Putting this alert message before the window.location statement makes it work,

I need to put something in between submit statement and window.location statement, because I think before submission process is done window.location is getting executed, that is why putting a alert in the middle helps.

Subject: Web document Submission problem

The submission itself is a new location request. The only difference between document.forms[0].submit() and window.location = url is that one is a POST request and the other is a GET. Use a $$Return field on the form to redirect the browser after the POST occurs.

Subject: RE: Web document Submission problem

Hi,

I did tried to use the $$Return field, its not working…its is giving error msg

"Error 404

HTTP Web Server: Lotus Notes Exception - Entry not found in index"

value of $$Return field is…

[/NDT/JGPC.nsf/AllDocID/0C9E7B8AEBC1B2ED442573610021C114?EditDocument]

Code in in the $$Return…

db:=@ReplaceSubstring(@Subset(@DbName;-1);“\”;“/”);

FIELD QSVal:=Query_String;

FIELD MasterDocID:=MasterDocID;

@If(QSVal=“OpenDocument” | QSVal=“EditDocument” ;“[/”+db+“/”+“AllDocID”+“/”+MasterDocID+“?EditDocument]”;

“[/”+db+“/”+“MajorMarket”+“?Openform&ParentUNID=”+ParentDocID+“]”)

Subject: RE: Web document Submission problem

That tells you that the document ID is not valid AND that there is no document appearing in the “AllDocID” view that has the value “0C9E7B8AEBC1B2ED442573610021C114” in the first sorted column. How are you getting the UNID?

ADDED: …or there may be an @DbLookup formula that’s failing on the form of the document you’re trying to redirect to.