Often in business, you require multiple levels of approval from decision-makers for certain records and requests. It becomes tedious to filter the records and send them for approval manually. The Approval Process add-on for SuiteCRM simplifies this task by automating the entire approval process.
#3964 - Approve a field change
Rather than working on a new or edited record is there a way to execute the approval request based on a single field being updated. e.g. An employee has a salary. If the salary field is changed then seek approval. I can see that in Approval Process you can check if the Salary field is > 0 etc. I want to only execute the approval process if the Salary value has changed.
many thanks
David
2 years ago
Hello David, Thank you for using our add-on. As of now we don't such facility, It seems nice suggestion, I will pass this suggestion to my dev team. We will get back to you soon.
Thanks & Regards, Team Urdhva Tech
2 years ago
Thank you for the prompt reply. Perhaps another way of doing this would be to create a SuiteCRM Workflow Action to trigger the Approval Process. Current Workflow Actions are to EMail, Create and Amend record. The Condition filter would be 'Salary' 'Equal To' 'Any Change' (though have not tried this out!)
regards,
David
2 years ago
Hello David,
Thanks for the response. We have updated the package(V1.1) and included the "Has Changed" functionality. Please download and re-install it.
Thanks & Regards, Team Urdhva Tech.
2 years ago
That is remarkable! I will download V1.1 and test the "Has Changed" functionality. Forgive me if you do not get an immediate response - I will be out of the office until early December. Many thanks for this excellent support.
David
2 years ago
"Has Changed" for Salary works well, thank you. A small issue in Approval Jobs (probably my environment). I did remove version 1.0. On viewing an 'Approval Job' from the Approval Jobs List is get a database error reported - please check suitecrm.log. Looks like a DATETIME problem, but only a suggestion.
suitecrm.log
Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Retrieve UT_AppRules : SELECT ut_apprules.* FROM ut_apprules WHERE ut_apprules.id = '2fdcefd0-39ad-c232-41af-619675ef4699' AND ut_apprules.deleted=0 Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Limit Query:SELECT ut_apprules.* FROM ut_apprules WHERE ut_apprules.id = '2fdcefd0-39ad-c232-41af-619675ef4699' AND ut_apprules.deleted=0 Start: 0 count: 1 Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query:SELECT ut_apprules.* FROM ut_apprules WHERE ut_apprules.id = '2fdcefd0-39ad-c232-41af-619675ef4699' AND ut_apprules.deleted=0 LIMIT 0,1 Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query Execution Time:0.00037407875061035 Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] SugarBean[UT_AppRules].load_relationships, Loading relationship (ut_appprocess_ut_apprulesut_appprocess_ida). Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query:SELECT ut_appprocess_ut_apprulesut_appprocess_ida id FROM ut_appprocess_ut_apprules_c WHERE ut_appprocess_ut_apprules_c.ut_appprocess_ut_apprulesut_apprules_idb = '2fdcefd0-39ad-c232-41af-619675ef4699' AND ut_appprocess_ut_apprules_c.deleted=0 Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query Execution Time:0.00035405158996582 Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] rebuilding cache for UT_AppProcess Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query:SELECT * FROM fields_meta_data WHERE custom_module='UT_AppProcess' AND deleted = 0 Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query Execution Time:0.00025296211242676 Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query:SELECT id ,ut_appprocess.name as ut_appprocess_ut_apprules_name , ut_appprocess.assigned_user_id owner FROM ut_appprocess WHERE deleted=0 AND id='6079d839-1d07-1d46-d077-619675349aee' Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query Execution Time:0.00019598007202148 Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Hook called: UT_AppRules::after_retrieve Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query:SELECT * FROM ut_apphistory WHERE deleted = '0' AND approval_time IS NOT NULL AND approval_time <> '' AND approval_process_id = '6079d839-1d07-1d46-d077-619675349aee' AND approval_rule_id = '2fdcefd0-39ad-c232-41af-619675ef4699' AND approval_record_id = 'd3c25cef-7183-f59f-0aad-61967553d76b' ORDER BY approval_time ASC Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Mysqli_query failed, error was: MySQL error 1525: Incorrect DATETIME value: '', query was: Thu Nov 18 15:50:13 2021 [121071][1][FATAL] Mysqli_query failed. Thu Nov 18 15:50:13 2021 [121071][1][INFO] Query Execution Time:0.00017881393432617 Thu Nov 18 15:50:13 2021 [121071][1][FATAL] Query Failed: SELECT * FROM ut_apphistory WHERE deleted = '0' AND approval_time IS NOT NULL AND approval_time <> '' AND approval_process_id = '6079d839-1d07-1d46-d077-619675349aee' AND approval_rule_id = '2fdcefd0-39ad-c232-41af-619675ef4699' AND approval_record_id = 'd3c25cef-7183-f59f-0aad-61967553d76b' ORDER BY approval_time ASC: MySQL error 1525: Incorrect DATETIME value: '' Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Hook called: ::server_round_trip Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Calling MySQLi::disconnect() Thu Nov 18 15:50:13 2021 [121071][1][FATAL] Exception handling in /var/www/html/suitecrm/include/MVC/Controller/SugarController.php:409 Thu Nov 18 15:50:13 2021 [121071][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details. Thu Nov 18 15:50:13 2021 [121071][1][DEBUG] Hook called: UT_AppHistory::handle_exception
2 years ago
Hello David,
We will look into the DATETIME problem. Meanwhile can you please let us know the PHP and MySQL version on which the Approval Process is installed?
Thanks & Regards, Team Urdhva Tech.