The Calculation Editor loads with the "Process" object and not the object I'm working on

Version 2


    When working in Process Designer if you open an automatic action, right-click on an attribute and select Calculation the Calculation Editor appears but displays the wrong object.


    For instance, on an Incident process if you have an automatic Add Task action, right-click on the Details (aka Description) attribute and select Calculation the Calculation Editor can appear for the Process object rather than the Task object.


    task calc.png



    This is caused because the attribute you have selected for the calculation (Description in the example above) is inherited from the Process object and the Calculation Editor is unaware that you are actually working on a child object and not the object the attribute originally belonged to.


    This is logged as problem 5736 so if you experience this issue please contact your support provider to have your instance of the issue logged.  There are however ways to work around the issue described below.



    A very important factor to understand about this issue to help you solve it is that the calculation IS still going to be run on the correct object.  It is just the display of the editor that is incorrect.  You can therefore ignore how the editor is loaded and write your calculation as required.


    Ignore that the word Process is displayed on line 2 of the calculation.  This is merely a variable name used to reference the object you're working on and does not actually mean you are on the object called Process.  You could rename this to Stu and then reference attributes by using Stu.Title, Stu._MyAttributeOnTask, etc. and it will work just as well.  The only issue is that adding attributes from the tree on the left will add them with the wrong prefix and you need to fix it afterwards.  However, the best option is to just ignore the word.


    Solution Method 1

    If you only need to access attributes that exist on the Process object, or you know the names of the attributes you want to access, you can continue as normal despite the editor showing the wrong object.  You can manually type attributes on the child object such as Process._MyAttributeOnTask and it will work even though _MyAttributeOnTask isn't on the Process object itself.


    Solution Method 2

    If you prefer to design your calculation with the correct object displayed you can do this with the following steps:


    1. Make sure your action window includes an attribute that was created on the child object.  Create one temporarily if required.
    2. Right-click on that attribute and select Calculation to open the Calculation Editor - The editor will load with the correct object.
    3. Copy the entire calculation code, including the first two lines, to Notepad.
    4. Right-click that attribute again and select Value Type.
    5. Press OK on the dialog that appears - this removes the calculation.
    6. Right-click on your correct attribute and select Calculation - The editor loads with the incorrect object.
    7. Replace the calculation with your copy made in Notepad.  This will change the object name on line 2 from Process to your actual object but as described earlier this doesn't matter as long as all your attribute references use the same prefix.


    If you want you can replace all instances of Task (or whatever the child object is called) with Process once you have it on the correct attribute - this effectively makes your calculation now as if you used Solution Method 1.