如何通过WSDL更新NetSuite Department isInactive?

时间:2018-12-27 22:25:40

标签: netsuite

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

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

然后称为

var result = ServiceClient.update(record);

在NetSuite上,部门的部门无效,不检查我将其设置为true还是false。我在这里做什么错了?

2 个答案:

答案 0 :(得分:2)

您忘记设置isInactiveSpecified

尝试一下:

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

答案 1 :(得分: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);