Articles

retrieve queue item filtered by object

I had to look for that because when reactivating a case i Hade an error that say that multiple queueitem exist.

if you want to retrieve the queue item by case/email/... knowing the guid of the case/email/...

here is the query

{{webapiurl}}/queueitems?$top=3&$filter=_objectid_value eq BA774537-B561-E911-80E7-005056B22A06


after i retrieve the queue item id and i delete it

{{webapiurl}}/queueitems(c7774537-b561-e911-80e7-005056b22a06)


Update Email with web API

when you receive an email and it s wrong resolve because of human or computer
you need to correct it.

For that i set the email activity in draft with dynamics power pane (chrome extention)

and after I apply this in PATCH mode with postMan

{ "statuscode":4,
  "statecode":1,
  "email_activity_parties" :  [
        {
            "partyid_lead@odata.bind" : "/leads(87701058-3C67-E911-80E7-005056B22A06)",
            "participationtypemask" : 1
        },
        {
            "partyid_queue@odata.bind" : "/queues(7A5AC7BE-BE0C-E411-8890-AC162DAC65CC)",
            "participationtypemask" : 2
        }
        ]
}

Quick Create, open created record

The idea is , when you create a record with quick create, to redirect directly on created record. sometime you have a yellow button on the top right but in my case the yeallow button with the link to the new created record did not appear.
then I decide to redirect with JS

then yes we have function in a function

function MyBaseFunction()

 Xrm.Utility.openQuickCreate("incident", recordId, parameters).then

function (lookup)
{
successCallback(lookup);
},
function (error)
{
errorCallback(error);
}
 );


    function successCallback(lookup) {
        setTimeout(function () { Xrm.Page.data.entity.refresh(); }, 1000);
        Xrm.Utility.openEntityForm("incident", lookup.savedEntityReference.id, null, null);
        setTimeout(function () { Xrm.Page.data.entity.refresh(); }, 1000);
    }

    // **** Function called on error.
    function errorCallback(e) {  // *** No new contact created, which is an error we can ignore!
        alert("Error: " + e.errorCode + "…

Make CRM Faster

it s quite the same logic as here

https://www.linkedin.com/pulse/recently-viewed-items-performance-issuebug-ziv-ben-or/

the idea is too clean the historic of recently viewed item

  static void Main(string[] args)
        {

            ConnectToCRM();
            var fetchXml = $@"
<fetch>
  <entity name='userentityuisettings'>
    <attribute name='userentityuisettingsid' />
    <attribute name='recentlyviewedxml' />
    <attribute name = 'lastviewedformxml' />
    <filter type='and'>
      <condition attribute='recentlyviewedxml' operator='not-null' />
    </filter>
  </entity>
</fetch>";
                            string max;

            Console.WriteLine("How Manny history do you want to keep Minimum is 1: ");
            max = Console.ReadLine();

            if (Convert.ToInt32(max)<=0)
            {
                Console.WriteLine("You …

How to connect to Crm Dynamics On Premis 2016 with Consol App

private static void ConnectToCRM()
{
try
{
string OrganizationURL = ConfigurationManager.AppSettings["OrganizationURL"];
OrganizationURL += "/XRMServices/2011/Organization.svc";
_orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(OrganizationURL));
ClientCredentials Credentials = new ClientCredentials();
Credentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;
_service = new OrganizationServiceProxy(_orgServiceManagement, Credentials);
//LogHelper.Info("\r\nConnected to {0}\r\n ", OrganizationURL);
WhoAmIRequest req = new WhoAmIRequest();
WhoAmIResponse resp = (WhoAmIResponse)_service.Execute(req);
// LogHelper.Info("User ID: " + resp.UserId);
//Guid currentUserId = resp.UserId;
}
catch (Exception ex)
{
Console.WriteLine();
Console.WriteLine("An error occured trying to connect to the MS CRM Server.\nPlease verify your login data.");
Console.Wri…

R Basic querry

While learning R (from scratch) I fall on kaggle. It propose some competition between user to find the best model of prediction.

It's my first Big Data Experience, then I am a little bit lost. Then First  I have to admit that I follow "How To"

I will post here all my generic basic R data manipulation.



Create a list of value

unusual_title<-c('Dona', 'Lady', 'the Countess','Capt', 'Col', 'Don',                   'Dr', 'Major', 'Rev', 'Sir', 'Jonkheer')
Update the value Title by "unusual Title" if the title is in the liste previously created

titanic$title[titanic$title %in% unusual_title]<-'Unusual Title'
Sapply is a function that apply on each item of a dataSet.
on each name of the DataSet we apply a Split on the first ,or , and keep the first part
this part go in surnamecolum,

titanic$surname<-sapply(titanic$Name, function(x) strsplit(x,split='[,.]')[[1]…

ClickDimensions : Fill Landing page Field With URL paramater

The answer is here

http://blog.clickdimensions.com/pre-filling-forms-using-iframes/

But After That I still have a small question, what if the field is empty in the CRM Dynamics.

when you use profiling field for email template it s : ${Recipient.contact.firstname[0]!''}

but when it's in the url you should use : ${Recipient.contact.firstname[0]!}

then at the end the url should look likes

http://analytics-eu.clickdimensions.com/domain/pages/page.html?firstname=${Recipient.contact.firstname[0]!}