Table relations disappearing - dynamics-ax-2012

I'm having a recurring problem in AX when trying to create custom tables with relations. In short, the field definitions in the relations keep "disappearing".
I have 6 custom tables, with a total of 10 or so relations between them. Every time I compile, I get at least one error saying "Relation incomplete due to missing fields". I remove and re-add the relation, only to have it error out again later.
I have tried a database sync and an incremental CIL build. Has anyone seen this before? Any suggestions on how to fix it?

Well I am very pleased with your question!! That confirms I am truly not the only one in the world having this problem.
Let me tell you what I already tried.. (Please also check the question I have posted that is related to it)
We are having the same issue within our build process. There, an XPO is imported into Ax and half of the tables is missing fields in relations. Importing the same XPO a second time solves most of the missing fields troubles, but does not fix all of the things going wrong with XPO imports.
I have already contacted some people I ran into from Microsoft and they are having a look at this one. Also, we logged an incident so that we also follow the official Microsoft flow for incident logging.
I will try and update this post here with the response I get from Microsoft.

Related

Dynamics AX 2009 X++: Fix id in modification of application after import version control

How to fix ID in modification of application?
This problem will appear after changing database, and importing version control with set parameters:
cover by system tables and shared
does not search for existing records
index update during import
The problem is that on a few tables will show an error message:
sql database reported an error
Do a full synchronize of the database.
Beware, it may remove then reinsert fields or tables, if the id changed.
If you know the exact issue, you can write a job to manually fix it.
This is a more advanced task, so if you're not totally comfortable with it, I'd try Jan's approach.
ReleaseUpdateDB::changeTableId(...);
ReleaseUpdateDB::changeFieldId(...);
ReleaseUpdateDB::change* stuff
Also, Martin wrote a job that does a lot of it for you. I had to tweak it myself before:
http://dev.goshoom.net/en/2011/11/id-change/

android ListView not getting updated after a modification to it's cursorLoader

I am new to android and java and working on an app that has a few remaining problems that I haven't resolved yet.
I have a main activity that is a viewPager, with each page being a fragment. If the 4 fragments 3 are extended from ListFragments and one from PreferencesFragment.
The ListFragments have CursorAdapters to get data to and from SQLite databases through providers.
I am able to get data into the database, insert, modify and query the data correctly and fill the list views ok.
My preference setting are to choose different ways of viewing the data in the database.
Not knowing how to do this, I have implemented a process where I modify the cursorLoader query to the provider with a number of different choices of the "WHERE" clause. I have worked out the logic for the preferences as they exist now, implemented the code but had some difficulty finding what to try to trigger the refresh of the ListView.
Since the "dataset" hasn't really changed, no trigger can come from there, plus that would just use the same cursor as it currently exists to run the query again and return the same results (or be smart enough to know that it doesn't need to run).
On Stack Overflow I did find a couple of references to a similar implementation that suggested reStarting the cursor loader, which would then on the reStart read the current values in the stored Preferences file, create a now modified WHERE clause that will show the sub-set of data as specified in the preference settings.
In testing the app now, even with the reStart of the cursorLoader, the ListView isn't getting refreshed.
The only time I can get it to work right is restarting the app. If I stop the app and restart it, the new values are used and the ListView presents as the preferences dictate.
In looking through Stack Overflow and the Android site, I did find another set of APIs that might have been a more natural fit for what I am trying to do, namely the Filter APIs.
First question then would be, did I go in the wrong direction on how to control the "filtered" view of the datbase. Is filtering a better approach and a recommended way of
doing what I am trying to do?
Second question would be related to the fragment lifecycle of my ListFragments to achieve this CursorLoader update.
Thanks for any input on the topic.
-Dan
Found my problem here.
Two things, the way I am trying filtering is working and from what I have seen in the
Android development site, a reference there indicated that the filtering capability is
already implemented in the CursorAdapter, CursorLoader classes I am using.
When my preference settings changed, I did a reStart of the cursorLoader, but had restarted the wrong one.
Problem solved. Any input on is there a better way would be appreciated.
Regards, Dan

Add-Migration creating empty migration in code migrations/code first

I'm using code migrations in code first. I modified one of my models (domain class) and changes were picked up when I added a migration. So far so good. Now is the part where I may be doing something wrong:
I made additional changes making the previous modification irrelevant.
I deleted the migration and tried to re-scaffold, I got an empty migration. I understand now that the database tracks migration history. So I understand why this was stupid.
My next step was to delete the rows in the database- it also sounds like this is not a good idea. The appropriate way to "step-back" is to do Update-Database -Target:{MigrationName}
Trying both of these I am still getting an empty migration. I also tried dropping the database and updating to the migration before mine.
My google/SO foo has failed me. What I think is happening is that VS/Entity is not detecting changes in my model and I'm not sure what the trigger is. Can someone help me out?
I had a similar problem. My solution was to just go forward with a substance-less migration happening. The only change it makes is adding a record to the __Migration table, but I am living with that and just moving forward.

CRM 2011 Managed Properties - how to protect existing un-managed solutions?

We have a CRM 2011 managed solution that includes some changes to a standard entity (account) - i.e. new form and some extra fields. In most cases, we can install without a problem as the changes are merged. However we have encountered some instances where a client has renamed the Account entity to something else (Company) as an unmanaged chage (including view names) and our solution changes the entity name and view changes back to 'Account' when installed, based on the 'last one wins' rule.
My question is, is it possible to protect un-managed changes, so that we do not overwrite un-merged changes? i.e. similar to Managed Properties?
Any suggestions would be most appreciated.
Unfortunately, I don't think this is possible although maybe I don't fully understand what you are aiming to do. When you export a solution it will save a snapshot of all the included components. When you reimport, it should set all of the included components as they were when you exported them. If you exported the account entity with a customized name, what sort of logic would you want in place to disallow that change to be imported?
If anyone else has a solution to this, I'd be glad to see it but I haven't come across one yet.

Wrong label for a nodereference in Drupal content-type

We have a content-type built using CCK. One of the fields is a node reference. The node picker is using a view to build the options.
A few days ago, everything was working well.
Today, it looks like all node reference fields using views to populate the selection options are displaying the wrong label. Every single label in the option is ``A'', but the actual node number is correct. The form actually works, just the labels are incorrect.
We have tried just about every combination of edit/save, disable/enable, reboot, clear cache, clone the view, rebuild the view, new view, etc, but we still have a big list of As.
If we create a brand new content type with a brand new node reference field, we get the problem.
Through some backup/restore exercises, we have determined that the problem is actually in the database and not in the code.
We can restore our last good backup, but we will lose a decent amount of work we have put into other parts of the database.
We enabled mysql query logging, and the view is actually being called properly, but we cannot track down where the problem is creeping in after that (unraveling the CCK / Views / Drupal plumbing is a challenge).
The install was build with latest stable versions as of April.
The problems referred to in http://drupal.org/node/624422 is similar, but our code versions include the patches mentioned.
Any ideas would be appreciated. Thanks.
I had a similar problem with using views for node reference, after quite a lot of hair pulling it turned out to be that my caching layer was buggy. I was using memcached, but memcached wasn't truned on on the server. It may be worth checking.
Thanks for the responses. We finally got to the bottom of this.
There was a module that was doing a custom hook_views_post_render() that did a prep_replace to rewrite some output. Unknown to us, there are instances where the $output parameter isn't a string, but an array, and this was causing the problem. One of those instances happens to be when you attach a view to a build a select in CCK.

Resources