Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unable to add custom Attributes for Activities

(0) ShareShare
ReportReport
Posted on by 365

I am using CRM 4.0. I do not have an option to create a new Attribute for Activity table in Customize Entities.  I am able to add attributes for Contact, Account, Opportunity and Lead by using the New button.  However, there is not a New button available for me for Activity Attributes.

Can someone please let me know how I can get this ability?

*This post is locked for comments

  • NKC Profile Picture
    NKC 4,440 on at
    RE: Unable to add custom Attributes for Activities

               if (context.InputParameters.Contains("Target") &&

                   context.InputParameters["Target"] is Entity)

               {

                   Entity targetEntity = (Entity)context.InputParameters["Target"];

                   Guid appid = targetEntity.Id;

                   if (targetEntity.LogicalName != "appointment")

                   {

                       return;

                   }

                   else

                   {

                       try

                       {

                           if (context.MessageName == "Create" || context.MessageName == "Update")

                           {

                              // if (targetEntity.Attributes["regardingobjectid"] != null)

                              {

                               ColumnSet columns = new ColumnSet(new String[] { "regardingobjectid"});

                               Entity appointment = service.Retrieve("appointment", appid, columns);

                               EntityReference reg = (EntityReference)appointment["regardingobjectid"];

                               Guid regid = reg.Id;

                               string Name = reg.Name;

                               string logicalname = reg.LogicalName;

                               if (logicalname == "lead")

                               {

                                   ColumnSet col = new ColumnSet(new String[] { "firstname", "lastname" });

                                   Entity Lead = service.Retrieve("lead", regid, col);

                                    name = (Lead["firstname"].ToString() + Lead["lastname"].ToString());

                                    targetEntity.Attributes["location"] = name;

                                    service.Update(targetEntity);

                    Hi

                                 I just pasted some  part of a plug-in  code, I am unable to retrieve all attributes on the appointment form , if I use this if (targetEntity.Attributes["regardingobjectid"] != null) getting error .  8 attributed are showing in result set. how do i retrieve all the attributes on the appointment form

  • cmandt Profile Picture
    cmandt 365 on at
    RE: Unable to add custom Attributes for Activities

    Yes. Thank you for responding.  We are on CRM 4.0 (4.0.7333.3231).

    Is there anything else that will help?

  • RE: Unable to add custom Attributes for Activities

    Hi

    Please provide some more information here. Which update rollup you are on for crm 4.0.

    Thank You !

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans