Access Microsoft CRM Imports using SDK - dynamics-crm-2011

How can I access information about Imports (which you can access via Workplace => Imports, see picture), using SDK? Partucularly I'm interested in a list of errors associated with each Import entry. Even a hint at which classes I should look/check would also be great.

The main entity is ImportFile, you can check the structure here:
MSDN - ImportFile Entity Metadata
you can check the fields totalcount successcount failurecount partialfailurecount
the errors are inside the entity ImportLog, you can check the structure here:
MSDN - ImportLog Entity Metadata
you can check the fields importfileid (the lookup that contains the relationship with importfile) linenumber errornumber

Related

Getting data type of attributes of Account in Quickbook Online

How can i describe an Quickbook Online object like Account so that i can know what data type each attributes of the Account takes? Using Query or any library that helps to do that. (API Explorer is not a preferable solution for my use case)
The place to get this data is from the .XSD files that Intuit produces. The .XSDs give you information like:
what fields each object has
the lengths of the fields
which fields are required/optional
the types of the fields
etc. etc. etc.
You can get the .XSDs here:
https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/minor-versions

soapClient.GetList does not return CustomFields, created in Acumatica I300 course

Acumatica course I190 shows how to create custom fields. I followed the tutorial and created two custom fields for Stock Items.
Acumatica course I300 has an example of exporting StockItems, procedure RetrievalOfDelta.
However, call soapClient.GetList(stockItemsToBeFound) does not return the CustomFields, even though I changed ReturnBehavior = ReturnBehavior.All, and can see values of all other fields.
How to include the CustomFields to be returned by GetList?
Thank you.
For guidelines on broad general topics like API Custom Fields refer to documentation.
You need to extend the default endpoint and extend the entity (stock item).
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=c450492e-06fe-4563-95c3-efa76975415b
Use populate action to add custom fields to the extended entity.
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=bd0d8a36-b00b-44c8-bdcd-b2b4e4c86fd0

Adding the SQL Designer Table and Column Description as the class and property descriptions in Entity Framework 5

I would like to do the same as described in this post:
Entity Framework 4.1 dynamically retrieve summary for scalar properties from database table column description
I noticed that the user stated that he is using Entity Framework 4.1.
Can anyone confirm whether this feature is part of Entity Framework 5 or 6?
If not, do anybody know of someone that might have added this feature in EF 6, since it is open source now?
Summary
I have added descriptions to the columns and tables in MS SQL Designer. Instead of having to retype these as xml comments for my classes and properties in the generated Entity Framework classes, I would like to have these xml comments generated from the SQL descriptions.
Would something like this not be possible with a T4 template?
My Entity Framework knowledge is very lacking, so if someone can even just point me in the right direction, I am willing to figure this out on my own.
Any advice would be greatly appreciated!
Okay, I have figured out an alternative way.
It's not the answer to the original question, but it will work just as well.
What I have done was entered all the Descriptions from my MS SQL database into the Entity Models Documentation.Summary and Documentation.Long Description.
Then I looked at some code from these two posts:
Example1
Example2
and altered it slightly to work like this:
In the "YourEFModelName".tt file (NOT "YourEFModelName".Context.tt),
I looked for this line:
<#=codeStringGenerator.EntityClassOpening(entity)#>
to find the class header.
Then I added this right in front of it:
<#if (!ReferenceEquals(entity.Documentation, null))
{
#>
/// <summary>
/// <#=entity.Documentation.Summary#>
<#if (!ReferenceEquals(entity.Documentation.LongDescription, null) && !ReferenceEquals(entity.Documentation.LongDescription, ""))
{
#>
/// <#=entity.Documentation.LongDescription#>
<#}#>
/// </summary>
<#}#>
Note that the argument to the "EntityClassOpening" method is "entity", as used in the code you insert into the tt file.
You can use this code for the properties also. To find the properties, just look a bit lower down in the code for this line:
<#=codeStringGenerator.Property(edmProperty)#>
It will generate all your class properties. You can alter the code we used for the class comments to have "edmProperty" (the parameter to the "Property" method in the previous line) instead of "entity".
Then do the same for the Complex Properties and Navigation Properties found just below the edmProperties.
Once I added all my comments into the Entity Framework model and made these changes to the tt file, I right clicked the tt file and chose "run custom tool".
All my generated classes had xml comments with the descriptions I entered in the documentation property of all the classes and properties in my model.
My thanx goes to the people that contributed to the two example threads!

How to find unused/non-dependent fields of any entity in CRM 2011?

I am trying to identify unused or non-dependent fields of any entity in Microsoft Dynamics CRM 2011. By unused or non-dependent i mean the field that is not used in any of the entity forms.
I have googled to find on the same topic but couldn't get the desired results. One link that i have come across also doesn't address this problem:
Finding unused CRM fields
First I should note that just checking if a field is not on a form does not mean it is not being used somewhere. There is a chance if you have a third party integration, or other logic running on an entity that it could be updating hidden fields. If you're unsure if there is data stored for an attribute you can do a retrieve request where your condition is that the attribute is not null. If nothing comes back then there is no data stored for that attribute.
Assuming that is already clear, what you'd want to do is utilize Dynamics CRM's Dependency Tracking to check for dependencies of individual attributes.
Here's the full article on Dependency Tracking for CRM 2011: http://msdn.microsoft.com/en-us/library/gg309749.aspx
The request that sounds most like what you're looking for is the RetrieveDependentComponentsRequest. This request seems to be the closest match according to what you're looking for and per the documentation:
Returns a list of dependencies for solution components that directly depend on a solution component.
For example, when you use this message for a global option set solution component, dependency records for solution components representing any option set attributes that reference the global option set solution component are returned.
When you use this message for the solution component record for the account entity, dependency records for all of the solution components representing attributes, views, and forms used for that entity are returned.
The basic steps to accomplish what you're looking for would then be:
Execute a RetrieveEntityRequest to retrieve all the attributes for a particular entity
For each attribute in the response, execute a RetreiveDependentComponentsRequest where you set the ObjectId to the MetadataId of the attribute, and the ComponentType to be 2 (attribute).
Parse the EntityCollection property on the response to see if any of the dependencies have a ComponentType of 24 (form).

Sharepoint 2010 - Managed KeyWords

Is it possible to import managed keywords into SharePoint 2010?
Where are the keywords stored within which database?
Background -
I'm currently working on a migration from a legacy system into SharePoint 2010. So far everything is going well, and I can even bring across the managed meta data across along with most other data.
The process I use was built for SharePoint 2007 to update Lists over SOAP. With a few manual tweaks I've managed to get the metadata to come across.
To bring across either managed metadata or managed keywords I need to know the ID for the existing label/keyword. I have this for the Managed Metadata however not for the Managed Keyword.
Currently I create a CSV file to be imported for managed metadata before working out the reverent GUID for the source label.
Many Thanks
Luke
Yes, you can import managed terms (keywords aren't managed) into SP2010. The OOTB Managed Metadata service app can import a CSV file... also has a sample. Importing via the API is very easy as well. The following shows how to get reference to the term store and start adding terms. To add terms, look at the Term object.
// get refrerence to the taxonomy term store
TaxonomySession taxonomySession = new TaxonomySession(siteCollection);
// get reference to first term store (can also get by name)
TermStore termStore = taxonomySession.TermStores[0];
string termGroupName = "Locations";
Group termGroup = termStore.Groups.Where(x => x.Name == termGroupName).Count() > 0 ?
termStore.Groups[termGroupName] :
termStore.CreateGroup(termGroupName);
string termSetName = "United States Geography";
TermSet termSet = termGroup.TermSets.Where(x => x.Name == termSetName).Count() > 0 ?
termGroup.TermSets[termSetName] :
termGroup.CreateTermSet(termSetName);
Term newTerm = termSet.CreateTerm("Level 1",1033);
newTerm.CreateTerm("Level 1a",1033);
termStore.CommitAll();
Don't concern yourself with the DB. Read/write ops directly on the DBs are not supported. There's a VERY robust taxonomy API (M.SharePoint.Taxonomy.dll) available.

Resources