AIF Document service Update operation error - axapta

While doing update operation on using document service in 2009 we get below error. Can you please help me to resolve this issue?
'Update operations are not allowed across companies. Please use the 'changecompany' keyword to change the current company before updating the record'

Related

Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'AbpEditions'.'

I am new in the database & backend area, and there is a web application, which in the "aspnet-core" file of the app; when I Run a solution on Visual Studio, after connecting to the Azure SQL, the error
Exception User-Unhandled
Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'AbpEditions'.'
would you please give a hint about how to handle the mentioned issue?
Thanks,
the field that you are using in the controller is call "AbpEditions" so checkout the name of the table in the database they should match.

Determine if Cosmos DB NotFound due to missing collection vs. document

Is there a way to programmatically determine from a DocumentClientException where StatusCode == HttpStatusCode.NotFound whether it was the document, the collection, or the database that was not found?
I'm trying to figure out whether I can implement on-demand collection provisioning and only call DocumentClient.CreateDocumentCollectionIfNotExistsAsync when I need to. I'm trying to avoid calling it before making every request (presumably this adds an extra network roundtrip to every request). Likewise, I'm trying to avoid calling it on error recovery when I know it won't help.
From experimentation with the local emulator, the only field I see varying in these three cases is DocumentClientException.Error.Message, and only when the database cannot be found. I generally try to avoid exception dispatching based on human-readable messages.
Wrong database name:
StatusCode: HttpStatusCode.NotFound
Error.Message: {\"Errors\":[\"Owner resource does not exist\"]}...
Correct database name, wrong collection name:
StatusCode: HttpStatusCode.NotFound
Error.Message: {\"Errors\":[\"Resource Not Found\"]}...
Correct database name, correct collection name, incorrect document ID:
StatusCode: HttpStatusCode.NotFound
Error.Message: {\"Errors\":[\"Resource Not Found\"]}...
I'm planning to use a database with its own offer. Since collections inside a database with its own offer are cheap, I'm trying to see whether I can segregate each tenant in my multi-tenant application into its own collection. Each tenant ends up having a different indexing and default TTL policy. The set of collections is not fixed and changes dynamically during runtime as new tenants sign up. I cannot predict when I will need to add a new collection. There's no new tenant notification: I just get a request that I need to handle by creating a document in a possibly non-existent collection. There's a process to garbage collect unused collections.
I'm using the NuGet package Microsoft.Azure.DocumentDB.Core Version 1.9.1 in a .NET Core 2.1 app targeting a SQL API Cosmos DB instance.
If you look at the Message property in detail, you should see following strings that informs whether 404 Not Found response was generated due to Document vs Collection.
ResourceType: Document
ResourceType: Collection
It's not ideal but you can try to regex this information out of error message.

Relationship not found between Marketing Lists and Emails Sends - Clickdimensions CRM 2015

We have clickdimensions installed in a 2015 CRM version. This environment previously used Exact Target for email marketing automation. We removed Exact Target before upgrading from 2011 -> 2013 -> 2015.
Whenever any user attempts to associate an email send to a marketing list, they get the following error:
The Relationship with Name = 'cdi_emailsend_list' was not found in the MetadataCache
The interesting part is that the relationship does exist. In the entity section of 'Customizations', an N:N relationship exists between the two entities and is present on both the 'Email Send' and 'Marketing List' screen. In the CRM database, we've also been able to find the relationship and the intersect table. All fields appear correct when we compare them to another entity having an N:N relationship with Marketing Lists.
From the traces of the error, we get more detail:
Stack Trace Info: [RelationshipMetadataNotFoundException: The Relationship with Name = 'cdi_emailsend_list' was not found in the MetadataCache]
at Microsoft.Crm.Metadata.ServerDynamicMetadataCache.GetRelationship(String name)
at Microsoft.Crm.Core.Application.WebServices.AssociateRecords.AssociateOneToMany(Int32 childType, Guid childId, Int32 parentType, Guid parentId, String relationshipName)
This would seem to indicate that CRM is looking for a one to many relationship rather than a N:N relationship.
We've tried removing and reinstalling the solution. That didn't have an effect on the error.
We've also spun up other CRM environments (2015 online and on-prem) and imported the Clickdimensions solutions into those environments. Those environments have no issue associating email sends to marketing lists. So, we've narrowed it down to an environment-specific issue.
Does anyone have any recommendations for next steps or what might be causing this issue?
My strong suggestion - get in touch with ClickDimensions support to clarify what's happening.

Dynamics SqlDataDictionaryPermission failure

I am trying to truncate one of our tables in a class to run as a batch job, but keep getting a "Request for permission of type SqlDataDictionaryPermission failed. This is on an AX 4.0 system. I followed MSDN example on acquiring permissions and I am an admin. Here's the code:
//Truncate table
new SqlDataDictionaryPermission(
methodstr(SqlDataDictionary, tableTruncate)).assert();
sqlDict = new SqlDataDictionary();
sqlDict.tableTruncate(tableNum(PMF_INVENTTABLEMODULELOG),false);
CodeAccessPermission::revertAssert();
As I stated, I have admin access to this, so should have the required security key. Though this is displaying the (usr) environment in the class list.
Are you sure it is running server side?
You did not expose your method definition.
I stumbled upon this issue in Ax 2009, while trying to set up a batch that reindexes tables from parameters.
The method doesn't need to be static or have server predicate. The only thing that works is setting the class "RunOn" parameter as "Server".
I know it's and old question with low views, but perhaps some poor soul can be saved.

Entity framework activates trigger to other database: error

I have a ASP.NET web application which does some changes on a table in SQL Server 2008 R2.
On this table there is a trigger that does updates on another table in another database on the same database server.
When saving the changes I'm having the following error:
- The error message: The underlying provider failed on Commit.
- InnerException: This SqlTransaction has completed; it is no longer usable.
Also allowing the database user to connect to the other database isn't working.
Somebody knows how I can make this work?
The trigger is not related to Entity Framework.
The trigger fires when changes are made to the table irrespective of where that change came from.
This is probably a rights issue, the system is attempting to make the change to the second database with the security context that was used to connect to the first database. It the change that was caused by the trigger fails, then everything in the same transaction will fail.
Since you are accessing 2 databases in a transaction, you are using MSDTC, make sure that it is started and that you have rights to it.

Resources