Easify Forums

Forums -> Paperwork Designer

 Formula Editor

Post Reply
Page 1 of 1 1
Posted by chrisransley

Formula Editor

I am having issues with teh formula editor.

For example, in the Delivery Note I would like to display both Invoice address and Delivery address, however if I have no delivery address in client I would like that the Text Field that reads "Deliver To" and the Field containing the address (Order.Customer.FormattedDelNameAndAddress) are not displayed.

I therefore use

return ({Order.Customer.FormattedDelNameAndAddress} == '');

I however am not managing to get this to work and keep getting NullReferenceExceptions thrown when there is a delivery address for the customer. If I have no address I get no error.

Error executing formula (Text11).

Error: An unexpected error occured while parsing the script

Additional Info: System.NullReferenceException: Object reference not set to an instance of an object.

at ES3Parser.leftHandSideExpression()

at ES3Parser.postfixExpression()

at ES3Parser.unaryExpression()

at ES3Parser.multiplicativeExpression()

at ES3Parser.additiveExpression()

at ES3Parser.shiftExpression()

at ES3Parser.relationalExpression()

at ES3Parser.equalityExpression()

at ES3Parser.bitwiseANDExpression()

at ES3Parser.bitwiseXORExpression()

at ES3Parser.bitwiseORExpression()

at ES3Parser.logicalANDExpression()

at ES3Parser.logicalORExpression()

at ES3Parser.conditionalExpression()

at ES3Parser.assignmentExpression()

at ES3Parser.expression()

at ES3Parser.returnStatement()

at ES3Parser.statementTail()

at ES3Parser.statement()

at ES3Parser.sourceElement()

at ES3Parser.program()

at Jint.JintEngine.Compile(String source, Boolean debugInformation)

at Jint.JintEngine.Run(String script, Boolean unwrap)

Posted by John

Re: Formula Editor

Hi Chris,

Our JavaScript interpreter is not terribly good at handing Null values, we have a bug raised for this and will address it in a future free update.

Happy to help - John (Easify Support)

Like our facebook page and always get the latest updates!

Posted by chrisransley

Re: Formula Editor


So how can I not display the Text Field that reads "Deliver To" then?

Posted by John

Re: Formula Editor

For the time being, please use this long way around code, it hides a control if there are no details in the Delivery tab for a customer:

return (

({Order.Customer.DelAddress1} == '')

&& ({Order.Customer.DelAddress2} == '')

&& ({Order.Customer.DelAddress3} == '')

&& ({Order.Customer.DelCompany} == '')

&& ({Order.Customer.DelCountry} == '')

&& ({Order.Customer.DelCounty} == '')

&& ({Order.Customer.DelPostcode} == '')

&& ({Order.Customer.DelTown} == '')

&& ({Order.Customer.DelTitle} == '')

&& ({Order.Customer.DelFirstname} == '')

&& ({Order.Customer.DelSurname} == '')

&& ({Order.Customer.DelJobTitle} == '')

&& ({Order.Customer.DelDepartment} == '')


NB. This code doesn't encounter NULL value exceptions because these fields do not return NULLs.

Happy to help - John (Easify Support)

Like our facebook page and always get the latest updates!

Post Reply
Page 1 of 1 1

Easify Website V 5.0    © 2024 Easify Ltd ® All rights reserved.     Privacy Policy