Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

identity provider cannot be null error in API

Posted on by 435

Hi Friends, 

I am trying to retrive the data of aduit history of opportunity but i am getting error  that "Identity provider cannot be blanked"
Thanks

Below is the code--

private static void ExtractFromAudit(OrganizationServiceProxy XrmProxy)
{
// The GUID of the object you want to retirve in this case i am passing contactid
var entityId = new Guid("bb1ccfd1-f6d8-e411-80ed-c4346bac991c");

Console.WriteLine("Retrieving the change history.\n");
// Retrieve the audit history for the account and display it.
RetrieveRecordChangeHistoryRequest changeRequest = new RetrieveRecordChangeHistoryRequest();
changeRequest.Target = new EntityReference(Opportunity.EntityLogicalName, entityId);

RetrieveRecordChangeHistoryResponse changeResponse =
(RetrieveRecordChangeHistoryResponse)XrmProxy.Execute(changeRequest);   //error coming in this line

AuditDetailCollection details = changeResponse.AuditDetailCollection;

foreach (AttributeAuditDetail detail in details.AuditDetails)
{
// Display some of the detail information in each audit record.
DisplayAuditDetails(detail);
}
}

*This post is locked for comments

  • windyMill Profile Picture
    windyMill 435 on at
    RE: identity provider cannot be null error in API

    //here is the code

    static void Main(string[] args)

           {

               try

               {

                   ClientCredentials credentials = new ClientCredentials();

                   credentials.UserName.UserName = "user123";

                   credentials.UserName.Password = "Pass123";

                   using (var XrmProxy = new OrganizationServiceProxy(new Uri("https://xxx.api.crm.dynamics.com" + "/XRMServices/2011/Organization.svc"), null, credentials, null))

                   {

                        ExtractFromAudit(XrmProxy);

                       Console.WriteLine("Thank you for participating in this amazing experiment! muwhaha!");

                       Console.ReadLine();

                   }

               }

               catch (Exception ex)

               {

                   Console.WriteLine(ex);

                   Console.ReadKey(true);

               }

              }

       }

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: identity provider cannot be null error in API

    Hi,

      please post the code you are using to create XrmProxy..

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans