Welcome to MSDN Blogs Sign in | Join | Help

Wow, the number of bloggers on the team is growing exponentially!!! I was alone for quite some time and then Isaias started. This week I already linked to Jesper's blog and today I just found out that Jorn also started his blog at http://blogs.msdn.com/jorn.

Hey guys, you should let me know about this so I'm not caught off guard. Well, anyway hopefully Jorn will blog about our Reports. I know that I'm going to read his blog as he has a very amusing writing style. Actually, his second post about creating Add-ins from Visual Studio is great! I didn't know about it until now and it's great because I'll be able to use that for my next blog idea (keep posted).

So what is going on right now? Well, last Monday Oct 30th we shipped Office Accounting 2007 and made express available as a free download. Tuesday I got to see the videos of our launch in Willow Springs, IL. Wednesday we started to think about our next release. We got Monday off and Tuesday we had a small celebration by going to the Parlor Billiards. It was a very nice event; unfortunately there was a raffle but I didn’t get any prize. The rest of the week we are doing customer visits, which is very interesting because not everyone on the product team gets to interact with customers on a daily basis. Unfortunately we only get to visit one customer. I would like to talk to customers that are just starting to use our product, probably they'll have great insight about what we are missing and what we did right.

 

So what happens next? Well, there are a lot of things I am planning to blog about. Another developer from our team, Jesper, started blogging about the Loader (you can read his blog here). I’m doing a brownbag next week about blogging to our team, so hopefully we’ll get more bloggers about Office Accounting, especially PMs that are underrepresented in this space. Other than that, it is an interesting time when we have time to innovate for our next release.

Isaias blogs about how to sell on eBay from Office Accounting 2007

Isaias is probably one of the experts on this, as he owned this feature from early own and worked very hard on seeing this through. It really is a great feature to have linked to your accounting system. I worked on bits and pieces of this and since I have used eBay before, but it was always interesting to see how this feature (and its UI) evolved into what it is now. I’m very interested in hearing feedback about this, and I know that the entire feature is too, so go ahead and comment about it. To get started, don’t forget to check out the step by step process in this post.

Microsoft tries to lure ‘mom and pop’ companies. Interesting title which I don’t really agree that we want to ‘lure’ but well, it got my attention so I decided to blog about it. First of all, I’m glad that we shipped v 2.0 or our product on time! Second, we just announced about Office Accounting Express 2007 which is a free download, so many small businesses can benefit from this and give it a try. Third, we are using a very cool marketing campaign. Unfortunately I can’t give more details about the campaign because I don’t know anything other than what is at the ideawins website, but you’d have to admit that an electric spinning fork, a caffeinated salad, climate-control socks or fruit favored coffee do sound cool. I probably can’t participate but it’s something I’ll be watching. The FAQ on the site looks to be very good, for anyone that is wondering about our product.

 

Here are links to the articles talking about Office Accounting 2007 that I could find:

 

Articles

CRN (this is probably the most in-depth article I could find)

eWeek

TechWeb

Techworld

InfoWorld

 

Blog posts

Microsoft is offering Office Accounting Express 2007 for free

Microsoft Office Accounting Express 2007 free

Free Download: Office Accounting 2007 Express

 

When a UI Add-in form is open and SBA 2006/Office Accounting 2007 is closed, the UI Add-in form closes without firing the Closed or Closing events.  This prevents the developer from asking if the user would like to save their changes before the form closes. SBA forms, if the SBA shell is closed, ask the user if they'd like to save changes before exiting and ISV's would like this behavior as well.

 

Ok, so I found about this thanks to Chad. He helps ISVs and users in our newsgroup and in this case, it seems that addressing this issue in my blog will be helpful. So to start with, this problem happens if you show a modeless form, but you want to ask the user if they want to save the changes to the form, before the form is closed. If you handle the Closing event, you can do this when the user closes your form. But if the user tries to close the SBA shell directly, your form will close automatically because you will not get the Closing event. Ok, so I hope you understand the problem now.

 

To solve this, we will use the IWin32Window owner parameter that you get from the DoAction callback:

 

Visual Basic

Sub DoAction( _
        ByVal ID As String, _
        ByVal entity As IBaseMasterEntity, _
        ByVal instance As ISmallBusinessInstance, _
        ByVal formsFactory As Object, _
        ByVal owner As IWin32Window _
)

C#

void DoAction(
        string ID,
        IBaseMasterEntity entity,
        ISmallBusinessInstance instance,
        object formsFactory,
        IWin32Window owner
);

 

