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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Getting error "The operation or property SqlTransaction is not valid in the context without calling OnBeginRequest first"

(0) ShareShare
ReportReport
Posted on by 5

We are using North52 in our Dynamics 365 and having chain of PlugIn execution. Intermittently one of the PlugIn execution is failing with below error

The operation or property SqlTransaction is not valid in the context without calling OnBeginRequest first

Does anyone faced this issue and any suggestion on root cause and fix

 Also please suggest on below queries. As I know Dynamics 365 is having 2 mins of timeout limit for PlugIn execution,so

  • If there are 2 Synchronous PlugIn call, then what would be the total time limit of execution, i.e. both plugIn execution should be completed in 2 mins or each PlugIn can have 2 mins time to complete.
  • If there are 4 PlugIn call out of which 2 are Asynchronous and 2 are Synchronous but in the Trace log all are showing same Correlation Id and same Request Id, so does it mean all are executing in same transaction and is having 2 mins of time limte and all should be completed in 2 mins.

Please help or suggest on this.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    HI,

    Good question!

    This is what I think is correct behaviour...

    If there are 2 Synchronous PlugIn call, then what would be the total time limit of execution, i.e. both plugIn execution should be completed in 2 mins or each PlugIn can have 2 mins time to complete.

    If both plugins are on same message say Create then you will only get 2 minutes when record gets created in crm. Now if you have sync plugin one on Create and another is on update, now you will get 2 minutes for create step and 2 minutes for update step.

    All related steps should be completed within 2 minutes. I mean say you have plugin on Account number update and in code you are updating Some field on the account form and you have registered another plugin on update of that field. So entire execution should complete within 2 minutes.

    If there are 4 PlugIn call out of which 2 are Asynchronous and 2 are Synchronous but in the Trace log all are showing same Correlation Id and same Request Id, so does it mean all are executing in same transaction and is having 2 mins of time limte and all should be completed in 2 mins.

    I don't think both sync and async will execute in same transaction. It will be executed in different transaction. but again same method would apply as I state in my first point.

    If found helpful, Please mark my answer verified.

  • Vikrant Singh Profile Picture
    5 on at

    Thanks Bipin for you response. Yes your answer is bit clear to me but I am seeking for some more detail on the exception "The operation or property SqlTransaction is not valid in the context without calling OnBeginRequest first".

    Let me try to explain the exact scenario.

    • On "Create" action of record in "Entity A", registered one North 52 Formula "Formula 1" (Post-Operation & Asynchronous) which Creates Record in "Entity B".
    • On  "Create & Update" action of record in "Entity B", registered a North 52 Formula "Formula 2" (Post-Operation & Synchronous) which updated another Fields "Field A" & "Field B" of the same "Entity B".
    • On "Update" action of the Field "Field Aof "Entity B", registered one North 52 Formula "Formula 3" (Post-Operation & Synchronous) which creates Child records of "Entity B" in "Entity C".
    • On "Update" action of the another Field "Field B" of "Entity B", registered one North 52 Formula "Formula 4" (Post-Operation & Synchronous)  which creates Child records of "Entity B" in "Entity D".

    So here all Formulas are "Post-Operations" but "Formula 1" is "Asynchronous" and "Formula 2", "Formula 3" & "Formula 4" are Synchronous

    But Intermittently, we are getting the 2 mins timeout exception in "Formula 1" as well as the above exception in either of the  "Formula 3" or " "Formula 4" and complete transaction happened to  "Entity B",  "Entity C" &  "Entity D" rolled back. Only persist the record created in "Entity A", So any thoughts or suggestion on the exception "The operation or property SqlTransaction is not valid in the context without calling OnBeginRequest first" and what could be the root cause of this exception. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans