Corrupt CsContact BO - need help fixing please.

I have a customer on 15.1.3 initial release.  We upgraded them from 15.1.2  over a week ago.   We had a problem last weekend where a member was getting an error when trying to update his record.  The error indicated that the CsContact.UpdatedBy field was not long enough - 15 characters.  I contacted TS and went ahead and changed the field length in the BO to 60 to match the Updated_By column in Name.  Everything seemed OK.   TS indicated that they could not duplicate the problem, and indeed I could not either.  I changed it back to 15 and watched the event logs for new errors.  They appeared Thursday this week, so I connected back to the database and changed the length back to 60 and saved and re-published the object.  It errored out the first two times but I got it to publish finally.  After I got it published, desktop users started getting portfolio shutdown errors - odbc timouts.  I rebooted the server.  Upon rebooting I have not been able to log on to the casual view, public site (WCM) and in the desktop, I can connect to the Customers tab, AR, Billing, Events, Expo, etc, but not home, System Setup or Tools.  I get the error posted below.  When I look at the vBoCsContact view, I notice the UpdatedBy column is missing in the view.  I cannot get back in to the BO Designer to edit the BO and try to republish.  Editing the view directly does not help.  Is there any other way to get to the BOD?  Is there any way to force a rebuild of the CsContact BO?  Restoring from backup is a very last resort as the customer has entered numerous event registrations and billing payments during the day prior to the backup.  Any help would be very greatly appreciated. 

 

Unexpected website error: String was not recognized as a valid DateTime.Couldn't store <> in RenewedThru Column. Expected type is DateTime.

System.ArgumentException: String was not recognized as a valid DateTime.Couldn't store <> in RenewedThru Column. Expected type is DateTime. ---> System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.Convert.ToDateTime(String value, IFormatProvider provider)
at System.String.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Data.Common.DateTimeStorage.Set(Int32 record, Object value)
at System.Data.DataColumn.set_Item(Int32 record, Object value)
--- End of inner exception stack trace ---
at System.Data.DataColumn.set_Item(Int32 record, Object value)
at System.Data.DataTable.NewRecordFromArray(Object[] value)
at System.Data.DataTable.LoadRow(Object[] values, LoadOption loadOption, Index searchIndex)
at System.Data.DataTable.LoadDataRow(Object[] values, LoadOption loadOption)
at Asi.Business.BusinessController.ImportRows(String cmdText, DataParameter[] parameters, Boolean forceReload) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi\Business\BusinessController.cs:line 1595
at Asi.Business.BusinessController.get_Item(Object[] primaryKeys, Boolean forceReload, Boolean publishedOnly, Boolean allowRecycled) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi\Business\BusinessController.cs:line 1289
at Asi.Business.BusinessController.get_Item(Object[] primaryKeys, Boolean forceReload, Boolean publishedOnly) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi\Business\BusinessController.cs:line 1208
at Asi.Business.BusinessController.get_Item(Object[] primaryKeys) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi\Business\BusinessController.cs:line 1177
at Asi.Providers.AsiRoleProvider.IsUserInRole(String username, String roleName) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Providers\AsiRoleProvider.cs:line 406
at Asi.Providers.AsiRoleProvider.<>c__DisplayClass1e.<GetRolesForUser>b__1a(String rolename) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Providers\AsiRoleProvider.cs:line 310
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at Asi.Providers.AsiRoleProvider.GetRolesForUser(String username) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Providers\AsiRoleProvider.cs:line 310
at System.Web.Security.RolePrincipal.IsInRole(String role)
at Asi.Web.SiteMapProviderBase.SwappableSiteMapProvider.UserRolesContains(IPrincipal contextUser, User currentUser, String role) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 894
at Asi.Web.SiteMapProviderBase.SwappableSiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 779
at System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context)
at Asi.Web.SiteMapProviderBase.ReturnNodeIfAccessible(SiteMapNode node) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 382
at Asi.Web.SiteMapProviderBase.SwappableSiteMapProvider.FindSiteMapNodeFromKey(String key, Boolean checkAccessibility) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 568
at Asi.Web.SiteMapProviderBase.FindSiteMapNodeFromKey(String key, Boolean checkAccessibility) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 169
at Asi.Web.SiteMapProviderBase.FindSiteMapNodeFromKey(String key) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\SiteMapProviderBase.cs:line 163
at Asi.Web.UrlRewriter.Rewrite(String requestedPath, HttpApplication app) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Web\UrlRewriter.cs:line 255
at Asi.ContentManagerNet.BaseUrlRewriter.CheckForCustomizedUrl(HttpApplication app) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\iWC\Asi.ContentManagerNet\BaseUrlRewriter.cs:line 119
at Asi.ContentManagerNet.BaseUrlRewriter.BaseUrlRewriter_AuthorizeRequest(Object sender, EventArgs e) in c:\Builds\iMIS\15.1.3_Commit\Sourc

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi Steven, You can try to

Hi Steven,

You can try to build and publish the object from the command line.

