I have created a report in dynamics 365 crm using out of the box report wizard present in crm. The report is cases that are active, resolved or canceled. The report shows case resolution field. However when a resolved case is reactivated and then resolved again then it shows 2 entries for that case in the report. Is there any way possible to show only the latest case resolution in the report?
You get Repeat/twice and may be more Record for a case Reason been Case Resoultion is an Entity in Dynamics and everytime you Resolve a case, Note only Resolve a case you will have a record created for this entity.
So if you resolve and reopen and resolve like 10 times you will see entry 10 times into your report.
Now as we have a Background why we get repeat records, how to resolve it?
I belive you are aware of D365 fetchxml Reports with reporting Extensions. If not few links below.
SSRS Report Tutorial
You have option to edit your report in Visual studio w.r.t Report.
In your report you will have Fetchxml, It should be something like below. Important is created on should be ordered as Desc and fetchxml should be distinct.
Fetchxml as you have probably and it's result
<fetch>
<entity name="incident" >
<attribute name="statuscode" />
<attribute name="title" />
<attribute name="statecode" />
<link-entity name="incidentresolution" from="incidentid" to="incidentid" link-type="outer" alias="Resolution" >
<attribute name="subject" alias="ResolutionSubject" />
<attribute name="createdon" alias="Resolutioncreatedon" />
<order attribute="createdon" descending="true" />
</link-entity>
</entity>
</fetch>
Fetchxml you need
<fetch distinct="true" mapping="logical" >
<entity name="incident" >
<attribute name="statuscode" />
<attribute name="title" />
<attribute name="statecode" />
<attribute name="incidentid" alias="Id" />
<link-entity name="incidentresolution" from="incidentid" to="incidentid" link-type="outer" alias="Resolution" >
<attribute name="subject" />
<attribute name="activityid" />
</link-entity>
</entity>
</fetch>
Now Inside Visual studio you need to hide Row based on your Incident Id, Created on date from resolution.
Related
I created the following report:
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.6.0.v201606072122</property>
<simple-property-list name="includeResource">
<value>Resources</value>
</simple-property-list>
<property name="units">in</property>
<method name="beforeFactory"><!
[CDATA[reportContext.getDesignHandle().setStringProperty("locale",
params["__locale"].value);]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<parameters>
<scalar-parameter name="__locale" id="8">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="distinct">true</property>
<list-property name="selectionList"/>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<label id="7">
<text-property name="text" key="offerte.offerte"></text-property>
</label>
<label id="9">
<text-property name="text" key="offerte.klant"></text-property>
</label>
</body>
It works great, but now I want to use a datasource instead of the properties file. Anyone know where to start?
A properties file is the "standard" way to support internationalization in BIRT, but you can do it any way you like.
For example, in our application we are using a SQL database. All the translations are storend in tables. The output language is specified as a report parameter. Each and every translation is done on this basis.
For example, we are never using labels. Instead, we use dynamic text items (with plain text or html depending on the circumstances.
A little javascript function pr(x) returns the translation for a text x.
We do all the date and number formatting with SQL if possible (I don't know if it is possible to change the "format date" and "format number" properties dynamically - this might work as well).
I would like to get rid of the Social Pane on Dynamics 365, by replacing it with a Subgrid on the account form which would list the activities of the account and the activities of the account's contacts. We are currently using the "parentcustomerid" lookup to associate a contact to an account which is not hierarchical. I cannot find a solution with FetchXML to get what I want. The following FetchXML would work if there was a hierarchical relation:
<fetch>
<entity name="activitypointer" >
<attribute name="activityid" />
<attribute name="regardingobjectid" />
<attribute name="subject" />
<attribute name="regardingobjecttypecode" />
<filter type="and" >
<condition attribute="isregularactivity" operator="eq" value="1" />
<filter type="or" >
<condition entityname="accountparty" attribute="accountid" operator="eq-or-under" value="5D8E9289-7F86-E811-910D-0050568B95ED" />
<condition entityname="contactparty" attribute="contactid" operator="eq-or-under" value="5D8E9289-7F86-E811-910D-0050568B95ED" />
</filter>
</filter>
<link-entity name="activityparty" from="activityid" to="activityid" link-type="outer" alias="activityparty" >
<link-entity name="account" from="accountid" to="partyid" link-type="outer" alias="accountparty" />
<link-entity name="contact" from="contactid" to="partyid" link-type="outer" alias="contactparty" >
<link-entity name="account" from="accountid" to="parentcustomerid" link-type="outer" alias="contactaccount" />
</link-entity>
</link-entity>
The goal is to have a plugin that catches the query in pre-operation in order to add the conditions and filters needed.
You could solve this by linking the activities related to contacts directly to their parent account, with a custom lookup in the activity entity and probably a Retrieve/RetrieveMultiple plugin to automagically fill it based on if the regardingobjectid is a contact.
Done that, you only need to refer to that field in the grid.
We used a similar approach to make a "rollup of rollups" spanning more than 1 relationship.
This kind of rollup is easy to achieve with custom HTML webresource with bootstrap & our own js libraries to handle web api calls/fetchxml queries. We are doing this today.
As we cannot do UNION in fetchxml, we may have to merge couple of resultsets, so we can use jQuery datatables to merge/visualize the results.
Also this approach is easy to amend, debug rather intercepting server calls for custom fetchxml queries.
As you are have concluded already, the core to solve this is to use the UnderOrEqual condition with the query.
This feature may be difficult (afaik it is impossible) to implement in the way you want to by using the View Designer. So you need to add some code to make this happen.
While the approach to create custom webresources and use a custom grid might be easier to debug, it will require quite a lot of custom code and controls.
Another approach would be to add a standard subgrid with an "Associated View" for activities related to the parent account to the form, then add a pre RetrieveMultiple plugin that identifies the query and then tweaks the query to work for your needs.
You are then using standard controls and features, that will be upgradeable and still follow possible design changes from Microsoft etc.
To see a fully working ready to use solution, the following article describes this pattern in detail:
https://jonasrapp.net/2016/05/hierarchy-activities/
I would like to add a custom command to the context menu of each node that appears for every table in a sql server database listed in the Server Explorer.
I've gone through a basic tutorial and added a command to the tools menu bar as well as a custom top level menu.
I've also seen the tutorial Extending the Server Explorer to Display Web Parts which is very close to what I want to do, but it is specific to the sharepoint connections node, and uses the sharepoint specific IExplorerNodeTypeExtension interfaces. I'm having trouble finding any documentation pertaining to the data connections node. Can anyone provide any references to relevant documentation or information on what interfaces I should be leveraging?
With some hints from Jack Zhai and a few other web resources I was able to track down information.
Stack Overflow - Context menu for Server Explorer
MSDN blog - How to add custom menu to vs editor window
MSDN Blog - Using EnableVSIPLogging to identify menus and commands with VS 2005
So first, I enabled VSIPLogging by setting the EnableVSIPLogging to 1 in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio###\General
Then I was able to determine what the guids and ids of any menu item or tree node in Visual Studio by holding down CTRL + SHIFT and right clicking on it.
From this I was able to determine that the top level nodes in the server explorer had a Guid of {74D21310-2AEE-11D1-8BFB-00A0C90F26F7} with a command id of 1283.
Object nodes in the server explorer (such as Tables, stored procedures, etc) have a Guid of {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} and a command id of 33280 (0x8200)
Object node parents in the server explorer (such as the static "Tables", "Stored procedures", nodes that categorize the object nodes) have a guid of {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} and a command id of 33024 (0x8100)
So with these Guids I can now attach my commands where I want.
I want a command that is specific to an individual table, and a command that is specific to all tables in the database so I will use a d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2 with command id of 0x8200 and a Guid of d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2 with command id of 0x8100.
Next I need to define these values in my vsct file of my VSIX project so I add them to the symbols section:
I add 2 command items to my project and then I need to change the parent of the groups so they appear on the correct area in the server explorer:
Now, the database command does appear for all static object nodes, even though I want it to only appear on the "Tables" node, and the table command appears for all object nodes and their, even though I want it to appear only for the table node itself. I believe that needs to be solved in code somehow, dynamically determining the visibility of the command menu item, but I'll have to figure that one one separately.
Below is the vsct in its entirety:
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This is the file that defines the actual layout and type of the commands.
It is divided in different sections (e.g. command definition, command
placement, ...), with each defining a specific set of properties.
See the comment before each section for more details about how to
use it. -->
<!-- The VSCT compiler (the tool that translates this file into the binary
format that VisualStudio will consume) has the ability to run a preprocessor
on the vsct file; this preprocessor is (usually) the C++ preprocessor, so
it is possible to define includes and macros with the same syntax used
in C++ files. Using this ability of the compiler here, we include some files
defining some of the constants that we will use inside the file. -->
<!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
<Extern href="stdidcmd.h" />
<!--This header contains the command ids for the menus provided by the shell. -->
<Extern href="vsshlids.h" />
<!--The Commands section is where commands, menus, and menu groups are defined.
This section uses a Guid to identify the package that provides the command defined inside it. -->
<Commands package="guidCRUDSPCommandsPackage">
<!-- Inside this section we have different sub-sections: one for the menus, another
for the menu groups, one for the buttons (the actual commands), one for the combos
and the last one for the bitmaps used. Each element is identified by a command id that
is a unique pair of guid and numeric identifier; the guid part of the identifier is usually
called "command set" and is used to group different command inside a logically related
group; your package should define its own command set in order to avoid collisions
with command ids defined by other packages. -->
<!-- In this section you can define new menu groups. A menu group is a container for
other menus or buttons (commands); from a visual point of view you can see the
group as the part of a menu contained between two lines. The parent of a group
must be a menu. -->
<Groups>
<!-- Table scope -->
<Group guid="guidCRUDSPCommandsPackageCmdSet1" id="TableMenuGroup" priority="0x0600">
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS" />-->
<Parent guid="guidServerExplorerObjectNode" id="IDMX_DV_OBJECT_NODE" />
</Group>
<!-- Database scope -->
<Group guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" priority="0x0600">
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS" />-->
<Parent guid="guidServerExplorerObjectNode" id="IDMX_DV_STATIC_NODE" />
</Group>
</Groups>
<!--Buttons section. -->
<!--This section defines the elements the user can interact with, like a menu command or a button
or combo box in a toolbar. -->
<Buttons>
<!--To define a menu group you have to specify its ID, the parent menu and its display priority.
The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use
the CommandFlag node.
You can add more than one CommandFlag node e.g.:
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
If you do not want an image next to your command, remove the Icon node /> -->
<Button guid="guidCRUDSPCommandsPackageCmdSet1" id="cmdidCmdTable" priority="0x0100" type="Button">
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="TableMenuGroup" />
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<ButtonText>Command for Table</ButtonText>
</Strings>
</Button>
<Button guid="guidCRUDSPCommandsPackageCmdSet1" id="cmdidCmdDatabase" priority="0x0100" type="Button">
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" />
<Icon guid="guidImages1" id="bmpPic1" />
<Strings>
<ButtonText>Command for Database</ButtonText>
</Strings>
</Button>
</Buttons>
<!--The bitmaps section is used to define the bitmaps that are used for the commands.-->
<Bitmaps>
<!-- The bitmap id is defined in a way that is a little bit different from the others:
the declaration starts with a guid for the bitmap strip, then there is the resource id of the
bitmap strip containing the bitmaps and then there are the numeric ids of the elements used
inside a button definition. An important aspect of this declaration is that the element id
must be the actual index (1-based) of the bitmap inside the bitmap strip. -->
<Bitmap guid="guidImages" href="Resources\CmdTable.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
<Bitmap guid="guidImages1" href="Resources\CmdDatabase.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
</Bitmaps>
</Commands>
<Symbols>
<!-- {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} is the object node in the server explorer -->
<GuidSymbol name="guidServerExplorerObjectNode" value="{d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2}">
<!--server explorer - table-->
<IDSymbol name="IDMX_DV_OBJECT_NODE" value="0x8200" />
<IDSymbol name="IDMX_DV_STATIC_NODE" value="0x8100" />
</GuidSymbol>
<!-- {74D21310-2AEE-11D1-8BFB-00A0C90F26F7} is the server explorer -->
<GuidSymbol name="guidServerExplorer" value="{74D21310-2AEE-11D1-8BFB-00A0C90F26F7}">
<!--server explorer - table-->
<IDSymbol name="IDMX_DV_SERVER_NODE" value="0x503" />
</GuidSymbol>
<!-- This is the package guid. -->
<GuidSymbol name="guidCRUDSPCommandsPackage" value="{a71670bc-ef23-40a3-b8a0-ed872b79476c}" />
<!-- Constants-->
<GuidSymbol value="{946311de-35f2-4379-84e2-91867976faf8}" name="guidCRUDSPCommandsPackageCmdSet1">
<IDSymbol value="256" name="cmdidCmdTable" />
<IDSymbol value="257" name="cmdidCmdDatabase" />
<IDSymbol value="258" name="TableMenuGroup" />
<IDSymbol value="259" name="DatabaseMenuGroup" />
</GuidSymbol>
<GuidSymbol value="{679ecb35-41d9-4021-933b-ec6b25afc100}" name="guidImages">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
<GuidSymbol value="{9392ca3d-3400-4b7a-a691-7108032249cd}" name="guidImages1">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
</Symbols>
</CommandTable>
I'm getting the following error when trying to change a custom work item's state through Visual Studio:
The field 'Assigned To' contains the value 'Seth Denburg <Project\SDenburg>' that is not in the list of supported values.
During the state transition the value from another field is copied to the System.AssignedTo field. This error stopping me from resolving a related work item during my check in through Visual Studio.
I've noticed the following alternatives allow me to successfully change the state which could help point to what the issue is:
Changing the work item's state in the web interface. No errors are displayed here.
Reentering the user's name in the field being copied from before the transition in Visual Studio.
Reentering the user's name in the System.AssignedTo field after the transition in Visual Studio.
Here is a subset of states, transitions, and fields from the custom work item type definition that I think are related to this issue:
<FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
<ALLOWEXISTINGVALUE />
<VALIDUSER group="Project\Users" />
</FIELD>
<FIELD name="Lead" refname="Project.Tfs.Lead" type="String" reportable="dimension">
<ALLOWEXISTINGVALUE />
<DEFAULT from="value" value="Seth Denburg" />
<REQUIRED />
<VALIDUSER group="Project\TechnicalLeads" />
</FIELD>
<STATE value="Pending">
<FIELDS>
<FIELD refname="System.AssignedTo">
<VALIDUSER />
</FIELD>
</FIELDS>
</STATE>
<TRANSITION from="Active" to="Pending">
<REASONS>
<DEFAULTREASON value="Completed" />
</REASONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="field" field="Project.Tfs.Lead" />
</FIELD>
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.Checkin" />
</ACTIONS>
</TRANSITION>
The issue ended up being that the field Project.Tfs.Lead didn't have syncnamechanges="true". Here is what the field looked like after the change was made:
<FIELD name="Lead" refname="Project.Tfs.Lead" type="String" syncnamechanges="true" reportable="dimension">
<ALLOWEXISTINGVALUE />
<DEFAULT from="value" value="Seth Denburg" />
<REQUIRED />
<VALIDUSER group="Project\TechnicalLeads" />
</FIELD>
When making the change ensure that you use witadmin changefield like the following command because the field needs to be updated across work item type definitions. Importing an xml change won't work and will give you warning TF248017.
witadmin changefield /collection:https://project.com/tfs/projectCollection/ /n:Project.Tfs.Lead /syncnamechanges:true
Here's why this change was necessary from MSDN:
You must manually enable synchronization of any custom work item
fields that you have created in previous releases of Visual Studio
Team Foundation Server and that are used to assign person names that
reference Active Directory. You must enable synchronization for each
field for each team project collection that contains the custom
fields.
https://msdn.microsoft.com/en-us/library/dd286562(v=vs.100).aspx
Have created a test in myside, works well. The code of the custom work item type definition above seems missing a </FIELDS> of TRANSITION part.
Make sure the user Seth Denburg is in both group Project\TechnicalLeads and Project\Users.
You could also create a new team project in TFS2015 and use this custom work item type definition to see if the issue still exists. If not, the issue should related to the upgrade from TFS 2012 to 2015. Make sure you have Configure features after an upgrade.
I read about the new OneNote Cloud API, but I am afraid that it's not what I am looking for.
I search a possibility to manipulate the pen in oneNote. So for example to be able to change the color or the Pen thickness from another program. Also it would be nice to click the "action back" and "Redo" buttons.
Do you knows if there is any possibility to do so? I am an experienced Java and C / C++ programer, but never did anything windows-specific, so this could be the reason why I do not know where I have to look.
Best regards! Any help is appreciated!
The REST API won't help here, there is some mention of support in the wishlist, but it doesn't appear to have a lot of traction.
I'm not 100% sure of your use case, you want to interact with the OneNote UI and change the user's pen setting so the next time they draw something then pen is what you've specified from your app?
If that's the case then the REST api won't help anyway as it's for manipulating content, you want to directly interact with OneNote and change the user's experience?
You could look at the COM API and interact via the Windows desktop version though I can tell you now that the options for UI interaction are pretty minimal (e.g. show a quick filing dialogue, create new note window, dock note window)
You can interact with a user's basic ink content using GetPageContent and from the below example I ripped out of one of my pages it looks pretty simple to change the thickness, but maybe have a play with GetBinaryPageContent and you could alter colour too?
<one:OE author="Darren Beale" authorInitials="DB" lastModifiedBy="Darren Beale" lastModifiedByInitials="DB" creationTime="2014-05-11T07:42:59.000Z" lastModifiedTime="2014-05-11T07:42:59.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{15}{B0}" alignment="left" quickStyleIndex="0">
<one:T><![CDATA[]]></one:T>
</one:OE>
</one:Title>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:17.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{53}{B0}">
<one:Position x="241.4976348876953" y="73.48818969726562" z="4" />
<one:Size width="45.01417922973633" height="157.5212554931641" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{53}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:23.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{63}{B0}">
<one:Position x="209.9763793945312" y="108.7228317260742" z="5" />
<one:Size width="42.77478790283203" height="116.3055114746094" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{63}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:14.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{36}{B0}">
<one:Position x="113.9952697753906" y="124.4834671020508" z="0" />
<one:Size width="3.770078659057617" height="145.5307006835937" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{36}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:15.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{43}{B0}">
<one:Position x="149.9952697753906" y="163.4881896972656" z="2" />
<one:Size width="1.530704498291016" height="102.7842559814453" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{43}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:16.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{48}{B0}">
<one:Position x="176.2440948486328" y="171.0" z="3" />
<one:Size width="51.76062393188476" height="121.5212478637695" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{48}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:26.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{68}{B0}">
<one:Position x="292.492919921875" y="180.7228240966797" z="6" />
<one:Size width="76.50707244873047" height="40.53543090820312" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{68}{B0}" />
</one:InkDrawing>
<one:InkDrawing lastModifiedTime="2014-05-11T07:43:14.000Z" objectID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{38}{B0}">
<one:Position x="98.97164916992187" y="197.2488098144531" z="1" />
<one:Size width="52.55432891845703" height="51.02363204956054" />
<one:CallbackID callbackID="{F8158129-96AB-4D65-80B0-3AF7DE849E62}{38}{B0}" />
</one:InkDrawing>