NetSuite发票创建MLI\u位置\u是必需的,但Invoice.LOCATION不可设置

NetSuite发票创建MLI\u位置\u是必需的,但Invoice.LOCATION不可设置,netsuite,invoice,inventory,Netsuite,Invoice,Inventory,似乎大多数人都在使用PHP工具包进行NetSuite Web服务交互;我不是,但我将粘贴SOAP编码的请求/响应,希望有人能提供帮助(cougsuite resourceshough) 我正在尝试使用单个发票项创建新发票。我得到一个错误: 多地点库存错误(MLI_location_REQUIRED):此事务处理或其项目必须有地点 但是,当我尝试在发票本身上设置位置时,会出现以下错误: 由于以下原因之一,您没有为元素位置设置值的权限:1)该字段为只读;2) 相关特征被禁用;3) 该字段在创建或更新

似乎大多数人都在使用PHP工具包进行NetSuite Web服务交互;我不是,但我将粘贴SOAP编码的请求/响应,希望有人能提供帮助(cougsuite resourceshough)

我正在尝试使用单个发票项创建新发票。我得到一个错误:

多地点库存错误(MLI_location_REQUIRED):此事务处理或其项目必须有地点

但是,当我尝试在发票本身上设置位置时,会出现以下错误:

由于以下原因之一,您没有为元素位置设置值的权限:1)该字段为只读;2) 相关特征被禁用;3) 该字段在创建或更新记录时可用,但在这两种情况下都不可用

[1]撬动(主)>invoice.add
D、 [2014-12-19T16:47:19.997923#13995]调试--:HTTPI获取对webservices.sandbox.netsuite.com的请求(net#http)
一、 [2014-12-19T16:47:20.464235#13995]信息--:SOAP请求:https://webservices.sandbox.netsuite.com/services/NetSuitePort_2013_2
一、 [2014-12-19T16:47:20.464378#13995]信息--:SOAPAction:“添加”,内容类型:text/xml;字符集=UTF-8,内容长度:2568
D、 [2014-12-19T16:47:20.464926#13995]调试--:
[修订]
[修订]
[修订]
[修订]
假的
1.
1.
313
2014-12-01T08:13:00.000Z
2015-12-01T08:13:00.000Z
D、 [2014-12-19T16:47:20.465337#13995]调试--:HTTPI向webservices.sandbox.netsuite.com发布请求(net#http)
一、 [2014-12-19T16:47:23.786293#13995]信息--:SOAP响应(状态200)
D、 [2014-12-19T16:47:23.786660#13995]调试--:
网站服务[编辑]-12192014168433096579618905-1be2c0a823e5
MLI_要求
多地点库存错误(MLI_location_REQUIRED):此事务处理或其项目必须有地点。
警告
伪造账单行项目:您在所有位置只有0个可用项目(0个延期订购,0个已订购)。
=>错误
[2] pry(主)>invoice.location=渥太华
=>#“渥太华”,
:is_inactive=>false,
:收件人=>“渥太华”,
:addr1=>“[修订]”,
:城市=>“渥太华”,
:state=>“打开”,
:zip=>“[修订]”,
:country=>“\u canada”,
:addr_text=>“渥太华\n[修订]\nOttawa ON[修订]”,
:override=>false,
:make_inventory_available=>false},
@外部id=零,
@内部\u id=“1”>
[3] pry(主)>invoice.add
D、 [2014-12-19T16:48:03.626321#13995]调试--:HTTPI获取对webservices.sandbox.netsuite.com的请求(net#http)
一、 [2014-12-19T16:48:04.090118#13995]信息--:SOAP请求:https://webservices.sandbox.netsuite.com/services/NetSuitePort_2013_2
一、 [2014-12-19T16:48:04.090331#13995]信息--:SOAPAction:“添加”,内容类型:text/xml;字符集=UTF-8,内容长度:2640
D、 [2014-12-19T16:48:04.090841#13995]调试--:
[修订]
[修订]
[修订]
[修订]
假的
1.
1.
313
2014-12-01T08:13:00.000Z
2015-12-01T08:13:00.000Z
D、 [2014-12-19T16:48:04.091365#13995]调试--:HTTPI向webservices.sandbox.netsuite.com发布请求(net#http)
一、 [2014-12-19T16:48:05.738270#13995]信息--:SOAP响应(状态200)
D、 [2014-12-19T16:48:05.738785#13995]调试--:
Web服务\uu[redact]\u 12192014168476805866012724 \u a7c7c427c826
权限不足
由于以下原因之一,您没有为元素位置设置值的权限:1)该字段为只读;2) 相关特征被禁用;3) 该字段在创建或更新记录时可用,但在这两种情况下都不可用。
=>错误
[4] 撬动(主)>
查看您问题中发布的“invoice.location”JSON数据([2]pry(main)>invoice.location=渥太华),我发现您在NetSuite内部的位置记录中将“make_inventory_available”字段设置为false

你能试试下面的方法并告诉我它是否有效吗:

  • 在NetSuite用户界面中,导航到设置->公司->位置(在分类下)
  • 编辑内部Id为“1”的位置,即“渥太华”
  • 将复选框字段“使库存可用”设置为true
  • 现在尝试执行invoice.add操作,方法是将项目级别上的位置字段设置为第一个soap xml请求中发布的位置([1]pry(main)>invoice.add)

  • 您是否尝试了以下解决方案?让我知道。
    [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)>