为自定义模块创建bean

时间:2019-05-06 13:18:55

标签: php sugarcrm suitecrm

我已经在suitecrm中创建了SLA工作流模块。现在,我想获取SLA工作流模块的所有记录(“ SLA_workflow”-模块名称)。 我已经尝试过下面的代码,但是没有得到任何记录。

$workflowbean=BeanFactory::newBean('SLA_workflow');
$slabean=BeanFactory::getBean('SLA_workflow');

以上两个都没有给我SLA工作流程模块的记录。

1 个答案:

答案 0 :(得分:0)

要检索单个记录$workflowbean->retrieve($workflowbean_id) 要检索记录列表,您必须指定过滤条件和其他详细信息,这要复杂一些。

例如,对于“帐户”模块(已在7.11.2上进行测试),它将是这样的:

      $moduleBean = BeanFactory::getBean("Accounts");
      $where=[" accounts.name like '%t%' "]; //This can be an array of where conditions
      $params['include_custom_fields']=true;
      $query = $moduleBean->create_new_list_query(" ORDER BY accounts.name ", implode(" AND ", $where), "", $params, $show_deleted = 0, '', false, null, $singleSelect = false);
      $offset=0;
      $limit=10;
      $max_per_page=10;
      $res=$moduleBean->process_list_query($query, $offset, $limit, $max_per_page, $where);

这应该使您可以根据搜索参数获取bean列表

相关问题