Can a workflow run off a value inserted directly into the database? e.g. if i add a date directly into the table outside of suitecrm, can I get a workflow to run in the future based on that date?
No, youâll need to setup database triggers for that, or you can use webservice that will trigger a workflow
best regards
Would something like the below be able to trigger a workflow that fires when shipment_status is changed to delivered? I ask becuase I canât get the worflow in the attached pic to fire.
$bean = BeanFactory::getBean(âshi1_Shippingâ,$row[âidâ]);
//var_dump($bean->outbound_tracking_status);
if($outbound_flag){
$bean->outbound_tracking_status = $event_status;
if($event_status == âDelivered, In/At Mailboxâ){
$bean->shipment_status = âdeliveredâ;
}
}else{
$bean->inbound_tracking_status = $event_status;
}
$bean->save();
Have you tried updating also the date_modified field with the bean?
I am not sure but possibly thtaâs the reason why it doesnât trigger.
The date seems to modify itself. I have got the workflow to trigger from the script, unfortunately it triggers other workflows that do not meet the conditions as well.
Is the code still the same as the one you shared? And the workflow?
Where did you put your code?
In which files and what code precisely?
I have two scripts in the public_html directory where suitecrm is installed.
test_script2.php - looks like this now:
<?php if(!defined('sugarEntry'))define('sugarEntry', true); require_once('include/entryPoint.php'); $record_id = $_REQUEST['id']; $shipping_bean = BeanFactory::getBean('shi1_Shipping',$record_id); $shipping_bean-> pre_shipment_check = '1'; $shipping_bean->save(); ?>I also have âtest_script2.phpâ that looks like this:
<?php if(!defined('sugarEntry'))define('sugarEntry', true); require_once('include/entryPoint.php'); $record_id = $_REQUEST['id']; $shipping_bean = BeanFactory::getBean('shi1_Shipping',$record_id); $shipping_bean->shipment_delivered_check = '1'; $shipping_bean->save(); ?>I call the scripts on records like this from my browser currently:
http://cms4.diabeticbuyers.com/test_script1.php?id=a03c1c90-31a6-0d1f-fdfa-577d3aa8ac33
http://cms4.diabeticbuyers.com/test_script2.php?id=a03c1c90-31a6-0d1f-fdfa-577d3aa8ac33
The check boxes get checked on the front end of the system and everything is good.
I have two workflows:
One is like this:
And one is like this:
The problem is that when either of the scripts are executed, both of the workflows fire resulting in 2 emails. Only one should fire.
It turned out to be some type of issue with the scope of the dropdown menu variables in the workflow.
Please explain in detail how you solved it so that others can also benefit.
Thanks!