none
Set Regarding /Tracking icon intermittently showing in custom Outlook add-in/ initial email won't sync. RRS feed

  • Question

  • I have built an Outlook add-in that uses code to track an email to a Dynamics 365 Opportunity manually.  (Client requirements dictated to not use CRM for Outlook toolbar).

    I have used code that is older found via google as such which sets crm values needed on Outlook.UserProperties object, and then assigns CRM Opportunity GUID for crmRegardingId.  The tracking icon is now showing up intermittently for users after this code runs via ribbon click, and I can't tell what is causing issue (Dnym 365 v8.2 or Office 2016 or bad code).  I can find no recent updates to this code anywhere, has anyone found updated code to do this for an Outlook add in (2016) or Dynm 365?  Here is snippet:

                  //ribbon button does several things, and then calls function to set regarding on the email that is 'open'

                    Outlook.UserProperties mailUserProperties = null;
                    Outlook.UserProperty mailUserProperty = null;

                    mailUserProperties = mailitem.UserProperties;

                    mailUserProperty = mailUserProperties.Add("crmLinkState", Outlook.OlUserPropertyType.olNumber);
                    mailUserProperty.Value = 2;   //i have found contradicting posts/articles on what this should be set too!

                    mailUserProperty = mailUserProperties.Add("crmRegardingId", Outlook.OlUserPropertyType.olText);

                    mailUserProperty.Value = _opportunityId.ToString();  //track to newly created Opp in CRM via GUID

                    mailUserProperty = mailUserProperties.Add("crmRegardingObjectType", Outlook.OlUserPropertyType.olText);
                    mailUserProperty.Value = 3;  //3 - Opp CRM type code.

                    mailUserProperty = mailUserProperties.Add("Regarding", Outlook.OlUserPropertyType.olText);
                    mailUserProperty.Value = EmailSubject;

    Also, only replies or forwards to emails, that this code is ran on ‘syncs’ to CRM Activities, not the original email.

    I wasn't sure if this was best forum or CRM Developer, but more of an add-in issue?

    thanks!


    jm


    • Edited by dfgs435 Friday, May 12, 2017 2:58 PM
    Friday, May 12, 2017 2:57 PM

All replies

  • Hello JM,

    The forum is for Outlook specific questions, not any CRM. Anyway, I'd suggest using any low-level property explorer tool such as MFCMAPI or OutlookSpy for viewing property values at runtime, so you can compare what CRM plug-in does and replicate the functionality in your own. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Saturday, May 13, 2017 4:01 PM
  • >> The tracking icon is now showing up intermittently for users after this code runs via ribbon click

    What do you mean by this? Could you share us a screen shot about your issue?

    >> I wasn't sure if this was best forum or CRM Developer, but more of an add-in issue?

    Based on your code, it seems you add and set user property for email in Outlook, if so, there is no tracing icon related. How is above code related with your CRM? If you create a new add-in with current code to add and set user property, is there any issue for Outlook?


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 15, 2017 5:29 AM