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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.10.2015, 12:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
workflowax: Determine if a document has an outstanding task.
Источник: https://workflowax.wordpress.com/201...standing-task/
==============

In AX2009 you used to have two different status for assigned Purchase Requisitions in workflow, namely: “Pending Completion” and “Pending Approval”. Unfortunately in AX2012 this has become simply “In Review” to signify it being in workflow. This allows a more flexible approach to the ordering and reuse of elements in workflow. However it does not provide a clear way to distinguish where the Purchase Requisition is currently in the workflow process especially whether or not the item is currently assigned as a task or an approval.

The code below provides the X++ select statement to determine whether a document in workflow has at least one pending Task based workitem linked to it.

public display NoYes isTask(){ WorkflowWorkItemTable workflowWorkItemTable; WorkflowElementTable workflowElementTable; select firstonly ElementId from workflowWorkItemTable where workflowWorkItemTable.RefTableId == this.TableId && workflowWorkItemTable.RefRecId == this.RecId && workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending join ElementId, ElementType from workflowElementTable where workflowElementTable.ElementId == workflowWorkItemTable.ElementId && workflowElementTable.ElementType == WorkflowElementType::Task; return (workflowWorkItemTable.RecId == 0) ? NoYes::No : NoYes::Yes;}Note: If you’re using line level workflows or parallel branches you may not be guaranteed that the result is what you are logically looking for. It will simply return if there is at least one pending task workitem linked.

This post was inspired by forum question: https://community.dynamics.com/ax/f/33/t/161105




Источник: https://workflowax.wordpress.com/201...standing-task/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
workflowax: Determine if a document has an outstanding task. Blog bot DAX Blogs 0 20.05.2015 09:12
atinkerersnotebook: Creating Your Own Document Management System With SharePoint Blog bot DAX Blogs 0 02.10.2013 21:12
workflowax: Assign Workitems based on document field Blog bot DAX Blogs 0 28.11.2012 19:11
workflowax: Workflow Installation and Configuration Document Blog bot DAX Blogs 0 15.07.2010 14:05
dax-lessons: Document Handling in AX - setup and Example Blog bot DAX Blogs 0 27.08.2007 23:00
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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