作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试自动将 NetSuite 采购订单链接到 NetSuite 销售订单,以下是我尝试完成此任务的代码。但我收到错误(见底部)。你能检查一下并让我知道我在这里遗漏了什么吗?
采购订单创建代码:
var createPurchaseOrder = new PurchaseOrder();
createPurchaseOrder.entity = new RecordRef()
{
internalId = “653”
//type = RecordType.purchaseOrder,
//typeSpecified = true
};
RecordRef soRecordRef = new RecordRef();
soRecordRef.internalId = “XXXXXXXX”;
soRecordRef.type = RecordType.salesOrder;
soRecordRef.typeSpecified = true;
createPurchaseOrder.createdFrom = soRecordRef;
RecordRef depRecordRef = new RecordRef();
depRecordRef.internalId = “3”;
depRecordRef.name = “eBay : eBay FNC”;
depRecordRef.type = RecordType.department;
depRecordRef.typeSpecified = true;
createPurchaseOrder.department = depRecordRef;
PurchaseOrderItem[] Items = new PurchaseOrderItem[1];
Items[0] = new PurchaseOrderItem();
RecordRef item = new RecordRef();
item.type = RecordType.nonInventoryPurchaseItem;
item.typeSpecified = true;
item.internalId = “XXXXX”;
Items[0].item = item;
Items[0].rate = “5”;
Items[0].quantity = 1;
Items[0].quantitySpecified = true;
PurchaseOrderItemList purchaseOrderItemList = new PurchaseOrderItemList();
purchaseOrderItemList.item = Items;
createPurchaseOrder.itemList = purchaseOrderItemList;
WriteResponse response = Service.add(createPurchaseOrder);
var updateSalesOrder = new SalesOrder();
updateSalesOrder.internalId = “XXXXXXXX”;
SalesOrderItem[] soItems = new SalesOrderItem[1];
var soItem = new SalesOrderItem();
RecordRef roItem = new RecordRef();
roItem.type = RecordType.inventoryItem;
roItem.typeSpecified = true;
roItem.internalId = “XXXXX”;
soItem.item = roItem;
RecordRef prLevel = new RecordRef();
prLevel.type = RecordType.priceLevel;
prLevel.internalId = “-1”;
prLevel.typeSpecified = true;
soItem.price = prLevel;
soItem.rate = “15”;
soItem.quantity = 1;
soItem.quantitySpecified = true;
RecordRef poItem = new RecordRef();
poItem.type = RecordType.purchaseOrder;
poItem.typeSpecified = true;
poItem.internalId = purchaseOrder.internalId;
soItem.createdPo = poItem;
soItems[0] = soItem;
SalesOrderItemList salesOrderItemList = new SalesOrderItemList();
salesOrderItemList.item = soItems;
updateSalesOrder.itemList = salesOrderItemList;
response = Service.update(updateSalesOrder);
if (response.status.isSuccess != true) throw new Exception(response.status.statusDetail[0].message);
3.2 **createdFrom** field is displaying as below when we create purchase order through netsuite.
最佳答案
我没有答案,但希望我能做出贡献。首先,我认为你从错误的方向接近这个。与其创建 PO 然后尝试将其链接到 SO,我认为您必须通过 native 直销流程初始化 PO,然后保存 PO。例如,在 SuiteScript 2.0 中创建一件代发货 PO 非常容易。这是它的完成方式:
var purchaseOrder = record.create ({
type: record.Type.PURCHASE_ORDER,
isDynamic: true,
defaultValues: {
recordmode: 'dynamic',
soid: '11111',
dropship: true,
custid: '22222',
entity: '33333'
}
})
createdFrom
;在 SO 项目上自动设置
createdPo
)。我尝试使用两种不同的方法在 SuiteTalk 中重新创建它,但都失败了。他们来了:
initialize()
来模拟 SuiteScript 方法。方法。这就是从估计创建 SO 或从 SO 创建 IF 的方式,因此看起来很有希望:
var initrec = new InitializeRecord
{
type = InitializeType.purchaseOrder,
reference = new InitializeRef
{
internalId = "11111",
type = InitializeRefType.salesOrder,
typeSpecified = true
}
};
var res = NSBase.Client.Service.initialize(initrec);
// "You can not initialize purchaseOrder by referencing salesOrder."
initialize()
从 SO 创建 PO .这是非常令人沮丧的。
var objSO = new SalesOrder();
objSO.internalId = "11111";
objSO.itemList = new SalesOrderItemList
{
item = new SalesOrderItem[]
{
new SalesOrderItem { line = 10, lineSpecified = true, createPo = SalesOrderItemCreatePo._dropShipment, createPoSpecified = true }
},
replaceAll = false
};
var result = Service.update(objSO);
// "You do not have permissions to set a value for element item.createpo due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases."
关于c# - Netsuite:如何将采购订单链接到销售订单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61936920/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!