Options

ReadMultiple web service with bookmark option.

pravin_crystalpravin_crystal Member Posts: 11
edited 2009-09-25 in NAV Three Tier
Hello Friends,

I am accessing a large number of records on web using the web service. The initial problem is my operation gets timeout.
So, I m using the bookmark option in readmultiple and i m getting the records smoothly and very well, but i facing problem to go back (backward in navigation) because my bookmark key is used to go forward only.
And I am storing the retrieved records into the array, so at the time of last page my array will generates error.

JobWCCStatus_ref.JobWCCStatus_Filter[] jobwccstatus_filter = { new Navweb.Web.JobWCCStatus_ref.JobWCCStatus_Filter(),
new Navweb.Web.JobWCCStatus_ref.JobWCCStatus_Filter() };
jobwccstatus_filter[0].Field = Navweb.Web.JobWCCStatus_ref.JobWCCStatus_Fields.Job_No;
jobwccstatus_filter[0].Criteria = jobno;
jobwccstatus_filter[1].Field = Navweb.Web.JobWCCStatus_ref.JobWCCStatus_Fields.Line_Type;
jobwccstatus_filter[1].Criteria = Navweb.Web.JobWCCStatus_ref.Line_Type.Contract.ToString();

nextbook = Convert.ToBoolean(ViewState["next"]);
if (nextbook == false)
{
jws = navref.Jobwccstatus_serv.ReadMultiple(jobwccstatus_filter, null, 90);

ViewState.Add("bookMark", jws[jws.Length-1].Key);

}
else
{
bookmarkKey = ViewState["bookMark"].ToString();
jws = navref.Jobwccstatus_serv.ReadMultiple(jobwccstatus_filter, bookmarkKey, 90);


if (Convert.ToInt32(ViewState["status"]) == 1)
{
ViewState.Add("bookMark", jws[jws.Length - 1].Key);
ViewState["status"] = 0;
}
}

gvProjectWCCStatus.DataSource = jws;
gvProjectWCCStatus.DataBind();


I am waiting for your reply.
Sign In or Register to comment.