* Go to the 'bin' directory and in a command prompt window, and run this command line:

BuildPublishBOs -W -S -CS <serverName> -CD <databaseName> -CU <userName> -CP <password>

Replace <serverName>, <databasseName>, etc. with your actual db server name, db name such as mydbserver -CD myimisdb -CU etc.

Also could the issue now be that the client has added data to the table while it was altered that is not valid for the data types the object is creating?

Ross

A better command line

You can force just the specific BO to compile by name using the -O option, like so:

BuildPublishBOs -O <BOName> -CS <serverName> -CD <databaseName> -CU <userName> -CP <password>

For example:

BuildPublishBOs -O CsContact -CS mySqlServer -CU sa -CP mySaPassword -CD iMISDatabaseName

Just FYI

Basically your CsContact BO

Basically your CsContact BO object fields order does not match with DataTable Field order.

My solution would be, restore the initial version (after the upgrade) which was working with length 15 compile and publish check whether the site is working ok.
[If you are not sure about previous version which was working, you can get this business object for different system using export utility and import here and publish (Should be same iMIS version))
Once it is working then edit the width of the field and DO NOT click any other buttons, Just save, compile and publish
Good luck

Thanks for the quick

Thanks for the quick replies.

How do I restore the initial version if I cannot get into the BOD?  I restored the vBoCsContact view, but obviously there is more to it than that.

Hi, Can't you do web access,

Hi,

Can't you do web access, then go to Tools tab

http://servername/imis15/admin

Thanks

No.  Once I log in with to

No.  Once I log in with to the casual view, I get the error.  I get no menus.  If I log on with the desktop, if I click on the Tools tab, I get the error.  I just can't get to it at all.

OK , we need follow rausten

OK , we need follow rausten instructions then

Run the following sql statment  and it list all the version available in your system,

select * from documentmain where documentname = 'cscontact' and documenttypecode = 'bod'

change the current active record status code from 40 to 50 and find the original record which comes with the installation (Use UpdatedOn date field) and change the status code 50  to 40. make sure IsSystem value is 1 for that record.

Restart the IIS and whether that makes any difference.

You might be able to to hack

You might be able to to hack the documentmain table but I have not had time to verify this will work. A publish status of 40 indicates the published version of the object.

Ross, Thanks for getting

Ross,

Thanks for getting back to me. 

in document main, I show 11 different rows for CsContact, 8 with a documentTypeCode of BOD.   Here they are:

documentkey                                                                    updatedon                                  createdon                                documentstatuscode
94C4DC90-3EE9-49D6-A680-22C0FD1DC1AC     2009-10-07 15:24:40.273       2006-11-13 10:58:00.017      50
37F1008C-B1CB-458D-ABBF-33B2282E3006        2009-12-03 12:50:31.307      2009-10-07 15:23:23.887      50
C21AABCE-0F1F-43D0-A3AB-81A1DCFDC7B0      2010-09-02 18:12:04.403      2009-12-03 12:49:36.340      50
A8E2B552-FAF8-42D5-9676-8A576C92CE98        2010-09-09 13:47:28.383       2010-09-09 13:17:07.063      40
85335612-24BB-4576-BE9A-B9FEC081326B        2009-12-02 17:08:35.593      2009-12-02 16:20:24.420      80
587DFB3D-7BC0-4A7C-86BC-D00D73BEEC19    2010-09-09 13:47:28.633      2010-09-08 13:13:12.757     50
01960469-36F9-4866-A223-D45C5F2AE97C        2009-12-03 12:49:36.640      2009-12-02 14:27:51.720      50
0B4C5280-EAEB-4E0B-B42E-DACA5B8D9C61    2010-09-08 13:30:04.243      2010-09-02 18:06:30.733     50

So you think if I change the one that is showing as 40 to 50 and change say the one updated on 2010-09-02 to 40 it may republish that one?

That's my theory yeah. I am

That's my theory yeah. I am unsure if you have to then republish it from the command line or not but you can easily test before doing this.

 

 

trying it now......

trying it now......

didn't work.....

didn't work.....

Looking back at your

Looking back at your suggestion, there is no mention of the actual BO I want to publish.  The output from the command is compiling 0 items, so nothing is getting compiled.....

Change the the following

Change the the following documentkey record to 40 '94C4DC90-3EE9-49D6-A680-22C0FD1DC1AC' , rest of the records to 50,

Restart IIS and check whether it is working.

Thanks, but i have one

Thanks, but i have one question.  Why go back to an object created in 2006?  Wouldn't i want a newer one?  I guess at this point it doesn't matter since it is working now - but I was just curious.

I just installed new version

I just installed new version of DemoDB,  Checked BO udpated date it was 2006 and also this is the only  record in the system too. so I presume this version should work for sure.

Makes perfect sense. Thanks

Makes perfect sense.

Thanks again to both of you for your help.

Changed the -W to -F and

Changed the -W to -F and added -O CsContact, ran the command line and went right into iMIS!!!!  Thanks Ross!!! 

Your welcome!

Your welcome!