Total calculation based on workflow satus

Posted by Ramon Schouten on 27-Sep-2016 06:07

Hi all,

I have run into a formula problem I can’t figure out on my own, so I am counting on you[:)]

I am trying to create a formula, which will calculate the total amount my project will cost.
This total cost will exist of all the approved budgets.

The total cost will exist of some already defined expression fields.
These expression fields exist of the following formulas:

- Project budget incl. Indexation incl. VAT (The initial budget of the project * indexation) *1,21 (VAT)

 

 

- Exception budget incl. Indexation incl. VAT (The budget of changes or exceptions that occur on the project * indexation) * 1,21 (VAT)

 

These exceptions have an approval chained to them.
The approvals changes the workflow status, occurring to which approval has been done.

My wish is to only use the exceptions which are ‘Approved’, so with the workflow status ‘Approved’ (this means they need to have been approved by the final approver)

 

How can I make sure I get a total calculation of the project cost + the cost of all exceptions which have been approved (related to this specific project)?

Thanks in advance and I look forward to hearing from you!

Greetings,

Ramon Schouten

QAP P3 Solutions

Posted by Nitin Kumar Singh on 28-Sep-2016 03:57

Hi Ramon,

Value of workflow status can be queried inside formula area for expression/formula fields using integration code of the field such as

if("{!R1677405.status#code}" == "APR") { } or

if we are querying the database then as

Select name from Exception where status = 1677483;

Here, status is the integration code of the field:  Workflow Status

APR/1677483 - is integration code/id of "Approved" status

I have designed a basic application around your use case, with 'Project' as primary record and 'budget' and 'exceptions' as related records. Using this metadata, i have calculated initial funding and 'approved' exception based funding as expression fields. I'm attaching the app xml. See, if this helps.

[View:/cfs-file/__key/communityserver-discussions-components-files/25/Community--_5F00_-Projects_5F00_v1.xml:32:24]

Thanks,

Nitin

All Replies

Posted by Nitin Kumar Singh on 28-Sep-2016 03:57

Hi Ramon,

Value of workflow status can be queried inside formula area for expression/formula fields using integration code of the field such as

if("{!R1677405.status#code}" == "APR") { } or

if we are querying the database then as

Select name from Exception where status = 1677483;

Here, status is the integration code of the field:  Workflow Status

APR/1677483 - is integration code/id of "Approved" status

I have designed a basic application around your use case, with 'Project' as primary record and 'budget' and 'exceptions' as related records. Using this metadata, i have calculated initial funding and 'approved' exception based funding as expression fields. I'm attaching the app xml. See, if this helps.

[View:/cfs-file/__key/communityserver-discussions-components-files/25/Community--_5F00_-Projects_5F00_v1.xml:32:24]

Thanks,

Nitin

Posted by Ramon Schouten on 03-Oct-2016 10:39

Hi Nitin!

Excuse me for my late reaction.

This indeed has solved it! thanks alot!

This thread is closed