【问题标题】:Case insensitive approach for sugarcrm retrieve_by_string_fields() functionSugarcrm retrieve_by_string_fields() 函数的大小写不敏感方法
【发布时间】:2016-11-15 16:36:54
【问题描述】:

sugarcrm 中的bean 方法retrieve_by_string_fields() 是否有任何不区分大小写的方法。我们想要的是在使用名称检索时 Akshay 和 akshay 都应该返回相同的 bean。

请指导我。谢谢。

【问题讨论】:

    标签: php sugarcrm case-insensitive suitecrm


    【解决方案1】:

    不确定是否可以使用retrieve_by_string_fields 完成,但一种解决方案是使用sql 首先获取bean-id,然后使用id 获取bean。

    使用帐户模块的示例;

    $name = "Akshay";
    $db = DBManagerFactory::getInstance();
    $id = $db->getOne("SELECT id FROM accounts WHERE name = '$name' AND deleted = 0");
    if (!empty($id)) {
        $account = BeanFactory::getBean("Accounts", $id);
    }
    

    【讨论】:

    • 嗨@ogge7,我重写了retrieve_by_string_fields 方法以接受更多参数并设法让它工作。谢谢你的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-30
    • 2017-02-21
    • 2011-01-22
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    相关资源
    最近更新 更多