Saturday, December 29, 2012

Microsoft Project Calculated Fields

I have been working with Microsoft Project and managing projects my entire career in systems which has run a total of 25 years. I usually enter the base task information, predecessors, etc and let Project handle its majic. I have a need to enter more information into project like total project hours, total development hours but do not always have the testing hours to complete the equation. I thought it would be great if Project could calculate the testing hours by subtracting development hours from total hours. Oh, but I knew  that Project did not support calculations.

Well, I was wrong. I googled calculations and I found this wonderful site that told me how to do exactly what I wanted to do. The site is Wise Owl and the post was from Andrew Gould at http://www.wiseowl.co.uk/blog/s151/custom_fields_in_microsoft_project_pt3.htm.
This was very helpful post and a great place to go to get helpful Microsoft Project answers. Now I know that there are a large number of options available to me when inserting custom columns into Microsoft Project.

Sunday, April 8, 2012

Determining what to pass back to ExtJs from ColdFusion

ColdFusion developers who do not know PHP are at a disadvantage learning ExtJS. They can play with the examples on the Sencha examples page but when they try to run the examples from their own desktop the PHP queries to the database or flat files will not work. Why? Because you are not running the PHP server on your desktop. What do you do? Well you turn on firebug, run the example, click on the NET panel on firebug, click on XHR, find the get request, expand it, look at the response and then try to emulate it. Here is an example response for a tree view:

[{'text':'Jewelry','id':'1',"cls":"folder"},{'text':'Vintage Clothing and Accessories',
'id':'2',"cls":"folder"},
{'text':'Spices','id':'3',"cls":"folder"},
{'text':'Art','id':'4',"cls":"folder"},
{'text':'Collectibles','id':'5',"cls":"folder"},
{'text':'Books','id':'6',"cls":"folder"},
{'text':'Teas','id':'7',"cls":"folder"},
{'text':'Clothing','id':'8',"cls":"folder"},
{'text':'Exercise','id':'10',"cls":"folder"},
{'text':'Send A Little Something','id':'11',"cls":"folder"},
{'text':'My New Category','id':'12',"cls":"folder"},
{'text':'Another New Category','id':'14',"cls":"folder"}]

How do you emulate this response? First you must know what the [ and the { indicate. The [ indicates you are returning an array. The { indicates you are returning a structure. Since the [ is on the outside, you need to build a structure inside an array. So first you execute a query. Then you create an array, loop through the query. For each loop create a structure that is appended to the array. How? Here is an example:

Load the structure into the array




Increment the index


 

Continue until the loop is completed

Then all you need to do is return the array users to the calling program




Make sure your function has returnformat="JSON">

I hope this helps. In the future I will post full examples.