如何通过WSDL更新NetSuite Department isInactive?

问题描述 投票:1回答:2

我正在尝试通过WSDL更新NetSuite部门,但我遇到了更新isInactive的问题。下面是我在C#中的代码:

var record = new com.netsuite.webservices.Department
{
 internalId = dp.InternalId,
 isInactive = dp.InActive
};

然后叫

var result = ServiceClient.update(record);

部门的部门在NetSuite上不活动,不会检查我是将其设置为真还是假。我在这做错了什么?

netsuite
2个回答
2
投票

你忘了设置isInactiveSpecified

试试这个:

var record = new com.netsuite.webservices.Department
{
 internalId = dp.InternalId,
 isInactive = dp.InActive,
 isInactiveSpecified = true
};

0
投票

你需要首先.get()记录,设置一些属性,然后.update()记录。这对我有用:

var ns = new NetSuite.NetSuiteService();
// passport info skipped

var departmentRef = new RecordRef
{
    internalId = "1",
    type = RecordType.department,
    typeSpecified = true
};

var response = ns.get(departmentRef);
var department = response.record as Department;
department.isInactive = true;
ns.update(department);
© www.soinside.com 2019 - 2024. All rights reserved.