iMIS Community facilitates the collaborative development of iMIS applications and solutions among the customers, partners, and developers of Advanced Solutions International.

getting and inserting cash accounts

For automated tests, I need to get CCashAccounts from the database and insert CCashAccounts into the database.  How can I do this?  Is there some parent object I need to use to obtain or insert CCashAccounts?

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?

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. 

NullRef on ContentItem.ContentItemName

I'm working on a general library to use in all my iParts.  As part of that, I want to be able to log not only which iPart had an error, but which specific content item experienced a problem.

So the constructor for my library class looks like:

public MyLibrary(Asi.Business.ContentManagement.ContentItem ci)
{
    string s = ci.ContentItemName;
    ...
}

CPayment unexpected exceptions and workaround

The following NUnit-driven demos demonstrate that setting CPayment's CashAccountCode before setting the CreditCardNumber will lead to unexpected errors:

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

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

        [ExpectedException(typeof(Asi.iBO.InvalidCardNumberException))]
        public void Demo_Setting_CreditCardNumber_After_CashAccountCode_CausesUnhandledException_2()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = cashAccountCode,
                CreditCardNumber = "011201539123"   // it's irrelevant how I came up with this number.
            };
        }  
    }

Broken Publishing Server

I have a publishing server that is throwing an error when I try to 'show all' errors in the error log.  I can not delete any errors for this particular server because the buttons do not display.  The error is below. 

The publishing is still working to the web server that this publishing server is dedicated to.  I have restarted the service and both my app server and web server but no change.

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?

Communities Email

Has anyone gotten WCM .net communities subscribe to post emails to work?

Error adding a new contact through iBO

Hi,

I am having difficulty adding a new contact through the CContact iBO. I am initializing a new contact by calling new CContact(user) then setting some properties. When I call CContact.Save() I'm getting a stackoverflow error:

EventType clr20r3, P1 aspnet_wp.exe, P2 2.0.50727.3053, P3 4889ded7, P4 asi.ibo, P5 15.0.3.2396, P6 49a781d8, P7 847, P8 1, P9 system.stackoverflowexception, P10 NIL.