Deploying standard picklists via Metadata API - deployment

Have some trouble deploying leadSource and Industry picklists via Metadata API. Had to comment out both of them from the build. It may have something to do with these picklists being shared by multiple objects, I don't know. We are using Jenkins for the deployment. Here is a sample deployment error:
Error: objects/Lead.object(1150,13):An unexpected error occurred. Please include this ErrorId if you contact support: 1967816892-11483 (1554758315)

OK, we figured it out by trial and error, didn't see it documented anywhere.
There are some standard picklists that are shared by multiple objects: "Lead Source", "Account Source", and "Industry".
For example, "Lead Source" field is on Contact, CampaignMember, Lead, Opportunity, and Account. Although on Account it's named differently ("Account Source"), the picklist values are shared by all of these objects. To deploy this picklist, we need to make sure that we only list it on one of these objects, and comment it out from the others, otherwise we get a build error.
Currently our build is set up as follows:
1) "Lead Source" field is deployed via "Account Source" field on the Account object, from where the picklist values are copied by Salesforce automatically to four other objects.
2) Industry field is deployed via Account object. It is commented out on the Lead object. From Account, SF automatically makes these picklist values available on the Lead.

Related

how to copy a dashboard in a different azure devops instance?

I have a requirement to copy an existing dashboard dashboard in an org(source org) to a different org(target org) under a different ado instance by any means possible. Dashboard can have widgets and widgets can be linked to
pipeline
Query - A query can be referencing to a user, team, project, custom values of a standard field, custom fields
some other things that i have not encountered so far
So far my steps are as follows
get dashboard details using get dashboard rest api
identify widgets in dashboard details api response
get any pipeline if there is no pipeline create a dummy one and use its details for a widget that is using pipeline
identify distinct queries present in all widgets
create its equivalent query in target org and save its id
replace queryid in widget settings to its equivalent created queryid in targetorg
create dashboard in target org
I am facing issue in step 5
There are lot of moving variables in a query. Query might be referencing to things that does not exist in target org like a particular user, team, custom values of a standard field, custom fields. In order to create a query successfully i need to know possible values of a field in target org. While creating a new query from ui it shows possible values for a field in dropdown so i am wondering is there any rest api that gives possible values of a field and if no such field exist in target org then it should throw error.
Looking forward to suggestions for a simpler or alternative approach to replicate a dashboard across different ado instance and/or better approach for step 5
If you are looking for a rest api the query the fields in your target process of the organization, you could refer to this doc. Field-list.
GET https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/fields?api-version=6.0-preview.2
After that, you could create the fields in your target process, you could refer to this rest api. Fields-Create
POST https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/fields?api-version=4.1-preview.1
Or could you share more details of your requirement, like screenshots and widget definition or dashboards configuration for update.

Skip field validation when creating a record using Dynamics 365 web api

I am integrating Dynamics 365 with our product, and I am running into an issue when creating fields on dynamics 365 using web api.
I am creating a contact or lead using a set of fields such as email, name etc. Some fields seem to have validation, such as number only field, or picklist. In these cases I am getting an error with 400 status and the record is not created. Is there a way to just create the record using the valid fields and just skip updating the fields that failed validation.
This is the end point I am using for creating a contact:
/api/data/v9.1/contacts
Headers used:
Prefer:return=representation
Content-Type:application/json
OData-MaxVersion:4.0
OData-Version:4.0
If-None-Match:null
You have two options:
Either do the proper validation when user entering values for those fields from outside Dynamics.
Or create custom fields in Dynamics contact entity to store the string type values
Web api payload has to be whole and cannot be truncated/set for adhoc scenarios like skip failing datatypes (your requirement).
Hope this helps. No matter what software or environment you are integrating with, it is important to know your data structure including data types, data validations (including required yes/no) and data constraints (length, decimal places, etc.).
There are three ways you can integrate with Dynamics 365 factoring in the above.
1. Static code based on the Dynamics 365 configuration
If you can login to Dynamics 365, you can view the environment definition by going to Settings > Customizations > Customize the System.
From here you can view all Entity and Attribute definitions and and write your code accordingly. You can also "require" installation of your own solution with Entities and Attributes, giving you control over what your integrating with.
2. Creating Early-Bound classes
You can generate Early Bound classes with the Entity and Attribute definition from Dynamics 365 with the CrmSvcUtil tool. For more information.
For more information:
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/org-service/create-early-bound-entity-classes-code-generation-tool
3. Dynamics 365 Metadata service
Dynamics 365 provides a Metadata service, enabling you to retrieve the exact definition of alle Entities and Attributes directly from the given Dynamics 365 environment. As such you can retrieve the definition prior to integrating.
I think considering the performance, this is definitly not something you would like to do every single message. To resolve this you could retrieve the definition on request (manual trigger) or daily.
For more information: https://learn.microsoft.com/en-us/dynamics365/customer-engagement/customize/create-edit-metadata
When working with Dynamics 365, the XRMToolBox is a must have tool for any developer or consultant. With the tools Metadata Browser plugin you can view the data that you can retrieve by the Metadata service.

