我无法使用SOAP API更新acumatica中的销售订单。 每当我尝试使用ORDERNBR进行保存时,它都会保存新订单。
这是我的代码:
$Customer = new Value();
$Customer->Value = 'C000006';//$data['Customer'];
$Customer->FieldName = 'CustomerID';
$Customer->ObjectName = 'Document';
$Terms = new Value();
$Terms->Value = 'NET';
$Terms->FieldName = 'TermsID';
$Terms->ObjectName = 'CurrentDocument: 1';
$OrderType = new Value();
$OrderType->Value = $data['OrderType'];
$OrderType->FieldName = 'OrderType';
$OrderType->ObjectName = 'Document';
$Date = new Value();
$Date->Value = $data['Date'];
$Date->FieldName = 'OrderDate';
$Date->ObjectName = 'Document';
$RequestedOn = new Value();
$RequestedOn->Value = $data['RequestedOn'];
$RequestedOn->FieldName = 'RequestDate';
$RequestedOn->ObjectName = 'Document';
$CustomerOrder = new Value();
$CustomerOrder->Value = $data['CustomerOrder'];
$CustomerOrder->FieldName = 'CustomerOrderNbr';
$CustomerOrder->ObjectName = 'Document';
$Status = new Value();
$Status->Value = $data['Status'];
$Status->FieldName = 'Status';
$Status->ObjectName = 'Document';
$Currency = new Value();
$Currency->Value = $data['Currency'];
$Currency->FieldName = 'CuryID';
$Currency->ObjectName = 'Document';
$nbr = new Value();
$nbr->Value = '100064';
$nbr->FieldName = 'OrderNbr';
$nbr->ObjectName = 'Document';
//$nbr->LinkedCommand = $SO301000Content->GetSchemaResult->OrderSummary->OrderNbr;
//$SO301000Content->GetSchemaResult->OrderSummary->OrderNbr->Value = '100064';
//echo '<pre>';print_r($SO301000Content->GetSchemaResult->DocumentDetails->ServiceCommands);die;
$context->SO301000Clear();
$commands = array(
$Customer,
$Terms,
$OrderType,
$Date,
$RequestedOn,
$Status,
$CustomerOrder,
$Currency,
$nbr,
//$SO301000Content->GetSchemaResult->OrderSummary->CopyOrder,
//$SO301000Content->GetSchemaResult->OrderSummary->OrderNbr,
);
$commands[] = $SO301000Content->GetSchemaResult->Actions->Insert;
$commands[] = $SO301000Content->GetSchemaResult->OrderSummary->OrderNbr;
//echo '<pre>';print_r($commands);die;
$arr = array(
'commands'=>$commands,
);
$cus = $context->__soapCall('SO301000Submit', array($arr));
答案 0 :(得分:0)
OrderType
和OrderNbr
,这样Acumatica将首先导航到该条目,然后更新它。