blog

Asi.iBO.Errors.CErrors.NewError may throw

Since this doesn't seem to be documented anywhere online (particularly in the API documentation), it is worth noting that CErrors.NewError will throw an exception if the ThrowExceptionOnError property of the associated IiMISUser object is set to true (assuming you are creating an Error and not a Warning).  In this case, it will always throw and never return.  At least that's what I gather from digging around in reflector:

Raiser's Edge Conversion (pdf files)

Has anyone converted pdf files from Raiser's Edge to iMIS 15?

I have been told the pdf files are actually stored in the RE database.

Any assistance would be appreciated!

Unexpected CPayment behavior

This NUnit TestFixture demonstrates some unexpected behavior in CPayments.  Note that you will need to alter or provide some of the values to run on your machine, if you so choose, but I think you can see by reading this some gotchas to look out for:

using System;
using System.Configuration;

using Asi.iBO;
using Asi.iBO.Financials;
using NUnit.Framework;

namespace Crown.Imis.IntegrationTests
{
    [TestFixture, Explicit("demos")]
    public class CPaymentGotchaDemonstrations
    {
        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            iboAdmin.InitializeSystem(ConfigurationManager.ConnectionStrings["DataSource.iMIS.Connection"].ConnectionString);
        }

        [Test]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void Demo_Setting_CreditCardNumber_toVisaTestNumberAfterSetting_CashAccountCode_CausesUnhandledException()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = "VISA",
                CreditCardNumber = "4007000000027"  // VISA test number, eh?
            };
        }

        [Test]
        [ExpectedException(typeof(Asi.iBO.InvalidCardNumberException))]
        public void Demo_Setting_CreditCardNumber_to011201539123After_CashAccountCode_Causes_InvalidCardNumberException()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = "VISA",
                CreditCardNumber = "011201539123"   // it's irrelevant how I came up with this number.  No idea yet on what is wrong with it.
            };
        }

        [Test]
        public void Demo_Setting_PaymentType_After_CreditCardNumber_Clears_CreditCardNumber()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CreditCardNumber = "4007000000027", // VISA test number
                PaymentType = EnumPaymentType.Check
            };

            Assert.IsNullOrEmpty(payment.CreditCardNumber);
        }

        [Test]
        public void Demo_SettingCashAccountCodeChangesPaymentTypeToCreditWhenCashAccountIsCreditType()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser());
            payment.PaymentType = EnumPaymentType.Check;
            payment.CashAccountCode = "VISA";

            Assert.AreEqual(EnumPaymentType.CreditCard, payment.PaymentType);
        }
    }
}

Blog interrupted by newly discovered shortcut

Last Friday, I had started to blog about a couple of new shortcuts I learned of on Lifehacker.com.  Just before posting, I accidentally discovered another one that blew away the content of my post.

In Windows Explorer (Vista and 7):

  • Rename Files Fast with the Tab Key - I started using this with file preview to quickly rename scanned files that the scanner delivers as datestamp.pdf.  This method also helps overcome the frustion of delays when trying to right-click to rename files on far-remote mapped drives or WebDAV drives.
  • Rename Windows Files in Bulk  - I was happy to find this.  Not too long ago, I resorted to a batch file to do a very similar rename.

Also be sure to check out The Best New Windows 7 Keyboard Shortcuts

Using a Query as a source for IQA

I have a client who wants a list of a particular member type (REG) who reside in Canada or in Washington State.

This is really easy to do with SQL: SELECT Full_Name, ID, State_Province, Country, Member_Type FROM Name WHERE STATE_PROVINCE = 'WA' OR COUNTRY = 'Canada'

I tried using IQA in the following ways:

  1. Create a query where I use the CsContact BO and Filter Member Type = "Regular" AND State Province = "Washington" OR Member Type = "Regular" AND Country = "Canada" Depending on the order, I either get all Washington or All Canada, but never both.  If I try Member Type = "Regular" and State Province = "Washington" or Country = "Canada" I get the same results, depending on the order
     
  2. I tried creating two queries - one where Member Type = "Regular" and Country = "Canada" and one where Member Type = "Regular" and State Province = "Washington" then used left outer joins to the CsContact BO for each of them, but got multiple lines for each result and only ID numbers, no other fields
     
  3. I created a query to just show Member Type = "Regular" and then used it as my source for a query where Country = "Canada" or State Province = "Washington" and was able to get only Canada and Washington but for every member type.

The only solution I could find was to use State Province and select all the Canadian provinces as well as Washington.  This works for now, but in the future they will be asking me for this type of thing again and it may not be possible to make the filtering selections from one field.  Did I do something wrong with my joins or my filters?

Checking the versions of iMIS ActiveX components

There are several ways to confirm that your iMIS Desktop installation has the correct versions of ActiveX components.  The installer normally handles this, but once in a while some environmental issue interferes, leaving an older version of a component installed.

  1. In iMIS Desktop, pick Help> About >System Info.
  2. Download the AsiVersion utility from www.advsol.com/downloads - scroll down to the Diagnostic Tools folder and download AsiVersion.zip.
  3. Add file version to Windows Explorer
    1. Right-click on the field columns header
    2. Pick "More..." from the context menu
    3. Check "File version" in the list. 
    4. By default, iMIS ActiveX files are in C:\Program Files\ASI\iMIS15\ActiveX.  Note that this checks the file version, but doesn't check the COM registered version loaded by desktop (they'll be the same, unless there's a problem).  The first two options do.

 

command script to refresh the IIS world

This is a command script I use to reset the iMIS world completely in my local development environment, making sure nothing's cached in IIS or ASP.NET.  The script stops the Publishing and Workflow services, stops IIS, deletes the files in the ASP.NET cache, starts everything back up, and recycles the application pool used by iMIS.

Copy the lines below and save them in a .cmd file.  It needs to be run as administrator. 

Adding public view pages to a content record

I don't think this is possible, but who knows, I may be wrong. My client wants to have the ablility to include public view content on a regular content record. e.g. Say they create a content record that has the format of 1 over 1. They want the abiltiy to put text in the top box and then have  the public view page content in the lower box. Is this possible? If yes, how was this accomplished?

Why. Is New Content. Generated. From the Bottom?

I am having an extrememly difficult time in MOVING a Web part once I've created it within a content record. It seems that if I have a content record with too much content on it, I get this error: 

Error: The collection already contains the specified content item.

This is as was already catalogued previuosly here and as was submitted as a ticket. I do not know if ASI has bothered to resolve it.

off-topic - need suggestions for a Lead generation service/tool

I am looking for a lead generation tool to collect contact info from visitors when the download some white papers on my site. Could any one suggest a serice they have used for this? i would prefer to have a landing page on my site that lists the documents and gathers info from visitors or use an email bulletin that send out these links to a group of people with our target market (R&D professionals).

Syndicate content