AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.01.2014, 16:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,487 / 846 (79) +++++++
Регистрация: 28.10.2006
goshoom: Target date not found in work calendar
Источник: http://dev.goshoom.net/en/2014/01/ta...ate-not-found/
==============

“Target date not found in work calendar” was an error that was reported to me by a customer using workflow in AX2009. It was easy to find that it was thrown by WorkflowWorkCalendarDueDateProvider.isWorkingDay() but it was far from obvious why.

I tried to update the calendar in approval time limit, although it didn’t seem to be used in that moment (but it did automatically default to a calendar for a previous year):



This seemed to be the core problem – the calendar contained dates for a single year only and anything outside that year caused an error (because, as the error message correctly said, the target date was not found in work calendar).

Changing the calendar helped a little bit, but the workflow failed with the same error a moment later. I found that the calendar ID was saved in every single workflow step (WorkflowStepTable.Duration):





It seems to me that:
  1. A calendar used in workflow should cover all possible dates (we can add additional dates to the calendar when needed, but we won’t have to ever change the reference to calendar).
  2. If it needs to be changed, the workflow configuration should be dropped and set up again.
  3. But it’s of course possible to update all workflow steps from code:
WorkflowStepTable step;WorkflowConfigDate confDate;str newCalendarId = 'Workflow';;ttsbegin; while select forUpdate step{ confDate = WorkflowConfigDate::create(step.Duration); confDate.parmDailyCalendar(newCalendarId); confDate.parmHourCalendar(newCalendarId); step.Duration = confDate.pack(); step.update();} ttscommit;


Источник: http://dev.goshoom.net/en/2014/01/ta...ate-not-found/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15
Axilicious:Hosting custom WPF calendar control in AX 2012 Blog bot DAX Blogs 0 20.05.2013 18:11
emeadaxsupport: "An exchange rate cannot be found for exchange rate type XXX between currencies YYY and ZZZ on exchange date." when you attempt to process in Microsoft Dynamics AX 2012 Blog bot DAX Blogs 0 26.09.2012 07:15
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
И вновь о вызове хранимой из Аксапты Protey DAX: Программирование 52 04.10.2005 12:35

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 03:02.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.