locked
Bulk delete via silverlight RRS feed

  • Question

  • Hi all,

    I want to use bulk delete request in my silverlight application but it returns an error server not found :404

       Service = SilverlightUtility.GetSoapService();

       QueryExpression query = new QueryExpression()
                     {
                         EntityName = "ymsli_ratingdetailline",
                         ColumnSet = new ColumnSet()
                         {
                             AllColumns = true
                         },
                         Criteria = new FilterExpression
                         {
                             FilterOperator = LogicalOperator.And,
                             Conditions =
                        {
                            new ConditionExpression
                          {
                              AttributeName = "ymsli_ratingdetail",
                              Operator = ConditionOperator.Equal,
                              Values = {new Guid("92D2B4FF-1193-E311-8183-D89D6765A2E4")}
                          }
                        }
                         }
                     };

     OrganizationRequest bulkDeleteRequest = new OrganizationRequest() { RequestName = "BulkDelete" };
                     bulkDeleteRequest["JobName "] = "Backup Bulk Delete";
                     bulkDeleteRequest["QuerySet "] = new ObservableCollection<QueryExpression> { query };
                     bulkDeleteRequest["StartDateTime"] = DateTime.Now;
                     bulkDeleteRequest["RecurrencePattern"] = String.Empty;
                     bulkDeleteRequest["SendEmailNotification"] = false;

      Service.BeginExecute(bulkDeleteRequest, EndBulkDeleteResponse, Service);

     private void EndBulkDeleteResponse(IAsyncResult result)
            {
                try
                {

                    OrganizationResponse dataColl =  ((IOrganizationService)result.AsyncState).EndExecute(result);
                }
                catch (Exception ex)
                {

                }
            }


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Monday, February 17, 2014 5:45 AM

Answers

  • got the solution replace:

    bulkDeleteRequest["JobName "] = "Backup Bulk Delete";
                     bulkDeleteRequest["QuerySet "] = new ObservableCollection<QueryExpression> { query };

    with

    bulkDeleteRequest["JobName"] = "Backup Bulk Delete";
                     bulkDeleteRequest["QuerySet"] = new ObservableCollection<QueryExpression> { query };


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Monday, February 17, 2014 8:19 AM