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?
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?
Glat it worked.
If found helpful, Please mark my answer verified.
working fine tasks
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(retryCountIf found helpful, Please mark my answer verified.
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
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
91
Vahid Ghafarpour
78
Super User 2025 Season 1