CRM2016 On premises
I have created a plugin to drag in records from a SQL server, however I am getting an unexpected error occurred.
I'm at a total loss as to how to track down what is causing this error.
Does CRM have any workflow logs when looking in the workflow Process sessions there are no records.
Dim NewTransaction As New Entity("new_transactions")
Dim rtn_TransactionValue As Decimal = SQLReader.GetDecimal(TransValue)
NewTransaction("new_transactionsetid") = context.PrimaryEntityId
NewTransaction("new_createdon") = CDate(SQLReader.GetValue(CreatedDate))
NewTransaction("new_createdby") = CreatedByID
NewTransaction("new_sortcode") = SQLReader.GetString(DestSortCode)
NewTransaction("new_accountnumber") = SQLReader.GetString(DestAccountNumber)
NewTransaction("new_daccountname") = SQLReader.GetString(DestAccountName)
NewTransaction("new_reference") = SQLReader.GetString(DestBankRef)
NewTransaction("new_value") = rtn_TransactionValue
NewTransaction.Attributes.Add("new_transactioncode", New OptionSetValue(SQLReader.GetValue(TransCode)))
NewTransaction.Attributes.Add("new_transactiontype", New OptionSetValue(SQLReader.GetValue(TransType)))
NewTransaction("new_rti") = SQLReader.GetString(RTICode)
service.Create(NewTransaction)
Update, I have tracked the error down
The entity that is calling the workflow is new_transactionsets. The workflow creates a record in new_transactions
new_transactionsets has a 1 : N relationship to new_transactions ( field in new transactions new_transactionsetid )
NewTransaction("new_transactionsetid") = context.PrimaryEntityId is the line that is causing the issue and I am getting an error ,
<Message>There is no active transaction. This error is usually caused by custom plug-ins that ignore errors from service calls and continue processing.</Message>
If I manually create a record in new_transactions and then look at the raw SQL table, I can see that the value in new_transactionsetid is the same as context.PrimaryEntityId
Currently I am running the workflow as an On-Demand
Help
sorry should have said workflow not plugin
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Eugen Podkorytov
106
Muhammad Shahzad Sh...
106
Most Valuable Professional