Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By medoman
#789226
Hey friends
sorry but i have a critical case here, i have the program manager dropdown list and the user can choose one value, then and at some times he can change this value if his manager request, and when the user change the program manager and press submit he got this error

Fatal error: Cannot use string offset as an array in C:\Bitnami\processmaker-3.0.1.8-0\apps\processmaker\htdocs\workflow\engine\classes\class.pmScript.php(246) : eval()'d code on line 1

- this is the trigger i run after the form to get the user id for the programme manager

@@programme_manager_id = executeQuery ("select USR_UID from users where USR_EMAIL = '". @@Programme."' ");
@@programme_manager_id = @@programme_manager_id[1][USR_UID];
By zainab
#789233
In your trigger, you need to enclose the column USR_UID in single quotation marks when fetching the values, modify your trigger as:
Code: Select all

@@programme_manager_id = executeQuery("SELECT USR_UID from users where USR_EMAIL = '". @@Programme."'");
@@programme_manager_id = @@programme_manager_id[1]['USR_UID'];
What is stored in @@Programme? Is it a text field?

I think this might resolve the error.
Do let me know if this helps.

Best Regards,
Zainab
By medoman
#789235
the @@manager holds the email address from the dropdown list, i run your trigger but it doesn't help... i think the problem is that the variable @@programme_manager_id is not empty. because when the user choose a program name for the first time the code is work and translate the email in @@programme variable to user id successfully , but when the user choose another program the fatal error appears.
By zainab
#789236
This because you are using the same variable to store a string and an array. use two different variables.
Code: Select all
$res = executeQuery("SELECT USR_UID from USERS where USR_EMAIL = '". @@Programme."' ");
if(is_array($res))
{
@@programme_manager_id = $res[1]['USR_UID'];
}

This should work, if it doesn't could you please send your process so that I can take a better look at it and help you with a solution.

Best Regards,
Zainab
By medoman
#789238
i think it is working... i will complete my test and tell you the final result..
thanks Zainab for your always support

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]