Jeremy Posted June 18, 2018 Posted June 18, 2018 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.
Gerry Posted June 18, 2018 Posted June 18, 2018 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
Jeremy Posted June 18, 2018 Author Posted June 18, 2018 @Gerry would it be possible to give an example so we can see if we can translate it into our system?
Gerry Posted June 18, 2018 Posted June 18, 2018 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
Jeremy Posted June 18, 2018 Author Posted June 18, 2018 @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. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now