2014-12-19 5 views
1

대부분의 사람들이 NetSuite 웹 서비스 상호 작용을 위해 PHP Toolkit을 사용하고있는 것처럼 보입니다. 나는 아니지만 누군가가 도와 줄 수있는 희망으로 SOAP로 인코딩 된 요청/응답을 붙여 넣을 것입니다 (기침 Suite Resources 기침).NetSuite 인보이스 생성 MLI_LOCATION_REQUIRED이지만 invoice.location 설정 불가능

단일 인보이스 항목으로 새 인보이스를 만들려고합니다. 은 "invoice.location"JSON 데이터 (보면

You do not have permissions to set a value for element location 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.

[1] pry(main)> invoice.add 

D, [2014-12-19T16:47:19.997923 #13995] DEBUG -- : HTTPI GET request to webservices.sandbox.netsuite.com (net_http) 
I, [2014-12-19T16:47:20.464235 #13995] INFO -- : SOAP request: https://webservices.sandbox.netsuite.com/services/NetSuitePort_2013_2 
I, [2014-12-19T16:47:20.464378 #13995] INFO -- : SOAPAction: "add", Content-Type: text/xml;charset=UTF-8, Content-Length: 2568 
D, [2014-12-19T16:47:20.464926 #13995] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:platformMsgs="urn:messages_2013_2.platform.webservices.netsuite.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:platformCore="urn:core_2013_2.platform.webservices.netsuite.com" xmlns:platformCommon="urn:common_2013_2.platform.webservices.netsuite.com" xmlns:listRel="urn:relationships_2013_2.lists.webservices.netsuite.com" xmlns:tranSales="urn:sales_2013_2.transactions.webservices.netsuite.com" xmlns:actSched="urn:scheduling_2013_2.activities.webservices.netsuite.com" xmlns:setupCustom="urn:customization_2013_2.setup.webservices.netsuite.com" xmlns:listAcct="urn:accounting_2013_2.lists.webservices.netsuite.com" xmlns:tranBank="urn:bank_2013_2.transactions.webservices.netsuite.com" xmlns:tranCust="urn:customers_2013_2.transactions.webservices.netsuite.com" xmlns:tranInvt="urn:inventory_2013_2.transactions.webservices.netsuite.com" xmlns:listSupport="urn:support_2013_2.lists.webservices.netsuite.com" xmlns:tranGeneral="urn:general_2013_2.transactions.webservices.netsuite.com" xmlns:listMkt="urn:marketing_2013_2.lists.webservices.netsuite.com" xmlns:listWebsite="urn:website_2013_2.lists.webservices.netsuite.com" xmlns:fileCabinet="urn:filecabinet_2013_2.documents.webservices.netsuite.com" xmlns:listEmp="urn:employees_2013_2.lists.webservices.netsuite.com"> 
    <env:Header> 
    <platformMsgs:passport> 
     <platformCore:email>[REDACTED]</platformCore:email> 
     <platformCore:password>[REDACTED]</platformCore:password> 
     <platformCore:account>[REDACTED]</platformCore:account> 
     <platformCore:role internalId="3"/> 
    </platformMsgs:passport> 
    </env:Header> 
    <env:Body> 
    <platformMsgs:add> 
     <platformMsgs:record xsi:type="tranSales:Invoice"> 
     <tranSales:email>[REDACTED]</tranSales:email> 
     <tranSales:isTaxable>false</tranSales:isTaxable> 
     <tranSales:entity internalId="26017" externalId="[REDACTED]" type="customer"/> 
     <tranSales:itemList> 
      <tranSales:item> 
      <tranSales:item internalId="152"/> 
      <tranSales:line>1</tranSales:line> 
      <tranSales:orderLine>1</tranSales:orderLine> 
      <tranSales:amount>313</tranSales:amount> 
      <tranSales:location internalId="1" type="location"/> 
      <tranSales:revRecStartDate>2014-12-01T08:13:00.000Z</tranSales:revRecStartDate> 
      <tranSales:revRecEndDate>2015-12-01T08:13:00.000Z</tranSales:revRecEndDate> 
      </tranSales:item> 
     </tranSales:itemList> 
     </platformMsgs:record> 
    </platformMsgs:add> 
    </env:Body> 
</env:Envelope> 

D, [2014-12-19T16:47:20.465337 #13995] DEBUG -- : HTTPI POST request to webservices.sandbox.netsuite.com (net_http) 
I, [2014-12-19T16:47:23.786293 #13995] INFO -- : SOAP response (status 200) 
D, [2014-12-19T16:47:23.786660 #13995] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Header> 
    <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2013_2.platform.webservices.netsuite.com"> 
     <platformMsgs:nsId>WEBSERVICES_[REDACTED]_121920141668433096579618905_1be2c0a823e5</platformMsgs:nsId> 
    </platformMsgs:documentInfo> 
    </soapenv:Header> 
    <soapenv:Body> 
    <addResponse xmlns="urn:messages_2013_2.platform.webservices.netsuite.com"> 
     <writeResponse> 
     <platformCore:status xmlns:platformCore="urn:core_2013_2.platform.webservices.netsuite.com" isSuccess="false"> 
      <platformCore:statusDetail type="ERROR"> 
      <platformCore:code>MLI_REQD</platformCore:code> 
      <platformCore:message>Multi-location Inventory Error (MLI_LOCATION_REQUIRED): this transaction or its items must have locations.</platformCore:message> 
      </platformCore:statusDetail> 
      <platformCore:statusDetail type="WARN"> 
      <platformCore:code>WARNING</platformCore:code> 
      <platformCore:message>Fake Billing Line Item: You have only 0 available across all locations (0 back ordered, 0 on order).</platformCore:message> 
      </platformCore:statusDetail> 
     </platformCore:status> 
     </writeResponse> 
    </addResponse> 
    </soapenv:Body> 
</soapenv:Envelope> 

=> false 
[2] pry(main)> invoice.location = ottawa 
=> #<NetSuite::Records::Location:0x007fca96a5eea8 
@attributes= 
    {:name=>"Ottawa", 
    :is_inactive=>false, 
    :addressee=>"Ottawa", 
    :addr1=>"[REDACTED]", 
    :city=>"Ottawa", 
    :state=>"ON", 
    :zip=>"[REDACTED]", 
    :country=>"_canada", 
    :addr_text=>"Ottawa\n[REDACTED]\nOttawa ON [REDACTED]", 
    :override=>false, 
    :make_inventory_available=>false}, 
@external_id=nil, 
@internal_id="1"> 
[3] pry(main)> invoice.add 
D, [2014-12-19T16:48:03.626321 #13995] DEBUG -- : HTTPI GET request to webservices.sandbox.netsuite.com (net_http) 
I, [2014-12-19T16:48:04.090118 #13995] INFO -- : SOAP request: https://webservices.sandbox.netsuite.com/services/NetSuitePort_2013_2 
I, [2014-12-19T16:48:04.090331 #13995] INFO -- : SOAPAction: "add", Content-Type: text/xml;charset=UTF-8, Content-Length: 2640 
D, [2014-12-19T16:48:04.090841 #13995] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:platformMsgs="urn:messages_2013_2.platform.webservices.netsuite.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:platformCore="urn:core_2013_2.platform.webservices.netsuite.com" xmlns:platformCommon="urn:common_2013_2.platform.webservices.netsuite.com" xmlns:listRel="urn:relationships_2013_2.lists.webservices.netsuite.com" xmlns:tranSales="urn:sales_2013_2.transactions.webservices.netsuite.com" xmlns:actSched="urn:scheduling_2013_2.activities.webservices.netsuite.com" xmlns:setupCustom="urn:customization_2013_2.setup.webservices.netsuite.com" xmlns:listAcct="urn:accounting_2013_2.lists.webservices.netsuite.com" xmlns:tranBank="urn:bank_2013_2.transactions.webservices.netsuite.com" xmlns:tranCust="urn:customers_2013_2.transactions.webservices.netsuite.com" xmlns:tranInvt="urn:inventory_2013_2.transactions.webservices.netsuite.com" xmlns:listSupport="urn:support_2013_2.lists.webservices.netsuite.com" xmlns:tranGeneral="urn:general_2013_2.transactions.webservices.netsuite.com" xmlns:listMkt="urn:marketing_2013_2.lists.webservices.netsuite.com" xmlns:listWebsite="urn:website_2013_2.lists.webservices.netsuite.com" xmlns:fileCabinet="urn:filecabinet_2013_2.documents.webservices.netsuite.com" xmlns:listEmp="urn:employees_2013_2.lists.webservices.netsuite.com"> 
    <env:Header> 
    <platformMsgs:passport> 
     <platformCore:email>[REDACTED]</platformCore:email> 
     <platformCore:password>[REDACTED]</platformCore:password> 
     <platformCore:account>[REDACTED]</platformCore:account> 
     <platformCore:role internalId="3"/> 
    </platformMsgs:passport> 
    </env:Header> 
    <env:Body> 
    <platformMsgs:add> 
     <platformMsgs:record xsi:type="tranSales:Invoice"> 
     <tranSales:email>[REDACTED]</tranSales:email> 
     <tranSales:isTaxable>false</tranSales:isTaxable> 
     <tranSales:entity internalId="26017" externalId="[REDACTED]" type="customer"/> 
     <tranSales:itemList> 
      <tranSales:item> 
      <tranSales:item internalId="152"/> 
      <tranSales:line>1</tranSales:line> 
      <tranSales:orderLine>1</tranSales:orderLine> 
      <tranSales:amount>313</tranSales:amount> 
      <tranSales:location internalId="1" type="location"/> 
      <tranSales:revRecStartDate>2014-12-01T08:13:00.000Z</tranSales:revRecStartDate> 
      <tranSales:revRecEndDate>2015-12-01T08:13:00.000Z</tranSales:revRecEndDate> 
      </tranSales:item> 
     </tranSales:itemList> 
     <tranSales:location internalId="1" type="location"/> 
     </platformMsgs:record> 
    </platformMsgs:add> 
    </env:Body> 
</env:Envelope> 

D, [2014-12-19T16:48:04.091365 #13995] DEBUG -- : HTTPI POST request to webservices.sandbox.netsuite.com (net_http) 
I, [2014-12-19T16:48:05.738270 #13995] INFO -- : SOAP response (status 200) 
D, [2014-12-19T16:48:05.738785 #13995] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Header> 
    <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2013_2.platform.webservices.netsuite.com"> 
     <platformMsgs:nsId>WEBSERVICES_[REDACTED]_121920141668476805866012724_a7c7c427c826</platformMsgs:nsId> 
    </platformMsgs:documentInfo> 
    </soapenv:Header> 
    <soapenv:Body> 
    <addResponse xmlns="urn:messages_2013_2.platform.webservices.netsuite.com"> 
     <writeResponse> 
     <platformCore:status xmlns:platformCore="urn:core_2013_2.platform.webservices.netsuite.com" isSuccess="false"> 
      <platformCore:statusDetail type="ERROR"> 
      <platformCore:code>INSUFFICIENT_PERMISSION</platformCore:code> 
      <platformCore:message>You do not have permissions to set a value for element location 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.</platformCore:message> 
      </platformCore:statusDetail> 
     </platformCore:status> 
     </writeResponse> 
    </addResponse> 
    </soapenv:Body> 
</soapenv:Envelope> 

=> false 
[4] pry(main)> 
+0

아래 해결책을 시도해 보셨습니까? 알려줘. –

답변

1

: 나는 오류를 얻을 송장 자체에 위치를 설정하려고 할 때 그러나

Multi-location Inventory Error (MLI_LOCATION_REQUIRED): this transaction or its items must have locations.

: 나는 오류 [2] pry (main)> invoice.location = ottawa) 귀하의 질문에 게시 된, 나는 당신이 "Make_inventory_available"필드가 NetSuite 내부의 위치 기록에 false로 설정되어있는 것을 확인합니다.

당신은 아래 시도하고 작동하는지 알려 수 :

  1. 넷 스위트 사용자 인터페이스에서 탐색 설정에 -> 회사 -> (분류 아래) 위치.
  2. 내부 ID가 "1"즉 "오타와"인 위치를 수정하십시오.
  3. "MAKE INVENTORY AVAILABLE"확인란 필드를 true로 설정하십시오.
  4. 이제 첫 번째 soap xml 요청 ([1] pry (main))> invoice.add에 게시 된 항목 레벨의 위치 필드를 설정하여 invoice.add 연산을 수행해보십시오.