duanbai5348 2011-09-15 21:14
浏览 46
已采纳

通过SugarCRM WSDL更新一行

I have the documentation PDF for the version a client is running (I believe 3.1 Pro but am not 100% sure; that may just be the version initially purchased) but I cannot quite figure out how to UPDATE records. Here is what I know so far:

set_entry seems to be the closest match. I see from the PDF that the following is true about this function:

"Creates or updates a SugarBean"

How do I tell it to update rather than insert a record? For example, I am trying to update one column of one table to one specific value and I think I am as close as I can get with the following:

$result = $sugar['soapclient']->call(
    'set_entry',
    array(
        'session'=>$sugar['session'],
        'module_name'=>'Kits',
        array(
            array("name" => 'location', "value" => 'New Cool Location')
        ),
        'where'=>'id="1000ee55-55dc-feb0-c71a-4e5e8c31ad1b"'
    )
);

Clarification: I want to update the column 'location' to 'New Cool Location' only where the 'id' is '1000ee55-55dc-feb0-c71a-4e5e8c31ad1b'. I have also not ran this code on the live environment yet because we lack a fully functional development environment, so I want to be more confident in the code before it is ran.

  • 写回答

1条回答 默认 最新

  • doulang5323 2011-09-16 00:42
    关注

    Change the code example as following:

    $result = $sugar['soapclient']->call(
    'set_entry',
    array(
        'session'=>$sugar['session'],
        'module_name'=>'Kits',
        array(
            array("name" => 'location', "value" => 'New Cool Location')
            array("name" => 'id', "value" => '1000ee55-55dc-feb0-c71a-4e5e8c31ad1b')
        ),
    )
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算