Calculate Workflow - Text String

So, I ran into an issue where the workflow hangs or stalls and on Saving the record. User gets “Oops! Something went wrong” and Error Page. Luckily it saves most information.

The temporary fix is to go into the DB and delete the job - I have 2 separate workflows. (All I am trying to do is output “echo” text or combine text from different fields and fill out another field) no real calculation.

I am using the Projects Module - Run: “Only on Save” - Run On: “All records” Repeated Runs: “Checked”. No Conditions. Formula Parameters is: Account Name: {P0}-Client Job #: {P1} - Project Address: {P2}- Project Name: {P3}- Municipality: {P4}-Estimate #: {P5}-Project Number: {P6}
Do you see any characters that might cause the issue? If so is there a wrapper to echo without issue?

I’ve just tried it on a different module and it’s working well.
Even the decimal / integer + string concatination.

Do you have a screenshot for us?
And give it a try, to build the formular up one by one and test, when it fails.

Account Name: {P0}

Go to the project, save it and see what happens.
Then to the workflow again:

Account Name: {P0}-Client Job #: {P1}

Re-test now - still working?

Another approach for debugging is via the log files. Check out:

suitecrm.log
php_errors logfile // that you've defined in your php.ini

But the error handling in the workflows has some room for improvement left - just a heads up, in case you won’t find anything there.

1 Like

Thank You Bastian . It did work on many records, (with several parameters) but then started throwing an error.:
" This page isn’t working is currently unable to handle this request…HTTP ERROR 500"

We had done some troubleshooting. And the log file does mention something that looks relevant:

[15-Jun-2024 16:23:10 UTC] PHP Warning:  implode(): Invalid arguments passed in /home/dbusr/stage4.testingdomain.com/modules/AOW_Actions/actions/actionSendEmail.php on line 508
[15-Jun-2024 16:23:10 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, object given in /home/dbusr/stage4.testingdomain.com/include/database/MysqliManager.php on line 290
[15-Jun-2024 16:23:10 UTC] PHP Fatal error:  Uncaught Error: Object of class Link2 could not be converted to string in /home/dbusr/stage4.testingdomain.com/data/SugarBean.php:4573
Stack trace:
#0 /home/dbusr/stage4.testingdomain.com/modules/Project/Project.php(486): SugarBean->retrieve(Object(Link2))
#1 /home/dbusr/stage4.testingdomain.com/modules/AOW_Actions/actions/actionComputeField.php(129): Project->save(false)
#2 /home/dbusr/stage4.testingdomain.com/modules/AOW_WorkFlow/AOW_WorkFlow.php(969): actionComputeField->run_action(Object(Project), Array, true)
#3 /home/dbusr/stage4.testingdomain.com/modules/AOW_WorkFlow/AOW_WorkFlow.php(229): AOW_WorkFlow->run_actions(Object(Project), true)
#4 /home/dbusr/stage4.testingdomain.com/include/utils/LogicHook.php(260): AOW_WorkFlow->run_bean_flows(Object(Project), 'after_save', '')
#5 /home/dbusr/stage4.testingdomain.com/include/utils/LogicHook.php(201): LogicHook->process_hooks(Array, 'after_save', '')
#6 /home/dbusr/stage4.dbusrngsolutions.c in /home/dbusr/stage4.testingdomain.com/data/SugarBean.php on line 4573
[15-Jun-2024 16:25:35 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; VIMultipleFields has a deprecated constructor in /home/dbusr/stage4.testingdomain.com/custom/include/VIMultipleFields/VIMultipleFields.php on line 19
[15-Jun-2024 16:25:36 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; VIMultipleFields has a deprecated constructor in /home/dbusr/stage4.testingdomain.com/custom/include/VIMultipleFields/VIMultipleFields.php on line 19
[15-Jun-2024 16:25:41 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; VIMultipleFields has a deprecated constructor in /home/dbusr/stage4.testingdomain.com/custom/include/VIMultipleFields/VIMultipleFields.php on line 19
[15-Jun-2024 16:25:42 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; VIMultipleFields has a deprecated constructor in /home/dbusr/stage4.testingdomain.com/custom/include/VIMultipleFields/VIMultipleFields.php on line 19
[15-Jun-2024 16:25:42 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; VIMultipleFields has a de

Specifically:
[15-Jun-2024 16:23:10 UTC] PHP Warning: mysqli_real_escape_string() expects parameter 2 to be string, object given in /home/dbusr/stage4.testingdomain.com/include/database/MysqliManager.php on line 290
[15-Jun-2024 16:23:10 UTC] PHP Fatal error: Uncaught Error: Object of class Link2 could not be converted to string in /home/dbusr/stage4.testingdomain.com/data/SugarBean.php:4573
Stack trace:

So maybe a strange character? Not sure really, as it worked with many parameters, but now even 1 param : {P0} will get the error. :thinking:

@pstevens - This is the thread.

Ah, that’s interesting.
So there is a typecasting going on where it shouldn’t (or can’t - object to string).

The error seems to be happening once in a while:

And check out this one:

sounds fairly similar - maybe that can point you into the right direction?

1 Like

@dwaynecasey can you try adding a project template (anything, even with at test task in it) to the project that’s causing the 500 error, then re-save and see if it works with your existing workflow. That’s the just of bug and workaround.

1 Like

@dwaynecasey thinking more about this, why fight the bug? This is an easy before save hook to write and it will work 100% of the time. Just avoid the problem all together.

1 Like

Thank you. This was helpful. One mentioned to apply a project template (This seems to be a bug in the projects module).

:thinking: :grin:
I like it…This will work.