locked
Tracking ID RRS feed

  • Question

  • Hi All,

    As we all know MS CRM 4.0 does not allow generating tracking id for custom entity. I would like to know is there a method to generate a tracking id for each record of this custom entity using plug-in.

    Regards,
    Shivam

    Monday, December 27, 2010 6:35 AM

Answers

  • Indeed.  I think the best solution from that page is Thuta's .  It's comprehensive, flexible, and simple to deploy.  Unfortunately, you're not really going to find a way around registering, deploying, or configuring the features to Orgs individually--because that's how CRM works: each Org is a functional sandbox apart from each other.  You can automate the deployment to multiple organizations with some clever coding that enumerates the Orgs available to an administrative login (shared to all Orgs) and then executes a sequence of steps to register the Plugin, upload and publish customizations, and create configuration records.  You can find information in this forum to help with that, or reference the sample code in the SDK (notably the Plugin Developer Tool).
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Tuesday, December 28, 2010 8:47 PM
    Moderator
  • Hi David\Andriy,

    I find i peace of code for this tracing no. issue
    If i impliment this can this work for my case as well.

    CrmFloat maxNo = new CrmFloat();
          QueryExpression query = new QueryExpression();
          query.EntityName = "new_payment";
          query.ColumnSet = new AllColumns();
          //ColumnSet cols = new ColumnSet();
          //cols.AddColumn("new_sequencenumber");
          //query.ColumnSet = cols;
          query.AddOrder("new_sequencenumber", OrderType.Descending);
          RetrieveMultipleRequest request = new RetrieveMultipleRequest();
          request.Query = query;
          request.ReturnDynamicEntities = true;
          RetrieveMultipleResponse response = (RetrieveMultipleResponse)Iservice.Execute(request);
          int cnt = response.BusinessEntityCollection.BusinessEntities.Count;
          
          
            DynamicEntity PaymentEntity = (DynamicEntity)response.BusinessEntityCollection.BusinessEntities[0];
            if (PaymentEntity.Properties.Contains("new_sequencenumber"))
            {
    
              maxNo = ((Microsoft.Crm.Sdk.CrmFloat)(PaymentEntity.Properties["new_sequencenumber"]));
            }
          
          double assignedPaymentTrackID = maxNo.Value + 1;
          DynamicEntity UpdatePayment = RetreiveDynamicEntity("new_payment", PaymentGuid);
          StringProperty PaymentTrackID = new StringProperty();
          PaymentTrackID.Name = "new_paymenttrackingid";
          PaymentTrackID.Value = assignedPaymentTrackID.ToString();
          CrmFloatProperty sequenceNumber = new CrmFloatProperty("new_sequencenumber",
                              new CrmFloat(assignedPaymentTrackID));
          UpdatePayment.Properties.Add(PaymentTrackID);
          UpdatePayment.Properties.Add(sequenceNumber);
          Iservice.Update(UpdatePayment);
    

    The only change in this thing is that there in this case there was an attribute "new_sequencenumber", But in my case i dont have that.

    Regards,
    Shivam

    • Marked as answer by Shivam CRM Thursday, January 27, 2011 9:02 AM
    Wednesday, December 29, 2010 12:23 PM

All replies

  • Monday, December 27, 2010 7:06 AM
    Moderator
  • Hi Andriy,

     

    I got confused by the link you have given i find it more complex as it is again and again calling the service and i think it will be dificult it the org name is changed.We need to change it again and again.

    Regards,
    Shivam

    Monday, December 27, 2010 7:49 AM
  • Hello, Shivam.

     

    I'm sorry for providing so complex link but I'm afraid that at those link easiest ways to organize tracking are provided.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Monday, December 27, 2010 8:03 AM
    Moderator
  • Indeed.  I think the best solution from that page is Thuta's .  It's comprehensive, flexible, and simple to deploy.  Unfortunately, you're not really going to find a way around registering, deploying, or configuring the features to Orgs individually--because that's how CRM works: each Org is a functional sandbox apart from each other.  You can automate the deployment to multiple organizations with some clever coding that enumerates the Orgs available to an administrative login (shared to all Orgs) and then executes a sequence of steps to register the Plugin, upload and publish customizations, and create configuration records.  You can find information in this forum to help with that, or reference the sample code in the SDK (notably the Plugin Developer Tool).
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Tuesday, December 28, 2010 8:47 PM
    Moderator
  • Hi David\Andriy,

    I find i peace of code for this tracing no. issue
    If i impliment this can this work for my case as well.

    CrmFloat maxNo = new CrmFloat();
          QueryExpression query = new QueryExpression();
          query.EntityName = "new_payment";
          query.ColumnSet = new AllColumns();
          //ColumnSet cols = new ColumnSet();
          //cols.AddColumn("new_sequencenumber");
          //query.ColumnSet = cols;
          query.AddOrder("new_sequencenumber", OrderType.Descending);
          RetrieveMultipleRequest request = new RetrieveMultipleRequest();
          request.Query = query;
          request.ReturnDynamicEntities = true;
          RetrieveMultipleResponse response = (RetrieveMultipleResponse)Iservice.Execute(request);
          int cnt = response.BusinessEntityCollection.BusinessEntities.Count;
          
          
            DynamicEntity PaymentEntity = (DynamicEntity)response.BusinessEntityCollection.BusinessEntities[0];
            if (PaymentEntity.Properties.Contains("new_sequencenumber"))
            {
    
              maxNo = ((Microsoft.Crm.Sdk.CrmFloat)(PaymentEntity.Properties["new_sequencenumber"]));
            }
          
          double assignedPaymentTrackID = maxNo.Value + 1;
          DynamicEntity UpdatePayment = RetreiveDynamicEntity("new_payment", PaymentGuid);
          StringProperty PaymentTrackID = new StringProperty();
          PaymentTrackID.Name = "new_paymenttrackingid";
          PaymentTrackID.Value = assignedPaymentTrackID.ToString();
          CrmFloatProperty sequenceNumber = new CrmFloatProperty("new_sequencenumber",
                              new CrmFloat(assignedPaymentTrackID));
          UpdatePayment.Properties.Add(PaymentTrackID);
          UpdatePayment.Properties.Add(sequenceNumber);
          Iservice.Update(UpdatePayment);
    

    The only change in this thing is that there in this case there was an attribute "new_sequencenumber", But in my case i dont have that.

    Regards,
    Shivam

    • Marked as answer by Shivam CRM Thursday, January 27, 2011 9:02 AM
    Wednesday, December 29, 2010 12:23 PM