Which field describes reporter of a Salesforce Case

AS in every ticket we create normally programmatically, we do have a reporter and assignee of ticket. But in sales-force API documentation I could not find any field which describes Reporter of Case.
Also, there is no field to specify project Id against which we can create a case.
Is this the limitation of the Salesforce ITSM services or am I missing something.
Reference link
https://developer.salesforce.com/docs/api-explorer/sobject/Case
A case is normally associated with an Account (AccountID) record and a Contact (ContactId) record. Those record indicate the "reporter" of your case.

How to get a Task's "Unique ID" from a Project Web App via REST?

I'm a fairly experienced SharePoint developer, but brand new to MS Project and Project Server / PWA.
In MS Project Pro, there is a column called "Unique ID" that seems to function like SharePoint's built-in list item "ID" field - an auto-incrementing integer (1 based).
How can I find a task's "Unique ID" from a project that has been saved and published to a Project Web App through Project Server's REST API?
The only "ID" on a Task object retrieved through
https://servername/pwa/_api/projectserver/projects('project-id')/tasks('task-id')
is a GUID, there doesn't seem to be any property associated with an integer ID.
I found this other question and answer over on the MSDN help site. It is about Project Server 2010, and about how to show the "Unique ID" field in a report. But the answer says (emphasis mine):
There are three ID fields in the MSP_EpmTask_UserView; TaskUID,
TaskIndex and TaskClientUniqueId. TaskUID is a GUID, TaskIndex
corresponds to the Task positional ID and TaskClientUniqueId
corresponds to the Unique Id field in Project Professional.
So it appears that this information is stored somewhere within Project Server, but... how do I get it through REST?
{PWA Site URL}/_api/ProjectData/Projects(guid'{project guid}')/Tasks()?$Select=TaskName,TaskId,TaskIndex,TaskClientUniqueId
Well, although the other answer here is correct, some explanation might be in order.
Project Server has two different REST endpoints, and they do not return the same data.
There is
<PWA site URL>/_api/ProjectServer/
and
<PWA site URL>/_api/ProjectData/
There is quite a bit of overlap in the data they return, but there are some fields that can only be retrieved through the ProjectServer endpoint, and there are some fields that can only be retrieved through the ProjectData endpoint.
As it turns out, TaskClientUniqueId can only be retrieved from the /_api/ProjectData/ endpoint.

How to import users in CRM 2011 with source GUID

We have three Organization tenents, Dev, Test and Live. All hosted on premise (CRM 2011. [5.0.9690.4376] [DB 5.0.9690.4376]).
Because the way dialogs uses GUIDs to refference record in Lookup, we aim to maintain GUIDs for static records same across all three tenents.
While all other entities are working fine, I am failing to import USERS and also maintain their GUIDS. I am using Export/Import to get the data from Master tenent (Dev) in to the Test and Live tenents. It is very similar to what 'configuration migration tool' does in CRM 2013.
Issue I am facing is that in all other entities I can see the Guid field and hence I map it during the import wizard but no such field shows up in SystemUser entity while running import wizards. For example, with Account, I will export a Account, amend CSV file and import it in the target tenant. When I do this, I map AccountId (from target) to the Account of source and as a result this account's AccountId will be same both in source and target.
At this point, I am about to give up trying but that will cause all dialogs that uses User lookup will fail.
Thank you for your help,
Try following steps. I would strongly recommend to try this on a old out of use tenant before trying it on live system. I am not sure if this is supported by MS but it works for me. (Another thing, you will have to manually assign BU and Roles following import)
Create advance find. Include all required fields for the SystemUser record. Add criteria that selects list of users you would like to move across.
Export
Save file as CSV (this will show the first few hidden columns in excel)
Rename the Primary Key field (in this case User) and remove all other fields with Do Not Modify.
Import file and map this User column (with GUID) to the User from CRM
Import file and check GUIDs in both tenants.
Good luck.
My only suggestion is that you could try to write a small console application that connects to both your source and destination organisations.
Using that you can duplicate the user records from the source to the destination preserving the IDs in the process
I can't say 100% it'll work but I can't immediately think of a reason why it wouldn't. This is assuming all of the users you're copying over don't already existing in your target environments
I prefer to resolve these issues by creating custom workflow activities. For example; you could create a custom workflow activity that returns a user record by an input domain name as a string.
This means your dialogs contain only shared configuration values, e.g. mydomain\james.wood which are used to dynamically find the record you need. Your dialog is then linked to a specific record, but without having the encode the source guid.