locked
Service Appointment error codes RRS feed

  • Question

  •  I have used validate request in service appointment entity. everthing is fine.

    Here is my code

               


    ValidateRequest validatedReq = new ValidateRequest();           

    validatedReq.Activities = new EntityCollection();           

    validatedReq.Activities.Entities.Add(Entity);         

      validatedReq.Activities.MoreRecords = false;         

    validatedReq.Activities.PagingCookie = "";         

      validatedReq.Activities.EntityName = XrmObject.ServiceAppointment.EntityLogicalName;           

    ValidateResponse validateResp = (ValidateResponse)this.OrgService.Execute(validatedReq);         

      if (validateResp.Result[0].ValidationSuccess == false)           

    {           

        return validateResp.Result[0].TraceInfo.ErrorInfoList[0].ErrorCode;           

    }

    validateResp.Result[0].TraceInfo.ErrorInfoList[0].ErrorCode gives me  "ErrorCode.ResourceNonBusinessHours"

    But i want xx is being scheduled outside their works. I search db but i cant succeed finding where this error messages in.

    Any ideas?


    Monday, September 23, 2013 11:51 PM

Answers

  • Hi all,

    i found this page that includes the scheduling error messages. http://msdn.microsoft.com/en-us/library/aa681712.aspx

     Also i cant found these error messages in database but I think crm keeps these messages not in db , somewhere else. Maybe in a class or xml file.

    Ex : you define a restriction for a resource , and your service activity catch these restriction , so validateResp.Result[0].TraceInfo.ErrorInfoList[0].ErrorCode  this gives ErrorCode.ResourceConstraints

    The url above is given ErrorCode.ResourceConstraints corresponds to {resource name} is being scheduled outside their work hours. You can give meaningful messages to end user.



    Tuesday, September 24, 2013 10:41 AM

All replies

  • I have never used this request before. Looking up the SDK it states that this request validates

    verify that an appointment or service appointment (service activity) has valid
    available resources for the activity, duration, and site, as appropriate.

    So the error is in order with the request if you are scheduling the resource outside work hours.

    Have you checked the BookRequest that can be used to Book an appointment or service activity.

    HTH

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Sam - Inogic Tuesday, September 24, 2013 4:19 AM
    • Unproposed as answer by Polat Aydın[MCP] Tuesday, September 24, 2013 10:17 AM
    Tuesday, September 24, 2013 4:19 AM
  • Hi sam,

    Thanks for replying. I wrote this in ServiceAppointment Pre-Create Message. As you know Crm validate appointment and only gives notification like xx is being scheduled outside their works.

    It allows create the record. My aim is if it is not a validate appointment ,i do not allow user to create record and validate request is the exact request that ı am looking for. But error code is not meaningful for end user.

    I found errorcode.cs in sdk ( samplecode\cs\helpercode) . Either i cant find schedule error messages. ı hope u understand my problem.

    note : Also bookresponse and validationresponse has the same members.



    Tuesday, September 24, 2013 8:26 AM
  • Hi all,

    i found this page that includes the scheduling error messages. http://msdn.microsoft.com/en-us/library/aa681712.aspx

     Also i cant found these error messages in database but I think crm keeps these messages not in db , somewhere else. Maybe in a class or xml file.

    Ex : you define a restriction for a resource , and your service activity catch these restriction , so validateResp.Result[0].TraceInfo.ErrorInfoList[0].ErrorCode  this gives ErrorCode.ResourceConstraints

    The url above is given ErrorCode.ResourceConstraints corresponds to {resource name} is being scheduled outside their work hours. You can give meaningful messages to end user.



    Tuesday, September 24, 2013 10:41 AM
    • Edited by Adeel Aqdus Tuesday, September 24, 2013 11:19 AM
    • Proposed as answer by Adeel Aqdus Thursday, May 22, 2014 5:29 PM
    • Unproposed as answer by Polat Aydın[MCP] Thursday, June 5, 2014 3:51 PM
    Tuesday, September 24, 2013 11:18 AM