Calculating a field value using workflow not working

I created PAID and Balance fields in invoices using studio.

What we want is value in paid should be deducted from Grand Total and value should be populated in balance field. I created a workflow where if paid is > 0 then action is selected as modify and in field I have chosen balance in value I have written (‘Grand Total’) - (‘Paid’)

I am sure there is a syntax problem in here… any heads up?

Also, on a slightly different note, my whole system is working fine but in invoice, everything under LineItems are shown as undefined; every column.

Please help.
Elena

I discovered that error is with reports and sales modules. Attached are screenshots.

Also, there are mixed opinions about calculating on fields; any heads-up?

1 Like

Hope someone from SuiteCRM help here as i face same problem with Invoices and Payment receipt

are you still looking for solution?

undefined error is due to permissions. pl make sure that you follow this link for permission to set.
http://support.sugarcrm.com/04_Knowledge_Base/02Administration/100Install/Required_File_System_Permissions_on_Linux/
after setting the permission, do a quick repair.
the calculation can be done through logic hooks if need details reply to this thread.

Are you still struggling with this, i have a script running that when executed it will run through all your files and directories and set the permissions accordingly.

can you share that script here? would prove useful.

With things like this I tend to just write it into a logic_hook (out of habit).

If you were to add an after save logic hook with the following logic (modify to suit your field names of course) in it you should see what you expect:


$bean->balance_c = $bean->total_amount - $bean->amount_paid_c;
 

If you want something more sophisticated with multiple payments that is also possible.

Good luck.