The IWin32Window is the handle to the window where the menu or toolbar button was pressed, so you can do the following:

 

this.sbaForm = owner as Form;

 

if (this.sbaForm != null)

{

      this.sbaForm.Closing += new CancelEventHandler(sbaForm_Closing);

}

 

Then, you can handle the closing event of the SBA Form and prompt the user to save. Since it is a CancelEventHandler you can also cancel the event so the application will not close. Here is a quick example:

 

private void sbaForm_Closing(object sender, CancelEventArgs e)

{

      if (MessageBox.Show("Do you want to close?","Customer Invoices",

      MessageBoxButtons.YesNo) == DialogResult.No)

      {

            e.Cancel = true;

            this.BringToFront();

      }

      else

      {

            this.Close();

      }

}

 

This is just a quick sample where I simply ask the user to confirm they want to hide my form and if they say no, then I set the Cancel property to true so the form doesn’t close. This content is provided as-is, implies no warranties and confers no rights.

 

There is a quick catch, if you add this handler for the Closing event, don’t forget to unsubscribe from it when your form is disposed:

 

protected override void Dispose( bool disposing )

{

    if( disposing )

    {

        if(components != null)

        {

            components.Dispose();

        }

 

        if (this.sbaForm != null)

        {

            this.sbaForm.Closing -= new CancelEventHandler(sbaForm_Closing);

        }

    }

    base.Dispose( disposing );

}

The next version of SBA SDK is coming (under a different product name) and it's time to start looking at some of the changes in the Add-ins area.

Referencing SBAAPI.dll

First of all, we found out that our 1.0 SDK sample for UIAddIn, we were referencing SBAAPI (when we are always telling you not to do it). So now that 2.0 is coming I can show you why this is bad. The problem with this is that it references the v1 sbaapi.dll which is not going to be there for 2.0, so if you try to install this add-in in our 2.0 product you will get the following error when you try to click on the "Invoices" button.

If you don't want your add-in to work with Office Accounting 2007 then this is ok, but in case you do, here is what you need to do to remove the reference to SBAAPI.
1. In the UIAddIn project, remove the reference to SBAAPI.
2. You'll get the following build error:

CustomerInvoices.cs(63): The type or namespace name 'CustomerAccount' could not be found (are you missing a using directive or an assembly reference?)

The problem goes away if you use the ICustomerAccount instead of the CustomerAccount class that exists in SBAAPI. Here is the corrected line of code:

this.customerName = ((ICustomerAccount)smallBusinessInstance.CustomerAccounts.GetByPrimaryKey(customerID)).Name;

This problem has been fixed in our SBA SDK 2.0. You can find the SBA SDK 2.0 beta here.

 

Business Logic Add-ins 

If you tried using my sample code from my ISdkAddInDriver Sample that I posted in C# or in VB.NET, there are changes that you need to make if you want to remove the reference to SBAAPI.dll. If you want to do validation, you need to throw an ApplicationException instead of a SmallBusinessException, for example the new code will be:

C# -> throw new ApplicationException("EMAIL MISSING");
VB.NET -> Throw New ApplicationException("EMAIL MISSING")

One of the improvements we've made for Office Accounting 2007 in validation is the error message that users will see when the business logic add-in throws an ApplicationException.

In Small Business Accounting 2006 you will see this:

In Office Accounting 2007 you will see this:

As you can see, the error message now is shorter and more helpful. First, we show the Add-in name and we show whatever Message the Add-in specifies in the ApplicationException. You can find Office Accounting 2007 beta here.

 

UI Add-ins

One of the improvements we made here is the ability to have cascading menus (up to 3 levels), so now you can organize your menus better. We have updated the UI Add-in sample in SBA SDK 2.0 to show cascading menus. You can find the SBA SDK 2.0 beta here.

 

 

A couple months ago I posted a step by step process for doing a Business Logic Add-in Sample in C#, so finally here is the second part for doing this in VB.NET. The instructions are pretty much copied from the original post but I have translated the code to VB and verified it.

Let's start.

1. Open the UIAddIn project (from VB.NET Samples)
2. Add a new class that implements the ISdkAddInDriver interface. I got the basic code from the Concepts Manual of our SDK. I'm going to post the code here:

Imports Microsoft.BusinessSolutions.SmallBusinessAccounting

Public Class BusinessLogic
    
Implements ISdkAddInDriver

    
Private m_contextObject As IBaseMasterEntity

    
Private instance As ISmallBusinessInstance

    
Public Sub New(ByVal contextObject As IBaseMasterEntity)
        
MyBase.New()
        
Me.m_contextObject contextObject
        
Me.instance contextObject.SmallBusinessInstance
    
End Sub

    Public ReadOnly Property 
ContextObject() As IBaseMasterEntity
        
Get
            Return Me
.m_contextObject
        
End Get
    End Property

    Public Sub 
RunPreSave() Implements ISdkAddInDriver.RunPreSave
        
' Do Pre-Save work here
    
End Sub

    Public Sub 
RunPostSave() Implements ISdkAddInDriver.RunPostSave
        
' Do Post-Save work here
    
End Sub

    Public Sub 
RunPreDelete() Implements ISdkAddInDriver.RunPreDelete
        
' Do Pre-Delete work here
    
End Sub

    Public Sub 
RunPostDelete() Implements ISdkAddInDriver.RunPostDelete
        
' Do Post-Delete work here
    
End Sub
End Class

3. Now we need to hook the business logic addin so it can be registered and instantiated by SBA. Here's what I have to do:

In DriverRegistration.vb we need to return a new myDriverInfo for the business logic addin. I added this code in line 37 (in the GetDriverInfos method) 

myDriverInfo = New MyDriverInfo(New Guid("6EF926D5-79B8-476e-8847-3AE0BCCBF28F"), DriverType.SdkAddIn, False"""Validate Customer Email Business Logic Addin""This is a test business logic to validate email on customers.", Guid.Empty, GetType(BusinessLogic).FullName)

driverInfo.Add(myDriverInfo)

I'm just creating a new guid because I will only have one business logic on this assembly. The last parameter uses BusinessLogic which is the name of my class implementing the ISdkAddInDriver.

In DriverRegistration.vb I need to instantiate my business logic addin. I change the LoadSdkAddInDriver to return a new instance of my BusinessLogic class. This is my new implementation:

Public Function LoadSdkAddInDriver(ByVal driverGuid As Guid, ByVal ownerEntity As IBaseMasterEntity) As ISdkAddInDriver Implements IDriverFactory.LoadSdkAddInDriver
    
Return New BusinessLogic(ownerEntity)
End Function

Finally, in MyDriverInfo.vb we need to support the AppliedTypes property. In this case, I'm simple going to change the property directly just to make this addin work.

Public ReadOnly Property AppliedTypes() As Type() Implements IDriverInfo.AppliedTypes
    
Get
        Return New Type
() {GetType(ICustomerAccount)}
    
End Get
End Property

4. I'm going to put a simple validation for customers so we can test this business logic addin. If the addin wants to cancel the save event (from the PreSave handler), it needs to throw an exception. The message shown to the user will be an ugly technical message, so I would personally suggest to show a friendly message before that. Here is my code:


Public Sub RunPreSave() Implements ISdkAddInDriver.RunPreSave

    
Dim customer As ICustomerAccount = CType(ContextObject, ICustomerAccount)
    
Dim email As ICustomerVendorEmail customer.CustomerVendorEmails.GetByType(CustomerVendorEmailType.Email1)
    
If ((email.EmailAddress Nothing) _
    
OrElse (email.EmailAddress.Length 0)) Then
        Throw New 
SmallBusinessException(ErrorCases.EmailTypeInvalid, "EMAIL MISSING")
    
End If
End Sub

Gotchas
Each time you modify the code in the UIAddIn project, the assembly version will change so you would need to reinstall you addin again or change the AssemblyInfo.cs to have a fixed version number. This was the only issue I ran into. Then, I just have to copy the UIAddin.dll to the SBA location and install it. If you were to ship a business logic, I would suggest you add it to your GAC and install in a separate folder.

You can download my sample here.

I wanted to post a quick sample that I think might be useful. The escenario that I ran into is when you have two Add-ins that complement each other, a UI Add-in and a Business Logic Add-in. Since the user can enable only one of them and disable the other, you might want to check for this and then ask the user to enable both of them to have all the functionality. To check the status of a particular Add-in, you need the IDriverInfo.DriverGuid (since that is unique) that you used when you registered your Add-in.

System.Data.DataView dataView instance.DriverRegistrations.DataView;
// We look for the DriverGuid of our known addin
dataView.RowFilter "DriverGuid = 'DF7ADD4C-BE62-42e5-9F30-44EAD462AC62'";

if 
(dataView.Count == 1)
{
    IDriverRegistration driverRegistration 
instance.DriverRegistrations.GetByDataRow(dataView[0].Row) as IDriverRegistration;

    
Console.WriteLine(String.Format("Addin {0} is  registered and is {1}.", driverRegistration.AddinName, driverRegistration.DriverStatus.ToString()));
}
else
{
    Console.WriteLine(
"Addin not found");
}

Yes, last week we announced the public beta of Office Accounting 2007, which is pretty cool because we've been working very hard on this version (since before the previous version was on the shelves). The biggest news is the product name change (does that mean I should change the name of my blog?) and I really can't say much about that because I'm a developer and for some reason we don't name products (marketing people do). Our General Manager, Rajat Taneja talks about this on his blog.

To download Office Accounting 2007 beta go here.

The closest thing to a list of what's new in this new version is here.

For developers:

We don't have the Software Development Kit for this version yet, but you can always look into our new API once you install the products. The most insteresting feature is probably our versioning and our Loader interfaces, and once you understand that, you'll be ready to start using the API of the new version. I will try to get into more detail in the future. Send your feedback!

 

I must confess I'm a little rusty in my VB because I don't use it often enough. But I wanted to post this sample in Visual Basic .NET. I used the Code Translator from CarlosAg and it worked perfectly, except that it couldn't translate the implicit convertion of an int to a string when this is used in a string operation. In my original post I explain about what this sample does and here is the code:

Public Sub FindKitsThatContainMyItem()
    Debug.WriteLine(
"Finding Kits that contain 'Snow Sports Helmet, Adult'"
)

    
' use DataView to find all Kit Items
    
Dim itemsDataView As DataView 
utilitiesInstance.SbaInstance.ItemAccounts.DataView
    itemsDataView.RowFilter 
("AccountTypeID=" CType(AccountType.KitItemAccount, Integer
).ToString)

    
For Each dataRowView As DataRowView In 
itemsDataView
        
Dim kit As IKitItemAccount = CType
(utilitiesInstance.SbaInstance.ItemAccounts.GetByDataRow(dataRowView.Row), IKitItemAccount)
        
For Each kitMember As IKitMember In 
kit.KitMembers.ChildList
            
If ((Not (kitMember.NonKitItemAccount) Is 
Nothing) _
                
AndAlso (kitMember.NonKitItemAccount.Name "Snow Sports Helmet, Adult")) 
Then
                
Debug.WriteLine(kit.Name)    
            
End If
        Next
    Next
    
Debug.WriteLine("-------"
)
End Sub

You can get the sample from here. I hope you find this useful.

I am a volunteer to be a job shadow for the DigiGirlz camp that Microsoft organizes every year. It is a wonderful idea and I'm also passionate about getting more women into Computer Science or Engineering. I couldn't find a lot of info about this externally, but there is a recent article that talks about it here.

This is my second time around and this year, they have increased the time that girls have for coming to my office and hear me explain about my job and how I got here. I'm excited because this year they have included girls from different other states and I will have two high school students over. My plan is that I spent half the time doing my job and the other half talking to them and explaining in more detail about what I do as a developer at Microsoft. I got their essay (this is needed to be selected to be a DigiGirl) and a form where they have to answer a couple of questions about the job shadow experience. For one question, they had to rank in order of preference the different jobs at Microsoft, and one of them put Developer position as number 1 and the other as number 4. Cool, so I'll show them about writing code and problem solving!

The other interesting question for me is to also rank their job shadow expectations, and it is important to read this to try to focus on some of the things that they expect. Here are the top 4 things I will try to touch on tomorrow:
- skills needed for the job
- learn more about Microsoft as a workplace
- how much education do they need to get this job
- see how technology is used in my job

This is interesting because the two that I would be more interested are:
- see how the knowledge I am gaining in school is used in the job
- see what people do all day on the job

When I was in highschool little did I know that I would end up in this position and doing what I did. I actually was tired of taking many classes that I never thought I would need (like accounting). I also want to hear about what they have been doing in the camp (I really have no idea about that).

0 Comments
Filed under:

We always try to think about the person that is going to ultimately use our SDK but the reality that is that we not always end up receiving all the feedback that we should. When someone is just starting to use our SDK, they do ask us questions (through our newsgroups) or they use our ISV program, but once they are up to speed, I've never heard their feedback or questions. I was personally responsible for the design of the UI AddIns for SBA and I tried to make a very straight forward API that used XML (so it can be extended in the future) and a universal method called DoAction, to call the Addin back after the user did an action. I don't know if there are any solutions out there that use them or not.

So far, we have a directory that lists the different SBA solutions from ISVs that are part of our program (the directory we have is here). If you are indeed developing using our SDK, please let us know what you think and what we did wrong.

Yes, on August 4th, 2003 I went to the New Employee Orientation. I had just finished my bachelors degree from ITESM Campus Monterrey and was moving to start my career at Microsoft. I had been an intern twice, but the first team I interned at didn't exist anymore and the second team I interned with didn't really appeal to me. I wanted to find a smaller team to work in and I found Business Contact Manager for Outlook. I had talked on the phone with the person that was going to be my lead and I didn't know much about the product, except that it was designed for small businesses. In my first week, as part of my ramp up, they ask me to take a look at BCM v.1 in spanish to find grammatical errors (which I did). I spent 2-3 months learning about different grid components in .NET and prototyping different approaches for the BCM report engine. Then, I moved to SBA.

When I got to SBA I was still ramping up on my new job at Microsoft and I wasn't involved in the top level architecture of the product. Rajat Taneja, our GM blogged about what happened in this period here. I got to work on the grid component for SBA (because of my experience with that). I was in the UI Infrastructure team and I joined SBA too late to enjoy a trip to Denmark (as other coworkers did). I'd say that I joined just in time to participate in the genesis of the current architecture used by SBA.

And ever since then, I've been here as a Developer in the SBA team. Some people have come and go. We shipped SBA 2006. I'm working on the next SBA release. I got my first patent cube at Microsoft. I recruited my best friend from college to SBA. And now, I even got a blog.

0 Comments
Filed under:

This is a quick sample I put together after a post in our newsgroups. I don't think we have this functionality but I could see that some users (especially those with thousands of items in their inventory) could use this. So this sample is to show how the classes in our SDK will allow you to have this functionality. I'm going to use the LoggingIn sample from our SBA SDK that takes care of initializing the ISmallBusinessInstance for me. I'm going to use SBA's sampleproductcompany (Northwind Traders) and for this sample, I'm going to look for Kits that contain the "Snow Spors Helmet, Adult" item.

public void FindKitsThatContainMyItem()
{
    Debug.WriteLine("Finding Kits that contain 'Snow Sports Helmet, Adult'");
    // use DataView to find all Kit Items
    DataView itemsDataView = utilities.SbaInstance.ItemAccounts.DataView;
    itemsDataView.RowFilter = "AccountTypeID=" + (int)AccountType.KitItemAccount;

    foreach (DataRowView dataRowView in itemsDataView)
    {
        IKitItemAccount kit = utilities.SbaInstance.ItemAccounts.GetByDataRow(dataRowView.Row) as IKitItemAccount;

        foreach (IKitMember kitMember in kit.KitMembers.ChildList)
        {
            if ((kitMember.NonKitItemAccount != null) && (kitMember.NonKitItemAccount.Name == "Snow Sports Helmet, Adult"))
            {
                Debug.WriteLine(kit.Name);
                break;
            }
        }
    }

    Debug.WriteLine("-------");
}

I'm not using any UI in this sample, so the next step for anyone interested in this functionality will be to create a SBA UI Addin that exposes this functionality in the Item Form, shows a list of Kit Items and then allows you to open those forms. If anyone is interested in that, please let me know and I'll post some sample code for doing that.

I recently started reading and participating on our SBA SDK newsgroup on a regular basis. Before, I only went there from time to time. I'm glad that many customers and developers go there to ask questions and post suggestions, because we really read them and go through them. Recently I found a post about our Business Logic Addins and about how it was a bad experience if we wanted to do a validation because we showed one of the most horrible error messages (with a callstack) to the end user. After looking at this issue, I thought about how to solve this and then I fired an email to other people on the team so we could address this for a future version.

Then, yesterday, I found an interesting post from 'Old Blind Dog' that  wanted to know how to find which kits in your company contained a particular item. A real scenario that our product doesn't have BUT you can do this with our SDK, so I put my work aside for a second and tried to do this using our classes and C# and voila! I got a 20 line sample for doing this. Of course, this doesn't include the connectivity to SBA and all that, I just simply modified one of the existing SDK Samples. Now I just need to post the sample and try to get him to start using our SDK. Anyway, I'll post later the sample, I need to do some other work to meet my deadlines.

More Posts Next page »
 
Page view tracker