Saturday, July 12, 2008

SharePoint Billing Scenario


Purpose:

  • To create a “normalized” SharePoint list structure for tracking client billing.

Scenario:

  • 2 Lists are need to track basic billing:
    1) Billing Rates
    2) Billing Items
    **Billing Items will have a look up column on Billing Rates List

Goal:

  • Calculate Billing Item Charge Column by retrieving the value of the selected Billing Rate.

Solution Summary:

  • Create a workflow and attach it to all new and edited items in Billing Items.




First, lets look at the two custom list structures.

  • Billing Rates

  • Billing Items


  • This is how the “Charge” column was created using the “calculated” type.


*Note: the calculation is created BEFORE the workflow is created and attached.




Now the fun part, create a basic workflow to copy the Rate Value from the Billing Rates into the [Billing Items].Rate Value

  • In SharePoint Designer with the Site Open, Create a new Workflow


  • In the “Define” Wizard Window: name it; select the SharePoint list, and check all boxes.



  • Name The Step (here it’s called “Update Rate Value Column” from “Step 1”) and pull down Conditions and click on “Compare Billing Items Field”


  • Set Conditions as a catch for invalid workflow process, here we will change field to “Quantity” and value to “0.00”


  • Pull Down Actions and choose Set Field In Current Item


  • Click on “field” and choose Rate Value and then click on “value” then the “Display Data Bindings Button” marked with a “fx” icon.

  • In “Lookup Details” - Change the Source to “Billing Rates” and select field: “Rate Value” and in “Find the List Item” select the field: Billing Rates:Title (this is where the intuitive would expect to select “Billing Rates:ID” – don’t fall into this trap).



  • In “Find the List Item” – Click on the function button marked with an “fx” use Soruce: Current Item and select “Rate Name” for Field.


  • Click Yes on the Warning Dialog Box
  • Click Finish to complete the Workflow creation




Now let’s check if the workflow is working properly

  • Create 1 or 2 Billing Rate Entries
  • Switch to the Billing Items List and create a new billable item.

  • Enter the some data, but ignore the Rate Value entry.
  • On “OK”, you are returned to the list and the workflow has been initiated. Note: on first workflow initiation, you may need to refresh the list after a minute or so.


Notice that rate value (necessary for invoices) has been copied from Billing Rates, and the Charge is calculated in the list itself.