Hi Mark:
Thanks for your reply, again!
The code is a bit long and includes lots of calls to the CRM web services,
but I have pasted relevant parts below. I am not calling an JScript at all,
so I am not sure where that error is coming from.
John.
public ArrayList alistSOWs = new ArrayList();
//Login button click method
//===============================================================================================
//===============================================================================================
protected void cmdLogin_Click(object sender, ImageClickEventArgs e)
{
string strAccountGuid = "";
try
{
//Initialize CRM web services============
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0;
token.OrganizationName = "StraumannGroup";
CrmService webservice = new CrmService();
webservice.Url =
"
http://straumannsrvr2:5555/mscrmservices/2007/crmservice.asmx?WSDL&uniquename=MicrosoftCRM";
webservice.CrmAuthenticationTokenValue = token;
webservice.Credentials =
System.Net.CredentialCache.DefaultCredentials;
// Create Username condition
ConditionExpression userNameCondition = new ConditionExpression();
userNameCondition.AttributeName = "new_webusername";
userNameCondition.Operator = ConditionOperator.Equal;
userNameCondition.Values = new string[] { txtUsername.Text };
// Create password condition
ConditionExpression passwordCondition = new ConditionExpression();
passwordCondition.AttributeName = "new_webpassword";
passwordCondition.Operator = ConditionOperator.Equal;
passwordCondition.Values = new string[] { txtPassword.Text };
// Create the username filter
FilterExpression userNameFilter = new FilterExpression();
userNameFilter.Conditions = new ConditionExpression[] {
userNameCondition };
// Create the password filter
FilterExpression passwordFilter = new FilterExpression();
passwordFilter.Conditions = new ConditionExpression[] {
passwordCondition };
// Create the outer most filter to AND the username condition with the
other filters
FilterExpression outerFilter = new FilterExpression();
outerFilter.FilterOperator = LogicalOperator.And;
outerFilter.Conditions = new ConditionExpression[] {
userNameCondition, passwordCondition };
outerFilter.Filters = new FilterExpression[] { userNameFilter,
passwordFilter };
// Put everything together in an expression
QueryExpression qryExpression = new QueryExpression();
qryExpression.Criteria = outerFilter;
qryExpression.ColumnSet = new AllColumns();
// Set the table to query
qryExpression.EntityName = EntityName.account.ToString();
// Return all records
qryExpression.Distinct = false;
// Execute the query
BusinessEntityCollection retrieved =
webservice.RetrieveMultiple(qryExpression);
Panel pnlSubjects = new Panel();
if (retrieved.BusinessEntities.Length > 0)
{
account aAccount = (account)retrieved.BusinessEntities[0];
bFound = true;
guidAccountId = aAccount.accountid.Value;
strAccountName = aAccount.name;
strAccountGuid = aAccount.accountid.Value.ToString();
}
//Retrieve custoemr engagements for this account
#region retrieve
// Create the ConditionExpression.
ConditionExpression condition = new ConditionExpression();
//Set the condition for the retrieval to be when the RFP Guid on the
//RFP Sent record matches the RFP ID.
condition.AttributeName = "new_customerid";
condition.Operator = ConditionOperator.Equal;
condition.Values = new string[] { strAccountGuid };
// Create the FilterExpression.
FilterExpression filter = new FilterExpression();
// Set the properties of the filter.
filter.FilterOperator = LogicalOperator.And;
filter.Conditions = new ConditionExpression[] { condition };
// Create the QueryExpression object.
QueryExpression query = new QueryExpression();
// Set the properties of the QueryExpression object.
//query.EntityName = EntityName.new_rfpsent.ToString();
query.EntityName = EntityName.new_customerengagement.ToString();
query.ColumnSet = new AllColumns();
query.Criteria = filter;
// Create the request object.
RetrieveMultipleRequest retrieve = new RetrieveMultipleRequest();
// Set the properties of the request object.
retrieve.Query = query;
// Retrieve the "Long List" of hotels that the RFP was sent to
//CRM Entity: new_rfpsent
RetrieveMultipleResponse retrievedEngagements =
(RetrieveMultipleResponse)webservice.Execute(retrieve);
drpProjects.Items.Add("Select...");
for (int i = 0; i <
retrievedEngagements.BusinessEntityCollection.BusinessEntities.Length; i++)
{
new_customerengagement nCE =
(new_customerengagement)retrievedEngagements.BusinessEntityCollection.BusinessEntities
;
ListItem li = new ListItem(nCE.new_enagementtitle,
nCE.new_customerengagementid.Value.ToString());
drpProjects.Items.Add(li);
}
#endregion
}
catch (System.Web.Services.Protocols.SoapException soapEx)
{
}
catch (Exception ex)
{
}
}
//========================================================================================//========================================================================================//Get Statements of work method public void getSOWs(ref ArrayList aSOWS, string sPguid) { try { //Initialize CRM web services============ CrmAuthenticationToken token = new CrmAuthenticationToken(); token.AuthenticationType = 0; token.OrganizationName = "StraumannGroup"; CrmService webservice = new CrmService(); webservice.Url ="http://straumannsrvr2:5555/mscrmservices/2007/crmservice.asmx?WSDL&uniquename=MicrosoftCRM"; webservice.CrmAuthenticationTokenValue = token; webservice.Credentials =System.Net.CredentialCache.DefaultCredentials; // Create the ConditionExpression. ConditionExpression condition = new ConditionExpression(); //Set the condition for the retrieval to be when the RFP Guid on the //RFP Sent record matches the RFP ID. condition.AttributeName = "new_ceid"; condition.Operator = ConditionOperator.Equal; condition.Values = new string[] { sPguid }; // Create the FilterExpression. FilterExpression filter = new FilterExpression(); // Set the properties of the filter. filter.FilterOperator = LogicalOperator.And; filter.Conditions = new ConditionExpression[] { condition }; // Create the QueryExpression object. QueryExpression query = new QueryExpression(); // Set the properties of the QueryExpression object. //query.EntityName = EntityName.new_rfpsent.ToString(); query.EntityName = EntityName.new_statementofwork.ToString(); query.ColumnSet = new AllColumns(); query.Criteria = filter; // Create the request object. RetrieveMultipleRequest retrieve = new RetrieveMultipleRequest(); // Set the properties of the request object. retrieve.Query = query; RetrieveMultipleResponse retrievedSOWs =(RetrieveMultipleResponse)webservice.Execute(retrieve); drpSOWs.Items.Add("Select..."); for (int i = 0; i <retrievedSOWs.BusinessEntityCollection.BusinessEntities.Length; i++) { new_statementofwork sow =(new_statementofwork)retrievedSOWs.BusinessEntityCollection.BusinessEntities; aSOWS.Add(sow); ListItem li = new ListItem(sow.new_name,sow.new_sowid.Value.ToString()); txtWorkItems.Text += sow.new_name + " " +sow.new_sowid.Value.ToString() + "\n"; drpSOWs.Items.Add(li); } } catch (System.Web.Services.Protocols.SoapException soapEx) { } catch (Exception ex) { } }//=======================================================================================//======================================================================================== protected void drpProjects_SelectedIndexChanged(objectsender, EventArgs e) { string strProjectGuid = drpProjects.SelectedValue; getSOWs(ref alistSOWs, strProjectGuid); }//=======================================================================================//======================================================================================== protected void drpSOWs_SelectedIndexChanged(object sender, EventArgs e) { try { new_statementofwork sow =(new_statementofwork)alistSOWs[drpSOWs.SelectedIndex - 1]; txtWorkItems.Text = sow.new_workitems; } catch (System.Web.Services.Protocols.SoapException soapEx) { } catch (Exception ex) { } }"Mark Rae [MVP]" <[email protected]> wrote in messagenews:#[email protected]...> "John Straumann" <[email protected]> wrote in messagenews:[email protected]...>>> Sys.Webforms.PageRequestManagerParserErrorException: The message receivedfrom the server could not be parsed. Common causes for this error are whenthe response is modified by calls to Response.Write(), response filters,HttpModules, or server trace is enabled. Details: Error parsing near'ue,true,true,true]}|<script language='ja">>>> I have no idea what that means!>>>> Could this eror be caused by the multiple-postbacks from the login andthen the population and selections from the drop-downs?>>>> Can anyone make a suggestion as to how to fix this, or a better idea thantwo drop-downs?>> It will be almost impossible for anyone to help you unless you post thecode which throws the above exception...>> However, at first glance, it looks like you're trying to write outJavaScript using Response.Write(). If so, then that's easily fixed...>>> --> Mark Rae> ASP.NET MVP> http://www.markrae.net