Item field constraint based on children field values - mks

I would like to create a constraint on an item based on the linked child items.
I have an item called "Project" that will have child items of "Task". Both of these items types have a state field and the same values like, "In Progress", "Ready For Review", "Complete", etc.
What I want to do is keep the user from changing the "Project"/parent item state to the next state if all the "Task"/child items are not in the right or same state. Once all the tasks are set to the right state I would like to allow the project item state to advanced. So, is this possible, and if so could someone point me to the right docs?
Visual example:
(T1)
Project State:In Progress
Children:
Task 1 State:In Progress
Task 2 State:In Progress
(T2) - Note that at this time the user would not be able to change the project state to the next state because all the tasks are not completed.
Project State:In Progress
Children:
Task 1 State:Ready For Review
Task 2 State:In Progress
(T3)
Project State:In Progress
Children:
Task 1 State:Completed
Task 2 State:Ready For Review
(T4) - Now the user can move the Project item state to Completed because all the children are in the correct state.
Project State:In Progress
Children:
Task 1 State:Completed
Task 2 State:Completed
(T5)
Project State:Completed
Children:
Task 1 State:Completed
Task 2 State:Completed

as far as i know this is not possible through constraint,you may need custom rule based trigger for this functionality.
The event for the trigger will be like
(type = project And state !=state[old value] And state[old value]=In Progress And state[new value]=Completed )
What this trigger will do?
It will checks the state of all child tasks and if any of the child task is not completed it will pop up message saying
"All the child task should be completed before moving project to completed state"

Related

Azure Backlog Tab Events

How to create the drag and drop event listener for the work item reparent action in a custom extension for the Backlog Tab (same as observers on the work item form)?
Contribution type ms.vss-work-web.work-item-notification does not work on this tab

Hierarchical menu with Contentful

Contentful has a notion of "Links" which can be to many objects or one. However I can't find a way to model the reverse relationship without doubling the work (i.e. specify the children AND parent of each object).
I would like to use Contentful to power a simple navigation like so:
Menu Item 1
Sub menu item 1
Sub menu item 2
Sub menu item 3
Menu Item 2
Sub menu item 4
Sub menu item 5
Sub menu item 6
-- Sub sub menu item 1
Where the links might look like /<parent.slug>/<child.slug>/<child.slug>/
I could find the page entry to render by traversing up the parent relationships to ensure I get a page with a slug, and a parent with a specific slug.
However, It's hard to render out child menu items without resorting to multiple API calls unless you include a "children" field in the object - which is prone to error and inconsistency.
Yes we had this same issue. We have a Page model, with a refLink called 'parentPage'. Our middleware makes 1 call to CF to get ALL pages and builds a site tree model in memory.
From this model we have methods to get children, and get URL slug.
If your items only has a child relationship you can leverage the includes concept. Simply fetch the furthest down child item and set the includes parameter to a high enough value (10 is max) and Contentfuls API will include all referenced content in a single API call.
You can read more about includes here: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/links

Continue execution of parent Dialog in Dynamics CRM

I have a Dialog in which I've linked a child Dialog. I want to the execution of the Dialog to the parent dialog once my child dialog has completed executing.
How can I achieve this? My child dialog isn't throwing the execution back to the parent Dialog in Dynamics CRM.
That's not how they work out of the box. When you go to a child you transfer control to child and the parent ends.
You could look to rearrange your dialog;so the last step of the child, is to start the parent as a child dialog. The parent dialog would then need to somehow skip to the right page. Or it might be easier to break the parent dialog into multiple parts, which are chained together using start child.

Cannot change the published state when the parent item is of a lesser state

In Joomla 3.1, I tried to change the published state of an item, but had an error:
Cannot change the published state when the parent item is of a lesser state.
But my item doesn't have a parent, so why am I getting this error?
Make sure your column for state (published, unpublished, trashed...) is "published".
See https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/table/table.php#L1538

How to open an activity instantly and then loading its layout

Here's the deal: I have a heavy layout that cannot be improved any further, as it contains LinearLayouts with weights (so I cannot use RelativeLayouts).
In Activity A, I click on a list item that fires off Activity B. Activity A freezes until Activity B is fully loaded, then Activity B gets shown. So this is the complete queue of events:
Activity A: open B
Activity A: freezes
Activity B: finishes inflation/setContentView
Activity A: goes back into the application stack
Activity B: gets shown
How can I immediately show Activity B so that Activity A won't freeze?
I thought about inflating a temporary layout in B, but I need a callback method that tells me that B is fully visible and I can then replace the temporary layout with the real one.
Can anyone help me?
Thank you!
Off topic: layout inflation in Android is a real pain, it shouldn't block the whole UI, but it does. Same thing for setting list adapters.
You should do your time taking task of Activity B in thread and if you need to update the UI after your task completes then do it using handler.
You can do your time consuming loading using AsyncTask .You can use
doInBackgroundMethod to load the data
onProgressUpdate you can bind your layout to data.
If you works this way your Activity will not be frozen

Resources