One to one entities in Slx 72
Posted By: nicocrm on October 26th, 2007 in Saleslogix
No Gravatar

There isn’t any walk-through or “best practice” for displaying one-to-one entities in the Saleslogix 7.2 web forms so I thought I should share my experience.

One to one entities were until recently the best practice for adding custom fields to Saleslogix entities (eg Account). They are still a recommended practice in some cases. Here is the walk through on how to define a 1-to-1 entity named CabAccountMisc, linked to Account. The linked table name is CAB_ACCOUNT_MISC. The primary key is, of course, ACCOUNTID.

  • Create the new CabAccountMisc entity using the wizard.
  • Edit the entity and mark it as “Extension”. Select Account as the extended table (this will make Saleslogix generate the foreign key generator strategy in the HBM file, and automatically generate an Account property on the entity as well as a CabAccountMisc property on the Account).

Now you can add a control to the account form and bind it to CabAccountMisc.FooProperty. Very nice, and it actually all works “out of the box” – too bad there isn’t a FAQ on it! The key was to understand that SLX does not consider 1 to 1 relationships as “relationships” but instead as “extensions”. Weird, but it works, so I’ll take it!


Unable to read beyond the end of the stream (Saleslogix 7.2)
Posted By: nicocrm on October 24th, 2007 in Saleslogix
No Gravatar

Got this error when accessing the account screen:


[EndOfStreamException: Unable to read beyond the end of the stream.]
System.IO.__Error.EndOfFile() +54
System.IO.BinaryReader.ReadByte() +2733166
Sage.SalesLogix.Orm.Utility.DelphiStreamReader.ReadProperty() +110
Sage.SalesLogix.Orm.Utility.DelphiStreamReader.FindProperty(String
propertyName, TValueType& type) +27
Sage.SalesLogix.Web.Controls.Currency.GetMultiCurrency() +220
Sage.SalesLogix.Web.Controls.Currency.GenerateScript() +25
Sage.SalesLogix.Web.Controls.Currency.OnPreRender(EventArgs e) +268
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

(as a side note – it took a lot of effort to get it to actually print this error. Previously all I could get was a re-thrown error which did not indicate the source. PLEASE improve the error reporting in the future – if the platform could wrap those exceptions in a Sage exception clearly indicating which smart part, control and (if applicable) property was being bound or initialized it would make troubleshooting these data issues 1000 times easier. I stopped counting the number of “NullReferenceExceptions” for which I had to break out profiler and reflector to find out which field had an issue. But make sure you wrap the error and not just rethrow it, so we still get the full stack trace!)

Anyway. There seems to be a problem parsing the Systeminfo Data blob. I did a bit of investigation and it seems the “DelphiStreamReader” is choking trying to parse some old Crystal information (this is a pretty old database, originally Saleslogix 4 I believe). Specifically the “SkipList” method is not properly skipping the list if it is in certain formats.

Hopefully we can get a fix to this class in the near future. In the meantime, if you get this error, you can do what I did and hex-edit the systeminfo.data blob…

2 Updates:

  1. This is fixed in SP2!
  2. This is the part you need to remove:
    BEFORE EDIT:

    00002b0: 6e61 6c79 7a65 7220 546f 6f6c 4261 727c  nalyzer ToolBar|
    00002c0: 000d 5265 706f 7274 456e 6769 6e65 730b  ..ReportEngines.
    00002d0: 0572 6543 5257 001a 4352 5752 6570 6f72  .reCRW..CRWRepor
    00002e0: 7450 6173 7377 6f72 6473 2e53 7472 696e  tPasswords.Strin
    00002f0: 6773 0114 4e00 0000 5265 6d6f 7465 3d7c  gs..N...Remote=|
    0000300: 5341 4c45 534c 4f47 4958 5f43 4142 4c4f  SALESLOGIX_CABLO
    0000310: 4649 4c5f 5245 4d4f 5445 5f44 534e 7c53  FIL_REMOTE_DSN|S
    0000320: 5953 4442 417c e280 9ac3 a3c2 90c3 a4c2  YSDBA|..........
    0000330: 81c3 b3cb 9cc3 bde2 809e 7c53 514c 2053  ..........|SQL S
    0000340: 6572 7665 727c 144b 0000 0057 6f72 6b67  erver|.K...Workg
    0000350: 726f 7570 3d7c 5341 4c45 534c 4f47 4958  roup=|SALESLOGIX
    0000360: 5f43 6162 6c6f 6669 6c5f 4f44 4243 7c53  _Cablofil_ODBC|S
    0000370: 5953 4442 417c e280 9ac3 a3c2 90c3 a4c2  YSDBA|..........
    0000380: 81c3 b3cb 9cc3 bde2 809e 7c53 514c 2053  ..........|SQL S
    0000390: 6572 7665 727c 0009 4f72 6967 4442 5665  erver|..OrigDBVe
    00003a0: 7205 0000 0000 0000 00c0 0040 0950 6976  r..........@.Piv
    00003b0: 6f74 5965 6172 021e 0e4e 616d 6550 6172  otYear...NamePar

    AFTER EDIT:

    00002c0: 000d 5265 706f 7274 456e 6769 6e65 730b  ..ReportEngines.
    00002d0: 0572 6543 5257 0009 4f72 6967 4442 5665  .reCRW..OrigDBVe
    00002e0: 7205 0000 0000 0000 00c0 0040 0950 6976  r..........@.Piv