lunes, 25 de junio de 2012

Invalid Descriptor Index

Error:
[Microsoft][SQL Server Native Client 10.0]Invalid Descriptor Index
I've seen this error twice now in Ax 2009, and it's time to tell the world about it.  We have an external SQL Server database to import and register new invoices.  Example:
SELECT InvoiceSeriesNum, Note, ServiceDate, ExchRateSales FROM SomeTable WHERE Transferred=0
Using the OdbcConnection/Statement/ResultSet/LoginProperty classes we can import the data.  Code snippet:
    _intCustInvoiceTable.AssetId            = _resultSet.getString(#IntCustInvoice_AssetId);
    _intCustInvoiceTable.InvoiceSeriesNum   = _resultSet.getString(#IntCustInvoice_SeriesNum);
    _intCustInvoiceTable.Note               = _resultSet.getString(#IntCustInvoice_Note);
    _intCustInvoiceTable.ServiceDate        = _resultSet.getDate(#IntCustInvoice_ServiceDate);
    _intCustInvoiceTable.ExchRateSales      = _resultSet.getReal(#IntCustInvoice_ExchRateVend);
It happens that we now have a new field to add to the query. Thus:
SELECT InvoiceSeriesNum, Note, ServiceDate, ExchRateSales, AnotherField FROM SomeTable WHERE Transferred=0
    _intCustInvoiceTable.AssetId            = _resultSet.getString(#IntCustInvoice_AssetId);
    _intCustInvoiceTable.InvoiceSeriesNum   = _resultSet.getString(#IntCustInvoice_SeriesNum);
    _intCustInvoiceTable.Note               = _resultSet.getString(#IntCustInvoice_Note);
    _intCustInvoiceTable.ServiceDate        = _resultSet.getDate(#IntCustInvoice_ServiceDate);
    _intCustInvoiceTable.AnotherField       = _resultSet.getReal(#IntCustInvoice_AnotherField);
    _intCustInvoiceTable.ExchRateSales      = _resultSet.getReal(#IntCustInvoice_ExchRateVend);
You'll notice, unlike me for the past two hours, that we've added the AnotherField out of order while reading it in from the ResultSet.  By moving it down to the same index as the modified query it should work.  The problem is most likely caused by reading columns out of order.  To resolve the error in the example above, simply move our new field highlighted in red down a line, or edit the original query to change the columns around.

miércoles, 13 de junio de 2012

Hotfix my Hotfix

I have just descovered a Hotfix which fixes a problem when a Hotfix is applied and erases the SysHotfixManifest class, thereby removing my only chance of finding out what Hotfixes have been applied.  I'll need a lie down now.

You can see an example of the SysHotfixManifest class here, listing each of the Knowledge Base patches applied as individual method names.

lunes, 11 de junio de 2012

Production environment problems with BI

I mentioned before that we were working with OLAP cubes and now is that giddy time to publish our work to the production environment.  However, when launching Administration » Setup » Business analysis » OLAP Administration the client application hangs with no idea as to what caused the crash.  It would seem that we were missing a component to interact with the Analysis service, which is obvious if I had bothered to read the installation documentation, page 51.

The missing component is the SQL Server Analysis Management Objects (AMO), which I am now installing on my computer.
I was able to install the AS 2008 October feature pack (X64) on an Ax client without the need to restart the OS nor even the AOS service if the client is on the same machine as the server.


I'm so happy it works that I've even added a screenie of the thing filling up my precious BIEXCHANGERATES and SRSANALYSISENUMS tables.

Time to reprocess those cubes!...

Edit:  Agh!  I've lost my Spanish labels associated with the enumerations mentioned earlier.  This means that if my cube was filtering for the description of a transaction type enumeration in Spanish I'd only ever get 'Desconocido' or 'Unknown'.  This time I went directly to the BIUDMTRANSLATIONS table and manually checked the en-us, es, it, etc options to include these texts.