Jump to content

Calculations in BPM or PCF


Recommended Posts

Hi

Has anyone taken fields from PCF forms and performed calculations on them?

We are using a form to capture details about ordering items where you enter pricing details and amounts, we would then like to add this up and/or calculate VAT on these items.

Thanks in advance for any help.

Link to comment
Share on other sites

A simple numeric formula *might* work as its ultimately just a JavaScript environment, but I have a feeling this might be secured. Give it a try and see if you get the result you are looking for.  VAT calculations can be complicated if you are in more than one tax domain, different rates, and different rules often apply.  

Gerry

Link to comment
Share on other sites

Hi Jeremy,

I am not an expert in PC, but just having a look I might have been confusing the issue with BPM, the PC forms do not appear to support expressions.  Now it might be possible in BPM to do a calculation on two fields to come up with a value, something like this which would give you the VAT amount.   I have never tried this so it may well not work, but you could give it a go.   Basically within the &[...] this is treated as an expression, what I dont know is weather or not its evaluated or simply assigned. Try it out and see what you get. 

&[global["inputParams"]["myPriceValue"] *  0.2]

Gerry

Link to comment
Share on other sites

@Gerry It works!  We have used this for calculations... e.g. &[[functions.pcf("Order1","field_6")]*[functions.pcf("Order1","field_4")]*1.20]

This multiplies two fields togeter and then adds the current VAT rate to the total.

Thanks for your help.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...