Error executing code: Wrong argument types for comparison.
(C)\Data Dictionary\Tables\SysDataBaseLog\Methods\getDataAslist - line 28
(C)\Forms\SysDatabaseLog\Methods\buildContents - line 30
(C)\Forms\SysDatabaseLog\Data Sources\DBHistory\Methods\active - line 7
The actual issue is this, when we were in AX 3.0, we made a chance to a record, which was logged to Tables\SysDatabaseLog and had the ModifiedDate stored as a type of Date. Somewhere along the AX 3.0 to AX 4.0 to AX 2009, this data wasn't upgraded properly.
When the database log compare form tries to work with it, it's expecting to work with two utcDateTime objects for comparison, but it gets a Date and fails.
You can put this code in Tables\SysDatabaseLog\getDataAslist at around line 30 and see the issue in the debugger:
if (typeOf(conpeek(tmp, 2)) == Types::Date &&
dictField.baseType() == Types::UtcDateTime)
{
breakpoint;
}
You can write a hack with conPoke(...) and DateTimeUtil::newDateTime(...) to replace the Date with a utcDateTime, but you'll run into issues in other methods. The best thing to do is correct the data and I wrote a job to do just that. One specific thing to note, this is just proof of concept code...for our actual corrective actions, I wrote a class and table to do batches for various reasons since we have nearly 4 million records. As always, run at your own risk and test. Enjoy:
static void DatabaseLogFix(Args _args) { SysDataBaseLog log; container tmp; container newData; SysDictField dictField; fieldId fieldId; int i, idx; boolean updateCon; boolean updateData; Counter counter; #Properties; ; //select firstonly log where log.RecId == 5638018469; ttsbegin; while select forupdate log order by CreatedDateTime, RecId { updateData = false; if (typeof(conpeek(log.Data, 1)) == Types::Container) //Version 3.0 format { newData = log.Data; for (i=conlen(log.Data); i; i--) { updateCon = false; tmp = conpeek(log.Data, i); fieldId = conpeek(tmp, 1); dictField = new SysDictField(log.Table, fieldId); if (dictField) { if (dictField.name() == #PropertyModifiedTime || dictField.name() == #PropertyCreatedTime) { continue; } // Type mismatch for "New" value if (typeOf(conPeek(tmp, 2)) != dictField.baseType()) { // If it's a date that should be a utcDateTime, upgrade it if (typeOf(conpeek(tmp, 2)) == Types::Date && dictField.baseType() == Types::UtcDateTime) { tmp = conPoke(tmp, 2, DateTimeUtil::newDateTime(conPeek(tmp, 2), 0)); updateCon = true; } // Otherwise throw an error else { info(strfmt("[RecId %1][TableID %5][FieldId %2][2 NEW] Type mismatch (%3/%4)", log.RecId, fieldId, typeOf(conPeek(tmp, 2)), dictField.baseType(), log.table)); } } // Type mismatch for "Old" value if (typeOf(conPeek(tmp, 3)) != dictField.baseType()) { // If it's a date that should be a utcDateTime, upgrade it if (typeOf(conpeek(tmp, 3)) == Types::Date && dictField.baseType() == Types::UtcDateTime) { tmp = conPoke(tmp, 3, DateTimeUtil::newDateTime(conPeek(tmp, 3), 0)); updateCon = true; } // Otherwise throw an error else { info(strfmt("[RecId %1][TableID %5][FieldId %2][3 OLD] Type mismatch (%3/%4)", log.RecId, fieldId, typeOf(conPeek(tmp, 3)), dictField.baseType(), log.table)); } } if (updateCon) { updateData = true; newData = conPoke(newData, i, tmp); } } } if (updateData) { counter++; log.Data = newData; log.update(); } } } ttscommit; select count(RecId) from log; info(strfmt("%1 updates made against %2 records", counter, log.RecId)); }

I just had a case where I got a string value (Customer or Vendor ID) in the log for a custom float field on InventTable. AX 2009 from the start, apparently you don't need to upgrade to get corrupt data in DatabaseLog.
ReplyDeleteThat's strange. I'd guess you might have had added a custom string field to a table, typed some data, then changed the string field to a float. You would receive a synchronization warning that says "Warning this field will be dropped and recreated" or something to that sort.
DeleteAll is well, except that if you had DB logging turned on, that string field was recorded in the DB log, then it is now a float and it is a type mismatch. This would explain your error, but it's just my guess.
Very nice blog you have hhere
ReplyDeleteDengan menyediakan berbagai game yang modern, jujur, adil, merakyat dan nyentrik. Kini BANDARBOLA855 hadir untuk menemani keseharian anda dengan berbagai event dan kesempatan meraih kemenangan besar. rtp bandarbola855
ReplyDeleteOh my goodness! an excellent article dude. Many thanks However I am experiencing trouble with ur rss . Do not know why Not able to enroll in it. Will there be any person obtaining identical rss dilemma? Anyone who knows kindly respond. Thnkx Pink salt Trick
ReplyDeleteYour talent is really appreciated!! Thank you. You saved me a lot of frustration. I switched from Joomla to Drupal to the WordPress platform and Ive fully embraced WordPress. Its so much easier and easier to tweak. Anyway, thanks again. Awesome domain! AuDifort
ReplyDeleteIt was any exhilaration discovering your website yesterday. I arrived here nowadays hunting new things. I was not necessarily frustrated. Your ideas after new approaches on this thing have been helpful plus an superb assistance to personally. We appreciate you leaving out time to write out these items and then for revealing your thoughts. pink salt trick
ReplyDeleteWhen do you think this Real Estate market will go back in a positive direction? Or is it still too early to tell? We are seeing a lot of housing foreclosures in Altamonte Springs Florida. What about you? Would love to get your feedback on this.
ReplyDeleteSoulmate sketch
I real delighted to find this site on bing, just what I was looking for : D also bookmarked . solid surface
ReplyDeleteI real delighted to find this site on bing, just what I was looking for : D also bookmarked . situs slot
ReplyDeleteI can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. hooded sweatshirt men's
ReplyDeleteGood an very informative post. I will come back to your blog regullary. 안산출장마사지
ReplyDeleteIn the middle the talking starts and two advantages come to play for the side of the good guys, it will be a cliché sci-fi movie. 목포출장마사지
ReplyDeleteAs I web-site possessor I believe the content material here is rattling fantastic , appreciate it for your efforts. You should keep it up forever! Good Luck. rent a car kosovo 폰테크
ReplyDeleteHello” i can see that you are a really great blogger, Zoom555
ReplyDeleteWow that information is impressive it really helped me and our kids, cheers! 강남하이퍼블릭
ReplyDeleteDude.. My group is not considerably into looking at, but somehow I acquired to read several articles on your blog. Its fantastic how interesting it’s for me to visit you fairly often. 의정부출장마사지
ReplyDeleteSweet web site , super design and style , very clean and utilise pleasant. alexistogel
ReplyDeleteI believe that is among the such a lot important information for me. And i am glad studying your article. However wanna commentary on few normal things, The site taste is ideal, the articles is truly excellent . Just right process, cheers. 인천출장마사지
ReplyDeleteCurrently it looks like Drupal is the top blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog? kebuntoto
ReplyDeletesomehow found your site when i was kind of stoned. good read 캔디약국
ReplyDeleteI love the valuable info you supply in your posts. I will remember this. 김포출장마사지
ReplyDeleteNot long ago i found your website and also have been reading along. I thought I might leave my initial comment. Nice blog. I’ll keep visiting this web site very frequently. Thank you 인천출장안마
ReplyDeleteWow! This can be one particular of the most useful blogs We have ever arrive across on this subject. Actually Excellent. I’m also an expert in this topic therefore I can understand your hard work. sub sandwiches
ReplyDeleteSpot up for this write-up, I actually think this excellent website wants far more consideration. I’ll probably be again to learn to read a lot more, thank you for that info. slot gacor
ReplyDeleteI haven’t checked in here for a while since I thought it was getting boring, but the last several posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it friend 용인출장마사지
ReplyDeletebedroom furnitures should be sized up and paired with the color and type of your beddings., Silicone Mats
ReplyDeleteI am typically to blogging and i actually appreciate your website content continuously. The article has truly peaks my interest. Let me bookmark your internet site and maintain checking for brand spanking new data. high da dr backlinks indonesia
ReplyDeleteI am incessantly thought about this, thanks for putting up. 출장마사지
ReplyDeleteOh my goodness! a fantastic article dude. Appreciate it However My business is experiencing problem with ur rss . Do not know why Not able to subscribe to it. Can there be everyone finding identical rss problem? Anybody who knows kindly respond. Thnkx 트립닷컴 할인코드
ReplyDeleteLol, My laptop died while I was checking this site previous time I was here. And for the last two days I have been searching for this weblog, so glad I came across it again! terongbet
ReplyDeleteExcellent blog post, I have bookmarked your site so ideally I’ll see much more on this subject in the foreseeable future! 소액결제현금화
ReplyDeleteI like this blog its a master peace ! Glad I found this on google . 오피아트
ReplyDeleteyou are truly a excellent webmaster. The site loading velocity is amazing. It kind of feels that you are doing any distinctive trick. Moreover, The contents are masterpiece. you’ve done a magnificent task on this matter! 여수출장마사지
ReplyDeleteHey! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having problems finding one? Thanks a lot! 대구출장마사지
ReplyDeleteGood – I should certainly pronounce, impressed with your site. I had no trouble navigating through all the tabs as well as related info ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your customer to communicate. Excellent task. 비아그라 구매
ReplyDeleteWell done! I appreciate your input to this matter. It has been useful. my blog: how to finger a girl 강남노래방
ReplyDeleteI am looking for and I enjoy post a comment of the fact that content with the post rocks ! Great work 소액결제현금화
ReplyDeleteI simply added your website to my favorite features. I really like reading your posts. Thanks! mixue88
ReplyDeleteThis is actually intriguing, You’re an incredibly experienced author. I have joined with your feed and also anticipate finding your really great write-ups. Aside from that, We have shared the blog within our internet sites. 부천출장마사지
ReplyDeleteThanks a lot for this kind of facts I had been exploring all Yahoo to find it! 여성전용마사지
ReplyDeleteTogether with almost everything that appears to be building throughout this specific subject matter, many of your points of view happen to be fairly radical. However, I am sorry, because I can not give credence to your entire strategy, all be it refreshing none the less. It looks to me that your remarks are generally not completely validated and in reality you are yourself not entirely convinced of your assertion. In any case I did appreciate looking at it. 여성전용마사지
ReplyDeleteI am frequently to blogging and i also truly appreciate your content regularly. The article has really peaks my interest. I will bookmark your website and keep checking choosing details. 토닥이
ReplyDelete