web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Retry Method for Dynamics CRM SDK

(0) ShareShare
ReportReport
Posted on by 242

Hi,

I am creating create method using SDK but if the response is empty in create method how can i do retry to create a record?

I have the same question (0)
  • Verified answer
    miguelbeja Profile Picture
    Microsoft Employee on at

    Hi,

    Can you show sample of your code?

    You can try to validate how it is the response object, for example normally a create method returns a Guid of the object that was created, if it isn't returning is because it wasn't created.

    if (response.Id == Guid.Empty || response.Id == null)

    retry code

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Add try & catch block inside your create method in sdk. Create generic method to execute Create method and  Catch for any exception and based on exception you can try to call same method again.

    When you do _service.create(objCreateobj); in response you will get GUID of record create.

    You will never get empty guid so you have to use try and catch block to catch exception.

    Make a counter variable and retry to say 3 times then return from the code.

    static int retryCount=0;
    
    public void ExecuteMain()
    
    {
    
    try
    
    {
    
    Guid recordId=CreateRecord(service);
    }
    
    catch(Exception ex)
    
    {
    
    retryCount  ;
    
    if(retryCount

    If found helpful, Please mark my answer verified.

  • Suggested answer
    madiri Profile Picture
    242 on at

    working fine tasks

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Glat it worked.

    If found helpful, Please mark my answer verified.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 131 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 95

#3
Chris1968 Profile Picture

Chris1968 20

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans