Speeding up lookups with Advanced Lookups in Microsoft Dynamics GP

Dynamics GP provides a very robust functionality in lookup windows for finding data such as accounts, vendors, customers, items, and more. Various fields can be used for sorting or searching and some additional fields are always provided by default. However, if all of that is not enough, Dynamics GP provides an option for administrators to add additional fields to lookups. This recipe demonstrates how to accomplish that.

Before using Advanced Lookups they need to be set up. Up to four custom lookups can be created for each type in the system. We will do this as follows:

Select Administration on the Navigation Pane, and under the Company heading select Advanced Lookups.
On the Advanced Lookups Setup window use the drop-down menu to select a Lookup Name.
For our example, select Customers. In the first Sort by Field drop-down menu scroll
down and select Zip.
Change the Description to Zip Code.
Click on Save to save the lookup and close the window.
These setup steps add a lookup based on zip code to any place whereCus tomer s are
selected in the system:

8 Ways to Gain Financial Stability

People always complaint about their financial instability, but they don’t do anything by themselves to make their bad financial state good. If they take care of only few little things, then they can get financial stability. Though, it’s not easy to gain a stable financial state, as it takes years to reach financial stability. But with only a little wise planning and consistency, people can become financially strong. Following are 8 effective ways by which you can become financial strong, let’s have a look on them.
FinancialStabilityCircle

Spend Less – Save More

Always try to less than what you actually earn. That’s because the less you spend the more you can save, and the more you save the more you become financially strong. Financial problems arise from the point, where people spend more than they earn. So try to avoid it as much as you can.

Follow a Budget

This should be included in your financial routine in any way. Prepare a budget that suits you and then follow this budget. Budget also helps you to keep a record of your spending. A settled budget will not allow you to spend more and it will restrict you to spend on unnecessary things.

Cut Off Luxuries

Check your earnings and then decide that do you really need to spend on luxuries even if you can live without them. For instance, if you can live with small 22” TV, then why do you want to purchase 52” TV? Etc.

Save Something for Rainy Day

Wow! What a true old saying. Even if you save little money in a separate account, it will work for you after retirement. So let the time work for you and save so9mething for rainy days.

Do You Have Extra Income?

Try to save your bonuses, tax refunds, or any other saving into a saving account separately. Try not to spend this income and forget it when the itch of spending this money rises in your hand.

Open a Roth IRA

Open a Roth IRA and contribute to it. You can take out the principle amount without any penalty if you have a backup fund for this. The amount that you have contributed to this account is after tax and the interest that you’ve earned on it is not tax deductible if you take it out after the age of 50 ½.

Prepare a Back up Fund

Keep this fund reserve for emergencies only. For building up this back up fund, start saving little amount every month or as per your convenient. Don’t touch this fund without any emergency.

Save Money for Major Purchases

If you want to purchase big items, then you should have a separate saving coffin for them. When you saved sufficient amount to purchase big items, then go to purchase them otherwise make your life habitual to live without them as long as you can.

Share



Read more: 8 Ways to Gain Financial Stability | Credit Card Debt And Debt Consolidation Solutions http://www.loandebtsolution.com/finance-2/8-ways-to-gain-financially-stability/#ixzz10cMInjMb

Speed Up Windows 7

Windows 7 is Engineered for speed. Special attention has been given by the Windows 7 team for making Windows 7 faster than the previous operating systems. Windows 7 is much faster than Windows Vista, but even then most of us don’t get satisfied with it. There are many who still have their old PC. Installing Windows 7 on them wont be as soothing as they work with with XP and Even with latest hardware’s installed some users still long for more performance. At least if we don’t make it lightning fast we can optimize Windows 7 to the maximum possible extent and enjoy the maximum performance we could squeeze out from it. 


speed up windows 7 meter Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!

I guarantee that after following this guide and implementing the recommendations on your PC, you will really get the performance gain.



The bare Minimum Requirements You need To Run Windows 7


1) 1GHz processor (32- or 64-bit)
2) 1GB of main memory
3) 16GB of available disk space
4) Support for DX9 graphics with 128MB of memory (for the Aero interface)
5) A DVD – R/W drive

Even if you don’t have the DX 9 graphics card there is no problem because our target is performance and not the ” Eyecandy ” . Of course if you need the aero experience you need a powerful graphics card for sure.
So lets start The Ultimate Guide to Speed up Windows 7
  1. Disabling the Search Indexing Feature in Windows 7

    • Right Click the “Computer” Icon in the desktop and select “Manage”.
    • Click “Services and Applications” in the “Computer Management”  window.
    • Click on “Services”.
    • You can see a lot of services listed there. Look for “Windows  Search” in that.
    • disable search indexing in Windows 7 Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!
    • Right Click on “Windows Search” from the list and choose  “Properties”.
    • The “Windows Search Properties Window” will open up. From “Startup  type” click on the drop down menu and choose “Disabled”.
    • Click “Apply” then “OK” and that’s it. The Windows 7 Search Indexing  Feature is now disabled.
    Most of the Windows 7 users do less searches in there system. The  Search Indexing service in Windows 7 will index keeps track of the files  so that they can be found quickly when asked at some other time. This  feature is useful only if you perform frequent searches on your system. For occasional file searchers the Search Indexing service in Windows 7  is a total resource hog. It unknowingly eats up your system resources.  What you need from windows 7 is maximum performance from it then i would  certainly recommend you to disable this resource hogging Windows 7  Search Indexing Feature. To Disable the Search Indexing Feature in Windows 7 If you want to completely disable the search indexing feature in  Windows 7 you can set the Search Indexing Service to Manual (See the  above method about disabling unwanted services).
  2. Disable the Aero Theme on Windows 7

    • Right Click on your Desktop and select ” Personalize ” click the Window Color Tab.
    • Uncheck the Box saying ” Enable Transparency ” and then click on ” Open classic appearance properties for more color options”.
    • Then a window will open up. Apply a Standard or Basic theme from it. The Standard Windows 7 theme is more preferred.
  3. The aero user interface certainly adds some ” Eyecandy ” to Windows 7 but certainly is a resource hog especially when, what you expect from windows 7 is more performance juice. Aero user interface squeezes your graphics or video card to its maximum. So why dont we just avoid the Windows 7 aero? if we care more about speed and performance in Windows 7. So Disabling the Aero in Windows 7 certainly adds an extra speed boost to it. disabling aero Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!! Disabling the aero theme alone in Windows 7 will really speed things up. You can know this by looking into the memory consumption when aero is turned on and off.
  4. Disabling the Unwanted Visual Effects in Windows 7 to Speed Up more

    • For this right click on ” Computer” and select “Properties” from the right click menu.
    • Click on ” Advanced System Settings ” from the left pane to open up the ” System Properties ” window.
    • Select the “Advanced” tab from it. Then Under ” Performance ” click ” Settings “. Choose ” Custom: ” Options From it.
    • Now un tick all the options and select only the last four options (actually three only needed; you can un tick the second option from the last four). See the screen shot if you have any doubt.
    • Now just logoff your system and turn logon.
  5. Even though we have tuned off the aero effects in Windows 7 still there are many unwanted visual effects that can be safely disabled to speed up windows 7 even more. disabling services in windows 7 Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!! You will now notice the speed difference now.
  6. Disabling the Unwanted Services to Speed up Windows 7

  7. There are many services in windows 7 that we dont require for our daily use. There are some exceptional cases though. Services such as “print spooler” is only needed when we use a printer. If we use a printer only occasionally we can safely turn off that service in Windows 7 and turn it on only when we need to take a print I have previously prepared a List of services in Windows 7 that can be safely set to manual / disabled.  Disabling the unneeded services in Windows 7 can really speed up the system boot time.
  8. Disable the User account control (UAC) Feature in Windows 7

    • From the  Control Panel open the ” User Accounts and Family Safety ” > User Account.
    • Click the User Account Control settings link.
    • Now just Drag the Slider towards “Never Notify”.
    • Click “OK” and Reboot your system.
  9. The User account control (UAC) feature in Windows 7 is very annoying though it says it can protect your computer from harmful virus activity etc. But if you are a daily user of your computer this windows 7 feature will be a total nuisance to you. To Disable and Turnoff UAC in Windows 7disabling uac in windows 7 Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!! Disabling UAC is for advanced users only its not recommend doing it if not.
  10. SetUp the Windows 7 Ready Boost Service for an Extra Speed Boost

    • To configure the Ready Boost Feature in Windows 7 you need to have a High Speed Flash/USB or Pendrive with you which is ready boost compatible.
    • After plugging you pendrive, open “Computer” > Right-click the on USB Drive/Pendrive > select “Ready Boost” tab > tick the “Use this device” checkbox.
    • You can configure how much space on your USB drive/ Pendrive to be used as Ram.
  11. The ready boost feature in Windows 7 will help you to use your flash drive or pendrive or USB drive as Ram there by improving the performance and speed of windows 7 greatly. You can certainly experience it when launching bulky applications such as Adobe Photoshop etc. Speed Up Windows 7 with Ready boost Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!
  12. Turn off Unused Windows 7 Features

    • Open up ” Programs and Features ” from Control Panel.
    • Click the ” Turn Windows features on or off ” from the left pane.
    • Now uncheck all the Feature that you don’t use in Windows 7 and restart the system for the changes to take effect.
  13. There are many feature in windows 7 that we often don]t use. Disabling these unused features in Windows 7 will really help in speeding things up.
  14. Disable the Windows 7 Sidebar (Actually the Gadgets)

    • Right click on the sidebar and select ” Properties “.
    • On the properties windows untick the check box showing ” Start sidebar when Windows Starts “
    • From now on windows sidebar won’t start when windows 7 start up.
  15. Disabling the window 7 sidebar is definitely help you to to gain a few seconds during start up time. There are many useful utilities such as the RocketDock etc. which are good application launchers. To Disable the Sidebar in Windows 7,
  16. Disable the Aero Peek and Aero Snap features in Windows 7

    • Open the Windows 7 ” Control Panel ” and double-click on ” Ease of Access Center ” icon.
    • Now click on the ” Make it easier to focus on tasks ” seen at the bottom in there
    • Now untick the check box saying ” Prevent windows from being automatically arranged when moved to the edge of the screen ” .
    • Right click on the Windows 7 taskbar and select ” Properties “.
    • Now untick the ” Use Aero Peek to preview the desktop ” option from there.
  17. Aero Snap will help you to maximize, minimize and resize the windows just by dragging and dropping it into the screen corners. To disable Aero Snap Feature in Windows 7, That will now disable the Aero Snap in Windows 7. Now To Disable the Aero Peek feature in Windows 7 The Aero Peek feature in Windows 7 helps you to peek through all open windows by hiding all other windows and showing only the outlines of all windows. Aero Peek is similar to the ” Show Desktop ” Feature in XP and Vista. If you have followed step 3 then Aero Peek will be automatically disabled. If not, The aero peek feature will now be disabled in windows 7.
  18. Change the Power Plan To Maximum Performance

    • Double click the ” Power Options ” in the Control panel.
    • Click the down arrow showing ” Show Additional Plans ” to see the ” High Performance ” power plan
    • .
    • Now just activate the ” High Performance ” plan and that’s it.
    • You may go for the advanced settings for further tweaking if you want.
  19. The Power settings in Windows 7 is not automatically set for maximum performance. By default the power plan in Windows 7 is set for a balanced performance with energy consumption on hardware. So you may not get the optimal performance from windows 7 if this is the case. So we need to change the power plan to High Performance Mode. power plan in windows 7 Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!
  20. Disable the Thumbnail Preview Feature to speed up File browsing in Windows 7

    • Double Click on ” Computer ” >click on the “Organize” drop-down menu and select the “Folder and Search options”
    • Under ‘Files and Folders’ section, go to the “View” tab and tick the check box showing “Always show icons, never thumbnails” checkbox.
  21. The thumbnail preview feature in Windows 7 will show the small thumbnails of the contents of a folder instead of showing it’s icon. But this feature really do take up some system resources. So by disabling the Thumbnail Preview feature in Windows 7 the file browsing in Windows 7 explorer can be speed up. disable thumbnail previews Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!For disabling thumbnails in Windows 7,
  22. Most Essential Softwares To Speed Up Windows 7

  23. In order to maintain your Windows 7 Performance and keep it up in Top Shape there are some very essential software’s that can help us to Speed Windows 7. I will list some of them here. You can download these utilities. But i remind you that you need to run these utilities at least once in a week. Only if you do it regularly your Windows 7 will be in top shape every day. You can read this post which i have prepared earlier about the Top 5 Tools To Speed Up Your PC. http://www.computingunleashed.com/2009/05/top-5-tools-to-speed-up-your-pc-to.html There you can know more about these software i mentioned now.
  24. Registry Tweaks to Speed Up Windows 7

  25. Here are some registry  teaks that can be used to speed up windows 7 even more. I have complied only the safest tweaks that can be applied to your PC. Apart from speeding up windows 7 they will also add some functionality in windows like adding Copy to / Move to in right click context menu to speed up your daily tasks. http://www.computingunleashed.com/2009/01/registrytweaks-for-speeding-up-windows.html If you have the complete version of Tune Up Utilities software with you then it is the best one to keep your Windows 7 in top shape.
  26. Turn OFF Windows 7 Password Protection To save a few More Seconds!!!

  27. If you have set a password for accessing your user account in windows 7, then you need to enter it each and every time you logon to windows. Logging into windows automatically without entering any password will save you a few seconds more. If you are the only person who use your computer then i would recommend to turn this off. If that is not the case you can skip this step. How to Automatically Logon to Windows 7 without entering any username or password
  28. Turn OFF Windows 7 Screen Saver and Wallpaper

    • Right click on desktop and choose “Personalize”.
    • Click the Screen Saver link ” From the Screen Saver drop down menu, Set it to “None” and click “Apply” and then “OK”.
    • Now click on “Desktop Background” link.
    • From the “Location” drop down menu select “Solid Colors” and pick one color and click “OK”.
  29. In order to display the wallpaper and screen saver the system needs some memory. So by disabling those two we can save a few Mega Bytes of memory. To Disable The Screen Saver and Wallpaper in Windows 7,
  30. Disable Unwanted Start Up Items and Speed Up Windows 7 Start Up

    • Type ” msconfig ” in the “RUN” option from start menu press [Enter] to open up the System Configuration Utility.
    • Now navigate to the “StartUp” tab.
    • Untick the Entries which are not needed
  31. This really matters when you have installed a lot of softwares on your PC. Many software such as AcdSee will run services such as device detector etc during the system start up. These are of no use actually for most windows users. So preventing such services from starting up during the start up of windows 7 can result in quicker start Ups. This will actually save some seconds during windows 7 start up.
  32. Disable Unwanted System Sounds in Windows 7

    • Type mmsys.cpl in RUN From the Windows 7 Startmenu search box and press [Enter].
    • Navigate to the “Sounds” tab.
    • Now from under “Sound Scheme:” select “No Sounds” > Click “Apply” > “OK”.
    • You can keep some of your favorite sounds turned on if you want, but sounds played during the Windows 7 start up, shutdown, Logon, logoff, start navigation etc should be set to none if you want some real speed boost.
  33. In order to play the sounds you hear in windows 7, system resources are being utilized. So if you can disable these sound effects you can gain some speed and also free some system resources too. To disable the system sounds in Windows 7, disable sounds in windows 7 Speed Up Windows 7   Ultimate Guide To Make Windows 7 Blazing Fast!!!

Programming in Microsoft InfoPath 2010

How to add business logic to your forms using managed code.
Imagine a scenario where the accounting department at Contoso, Inc. tracks corporate assets through an Asset Management System built on SharePoint. One module in the system allows employees to order office equipment such as laptops, conference phones, and ergonomic chairs through an InfoPath form. At first, the order form was built using only declarative logic. It could enforce required fields, surface validation messages, and submit the form to SharePoint without any code.
As the ordering process grew more complex, users started adding additional requirements to the system. The variety of inventory available to employees increased, so they wanted a way sort items by name and description real-time in the order form. Contoso also started shipping their office equipment out of three warehouses. This prevented the warehouse crew from fulfilling complete orders, and as such, the system needed to track shipping status and quantity of individual items in the order. To meet the new requirements, Contoso added the following features to the form:
  • A custom sort interface
  • Logic for managing complex data when the form is submitted
  • Logic to add items to a SharePoint list
Sort interfaces, sophisticated submit routines, and database (i.e. list) management are common requirements for forms. Fortunately, this functionality can be added to InfoPath forms with a few lines of code. Let me explain these features, the code required to build them, and the prerequisites for developing managed code in InfoPath in more detail.
Equipment Request Form
The employee orders module in the Asset Management system consists of three core components:
  1. A SharePoint form library, “Equipment Orders”, where users go to fill out the Equipment Order Request form shown below.
  2. A SharePoint list, “Equipment Inventory”, which stores the items available for users to order. This list contains fields specifying items’ names, descriptions, and quantities used to populate the Equipment Order Request form.
  3. A SharePoint list, “Equipment Shipping”, which stores a list of items ordered by users that have been scheduled for shipping. This list contains fields for the names and quantities of items being ordered as well as the name of the user who placed the order.
The Equipment Request Form enables users to sort through Contoso’s available inventory and submit a request to the warehouse for shipping.
Description: Equipment Order Request Form
The order form is a repeating table, where each row in the table represents the name, description, and quantity of the item being ordered.
Description: Equipment Order Request Form 
Sorting data in the form
The Equipment Order Form has a Picture Button Control displaying an arrow next to each of the column labels.
Description: Equipment Order Request Form
The buttons are used to sort the order items in ascending order by the respective column. When the user clicks the button, the values in the selected column are compared, and the rows of data are sorted based on the comparison result.
The sorting routine in this example is based on a complete solution provided by Hagen Green.  Read through his post to learn how to provide a descending sort which also takes localization and data types into consideration.
private string GetValue(string xpath)
{
  // return the value of the specified node
  XPathNavigator myNav = this.MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager);
  if (myNav != null)
    return myNav.Value;
  else
    return "";
}
private void Swap(string xpath1, string xpath2)
{
  // swap two rows of the table
  XPathNavigator item1 = this.MainDataSource.CreateNavigator().SelectSingleNode(xpath1, NamespaceManager);
  XPathNavigator item2 = this.MainDataSource.CreateNavigator().SelectSingleNode(xpath2, NamespaceManager);
  if (item1 != null && item2 != null)
  {
    // Make a copy of item1
    // Move item2 to item1
    // Make the original item2 be item1 that we cloned earlier
               
    XPathNavigator item1Clone = item1.Clone();
    item1.ReplaceSelf(item2);
    item2.ReplaceSelf(item1Clone);
  }
}
private void SortOrder(string sortBy)
{
  string itemsToSort = "/my:myFields/my:Order/my:OrderItem";
  XPathNodeIterator items = this.MainDataSource.CreateNavigator().Select(itemsToSort, NamespaceManager);
  if (items != null)
  {
    int numItems = items.Count;
    // basic bubble sort implementation
    for (int i = 1; i < numItems; i++) // xpath is 1-based
    {
      for (int j = i + 1; j <= numItems; j++)
      {
        // swap (i,j) if necessary
        string iValue = GetValue(itemsToSort + "[" + i + "]" + sortBy);
        string jValue = GetValue(itemsToSort + "[" + j + "]" + sortBy);
        if (String.Compare(iValue, jValue, true) > 0)                      
          Swap(itemsToSort + "[" + i + "]", itemsToSort + "[" + j + "]");
                       
      }
    }
  }
}
public void ItemNameSort_Clicked(object sender, ClickedEventArgs e)
{
  // Sort order by ItemName
  // Repeat this code for the other buttons
  string sortBy = "/my:ItemName";
  SortOrder(sortBy);
}
Managing complex data during submit and updating SharePoint lists using the SharePoint object model
The user is eventually going to finish selecting items and submit the order. Each item ordered through the form is handled independently because, for example, an item in the order may be delayed or shipped from a remote warehouse. So, we need submit logic which will break up the complex data (i.e. the repeating table of items being ordered) into individual rows, and add a shipping request to the Equipment Shipping list for each item-quantity pair. After an item is added to the Equipment Shipping list, a SharePoint workflow is used to track status and manage the Inventory Equipment list’s quantity values.
  1. The first thing you’ll need to do is use the Submit Options button on the Data tab in the ribbon to add a custom submit handler to your VSTA project.
Description: Submit Options
  1. Add a reference to Microsoft.SharePoint.dll to your VSTA project. This will allow you to develop code using the SharePoint object model. This DLL is installed in %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\ISAPI with your licensed copy of Microsoft SharePoint Server.
  2. Add custom submit logic to create a SharePoint list item for each item in the order form. See the code below for an example, and notice the use of the ServerInfo class. The ServerInfo class is new to InfoPath 2010 and allows you to write portable code with relative references to SharePoint server URLs.

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{
  // Loop through each item-quantity pair in the order form.
  // Submit pairs to the Equipment Shipping list.
  // Note: Workflow will handle updating item quantities and track shipping status.
  using (SPSite mySite = new SPSite(ServerInfo.SharePointSiteUrl.ToString()))
  {
    using (SPWeb myWeb = mySite.OpenWeb())
    {
      XPathNodeIterator orderItems;
      if (myWeb != null && myWeb.Lists["Equipment Shipping"] != null)
      {
        SPList shippingList = myWeb.Lists["Equipment Shipping"];
        myWeb.AllowUnsafeUpdates = true;
        orderItems = this.MainDataSource.CreateNavigator().Select("/my:myFields/my:Order/my:OrderItem", NamespaceManager);
        if (orderItems != null)
        {
          while (orderItems.MoveNext())
          {
            // Add rows from the form where user selected an item and specified a quantity.
            string itemName = orderItems.Current.SelectSingleNode("./my:ItemName", NamespaceManager).Value;
            string itemQuantity = orderItems.Current.SelectSingleNode("./my:ItemQuantity", NamespaceManager).Value;
            if (itemName != string.Empty && itemQuantity != string.Empty)
            {
              SPListItem shipItem = shippingList.AddItem();
              shipItem["Title"] = itemName;
              shipItem["Quantity"] = itemQuantity;
              shipItem.Update();
            }
          }
        }
      //cleanup
      //signal successful submit
      //return
      myWeb.AllowUnsafeUpdates = false;
      e.CancelableArgs.Cancel = false;
      return;
      }
    }
  }
}
Along with the features covered above, you’ll find that code is useful for implementing complex data validation logic and managing content from multiple data sources. Such requirements are especially common when your forms are part of an advanced application. You can learn more about validation and working with the InfoPath DOM in our MSDN XmlEvent. 
If you’d like to get started with programming in InfoPath, then please read on. The rest of this post introduces our system requirements, integrated development environment, and programmability user experience.
How to add code to an InfoPath form
To add code to an InfoPath form:
  1. Make sure you meet the minimum system requirements.
  2. Install Visual Studio Tools for Applications (VSTA).
  3. Choose a programming language.
  4. Add event handlers and code.
Minimum system requirements
The minimum system requirement to get started with InfoPath 2010 development is Microsoft .NET Framework 2.0, but we suggest you install Microsoft .NET Framework 3.5 SP1 if you’re developing for the SharePoint platform. You can install all versions of Microsoft .NET Framework from http://www.microsoft.com/downloads.
Installing Visual Studio Tools for Applications
Visual Studio Tools for Applications (VSTA) is an optional installation component available in Microsoft Office 2010 setup. To install VSTA:
  1. Launch Office 2010 setup from your Office 2010 installation media or from the Control Panel Programs and Features application.
  2. If you’re installing a new copy of Office 2010, click the Customize button in the installer. If you’ve already installed Office 2010, choose the Add or Remove Features radio button in the installer.
  3. Set the Visual Studio Tools for Applications option to Run from My Computer and continue through the setup wizard.
Description: Office Setup
Choosing a programming language
InfoPath 2010 allows you to program in C# and Visual Basic .NET. If you want to program with Visual Basic, you do not need to do anything to select your programming language when designing InfoPath 2010 compatible forms. If you plan on programming with C#, or adding code to InfoPath 2007/2003 compatible forms, you can change the programming language by clicking the Language button in the Code group of the Developer tab.
Description: Developer Tab
After you click the Language button, you can change your programming language by using the Form template code language drop down:
Description: Form Options
Hint: You can change the default language for InfoPath 2010 compatible forms by using the Options menu in the Backstage.
  1. Click the File > Options tab
  2. Click the More Options button in the General category of the InfoPath Options dialog
  3. Change the Programming language dropdowns in the Programming Defaults section of the Design Options
Description: Options
Adding event handlers
The Developer tab is the primary entry point for programming in InfoPath 2010. It’s designed to help you add event handlers compatible with the controls and mode of the form you are designing. For example, if you don’t have a control selected on your form view, then you’ll only be able to select the events that apply to the entire form. Notice that the Loading and View Switched event below are enabled, but the entire Control Events group is disabled.
Description: Developer Tab
But, as soon as I select a text box on the form, the Control Events group lights up.
Description: Developer Tab
Notice that the Sign, Context Changed, and Changing events are disabled in both screenshots of the Developer tab. That’s because I’m working with a browser compatible form, and those events are only available for InfoPath Filler forms.
Note: You’ll find a table of all events, and their compatibility, towards the end of this section.
Certain control and form programming events can be accessed through buttons on other tabs in the ribbon. If you add a Picture Button control on the form view, highlight the button, and then click on the Properties tab then you’ll find the Custom Code button enabled. Clicking the Custom Code button in the ribbon will add an OnClick event for the Picture Button control.
Description: Custom Code Button
In the Equipment Order Request form, we added a Submit event handler to add items to a SharePoint list. To do this, navigate to the Data tab, and click the Submit Options button in the Submit Form group.
Description: Submit Options Button
This will launch the Submit Options dialog where you can check “Allow users to submit this form”, “Perform custom action using Code”, and then click the Edit Code button.
Description: Submit Options
The Fields task pane is another main entry point to add event handlers. In the next screenshot, I access the Validating and Changed events for ItemDescription by right clicking the field in the Fields task pane and scrolling through its context menu.
Description: Fields Taskpane
The following tables provide a list of all events and compatibility in InfoPath 2010. Note that InfoPath forms trigger three types of events: Form Events, Data Events, and Button Events. Aside from the button event, InfoPath event handling is different from other web programming paradigms (e.g. WinForm and HTML forms); events are fired when the data changes, not when control state changes. As such, you should consider the optimal configuration for your forms’ post-back settings to provide the best performance while still ensuring that events get fired when necessary.
Description: Tables
After you’ve designed your form and authored the source code, the final step is to publish the form. Your InfoPath form with code can be published to SharePoint and to client machines, but you need to make a security decision before you publish: configure the form as domain trust or full trust.

Domain trust forms can be published to SharePoint as Sandboxed Solutions directly from the InfoPath 2010 Designer. With Sandboxed Solutions, SharePoint Server farm administrators can restrict the resources available to the code and developers cannot access resources subject to operating system security. This establishes a safe environment where Site Collection administrators can publish code to SharePoint without the overhead of administrator approval!
Note: Publishing full trust forms to a client-side environment requires that the form is signed with a code-signing certificate or installed through a custom MSI built in Visual Studio. Publishing a full trust form to SharePoint requires a farm administrator to activate the solution through the SharePoint Central Administration portal.
Best Practice: You should always use the lowest level of trust possible when publishing forms.
Summary
Most forms you design with InfoPath 2010 are not going to require code, but when they do, just install Visual Studio Tools for Applications and you’re ready to start programming. To add code, select the language of your choice, and use entry points in the Ribbon and Fields task pane to automatically insert event handlers. Finally, decide whether or not your form requires full-trust, and publish it to SharePoint or a client environment accordingly.