CRM 2011: Custom Workflow Activity and Date Time RRS feed

  • Question

  • Hi All,

    I am setting date after substracting business days. the date in the Code is fine in the custom work flow activity but the record getting created with the workflow is showing time in UI quite ahead. How to fix this?

    I have got a solution - but not feeling confident about it.

    Solution is, When passing date to function pass as date.ToLocationTime() - because this date is comeing in UTC form from CRM DB. and when passing back to OurArgument convert it back to date.ToUniverselTime().

    Please share the thougths.

    I think if the user in different time zone but server is in different, this can cause bug?



    • Edited by Hassanz Friday, November 8, 2013 1:31 AM
    Friday, November 8, 2013 1:10 AM

All replies

  • Have you tried the manipulation library. You can use the 'Subtract business days from Date'. Saves from writing custom code and testing the boundaries.


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    Friday, November 8, 2013 1:49 AM
  • I am using it.

    Problem during testing i noticed that if I pass starting date '07/06/2014' with 10 business days to substract. It returns 23/05/2014 which is not right it should 26/05/2014.

    That is why I am going through all this.



    Friday, November 8, 2013 1:53 AM