NetSuite Invoice Creation MLI_LOCATION_REQUIRED but invoice.location unsettable - netsuite
Seems like most people are using the PHP Toolkit for NetSuite webservices interaction; I am not, but I'll paste the SOAP encoded request/response in the hopes someone can help (coughSuite Resourcescough).
I'm trying to create a new invoice with a single invoice item. I get the error:
Multi-location Inventory Error (MLI_LOCATION_REQUIRED): this transaction or its items must have locations.
However when I try to set the location on the invoice itself I get the error:
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)>
Looking at the "invoice.location" JSON Data ([2] pry(main)> invoice.location = ottawa) posted in your question, i see you have "make_inventory_available" field set as false on the Location Record inside of NetSuite.
Could you try the below and let me know if it works:
In NetSuite User Interface, Navigate to Setup -> Company -> Locations (under Classifications).
Edit the Location with Internal Id "1" i.e. "Ottawa".
Set the Checkbox Field "MAKE INVENTORY AVAILABLE" to true.
Now try performing the invoice.add operation by setting the location field on Item Level as posted in your first soap xml request ([1] pry(main)> invoice.add).
Related
Define permission dont work in lifeary 7.1
Hi have 2 entity and 1 portlet: Entity 1: Autore Entity 2: Opera Portlet: BibliotecaWebPortlet I have create a default.xml for the portlet in resource>resource-action : <?xml version="1.0"?> <!DOCTYPE resource-action-mapping PUBLIC "-//Liferay//DTD Resource Action Mapping 7.1.0//EN" "http://www.liferay.com/dtd/liferay-resource-action-mapping_7_1_0.dtd"> <resource-action-mapping> <portlet-resource> <portlet-name>it_cloudtec_biblioteca_portlet_BibliotecaWebPortlet</portlet-name> <permissions> <supports> <action-key>AGGIUNGI_AL_TEMPLATE</action-key> <action-key>CONFIGURAZIONE</action-key> <action-key>VISUALIZZA</action-key> </supports> <site-member-defaults> <action-key>VISUALIZZA</action-key> </site-member-defaults> <guest-defaults> <action-key>VISUALIZZA</action-key> </guest-defaults> <guest-unsupported> <action-key>AGGIUNGI_AL_TEMPLATE</action-key> <action-key>CONFIGURAZIONE</action-key> </guest-unsupported> </permissions> </portlet-resource> </resource-action-mapping> (Portlet name is correct) i have created default.xml for service in resource>resource-action: <?xml version="1.0"?> <!DOCTYPE resource-action-mapping PUBLIC "-//Liferay//DTD Resource Action Mapping 7.1.0//EN" "http://www.liferay.com/dtd/liferay-resource-action-mapping_7_1_0.dtd"> <resource-action-mapping><model-resource> <model-name>it.cloudtec.biblioteca</model-name> <portlet-ref> <portlet-name>it_cloudtec_biblioteca_portlet_BibliotecaWebPortlet</portlet-name> </portlet-ref> <root>true</root> <weight>1</weight> <permissions> <supports> <action-key>AGGIUNGI</action-key> </supports> <site-member-defaults> </site-member-defaults> <guest-defaults /> <guest-unsupported> </guest-unsupported> </permissions> </model-resource><model-resource> <model-name>it.cloudtec.biblioteca.model.Autore</model-name> <portlet-ref> <portlet-name>it_cloudtec_biblioteca_portlet_BibliotecaWebPortlet</portlet-name> </portlet-ref> <weight>2</weight> <permissions> <supports> <action-key>AGGIUNGI_AUTORE</action-key> <action-key>CANCELLA_AUTORE</action-key> <action-key>AGGIORNA_AUTORE</action-key> <action-key>VISUALIZZA_LISTA_AUTORI</action-key> </supports> <site-member-defaults> <action-key>VISUALIZZA_LISTA_AUTORI</action-key> </site-member-defaults> <guest-defaults> <action-key>VISUALIZZA_LISTA_AUTORI</action-key> </guest-defaults> <guest-unsupported> <action-key>AGGIUNGI_AUTORE</action-key> <action-key>CANCELLA_AUTORE</action-key> <action-key>AGGIORNA_AUTORE</action-key> </guest-unsupported> </permissions> </model-resource> </resource-action-mapping> Why dont show the action key in control panel? (Website > user > role s > select my custom role > define permission > site administration > application >BibliotecaWebApp) I view only default's keys. > Add to Page - Configuration - Permissions - Preferences portlet.properties is present in portlet and service modules.
Error processing / merging manifest
I get this error W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\flavor_customer1Debug\processFlavor_customer1DebugManifest\merged\AndroidManifest.xml:49: error: resource string/MyAppName (aka com.customer1.app:string/MyAppName) not found. error: failed processing manifest. ... My gradle contains this flavor_customer1 { java.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/java/"] manifest.srcFile "W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml" assets.srcDirs = ["W:/android-studio-projects/sharedid/app/src/customer1/assets/"] resources.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/res/", "W:/android-studio-projects/sharedid/app/src/customer1/res/"] } I have defined MyAppName in file "W:/android-studio-projects/sharedid/app/src/customer1/res/values/strings_specific.xml" <?xml version="1.0" encoding="utf-8"?> <resources> <string name="MyAppName">Customer 1</string> </resources> In "W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml" I use the string like this <application android:allowBackup="true" android:icon="#drawable/app_logo__forlarge" android:label="#string/MyAppName" android:theme="#style/AppBaseTheme_Customer_One" android:name="com.shared.app.MyApp" > ... What am I missing? I am trying to switch over to using product flavors
Apparentlt merge depends on "main" folder also containing strings.xml even though each flavor has their own
How to resolve Manifest merger Failed error
I am getting manifest merger failed error when i add elegeant number button library to my gradle files. Manifest merger failed : Attribute application#icon value=(#mipmap/app_logoo) from AndroidManifest.xml:20:9-41 is also present at [com.cepheuen.elegant-number-button:lib:1.0.3] AndroidManifest.xml:13:9-43 value=(#mipmap/ic_launcher). Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:18:5-56:19 to override. I have tried adding all the versions of this library but none works
As the suggestion in error says, you need to add tools:replace="android:icon" to your AndroidManifest.xml. tools:replace means you want to replace the attribute value with your current attribute value in the AndroidManifest.xml. You can do it something like this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.yourapp"> <application android:name=".YourApp" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" tools:replace="android:icon"> <!-- code omitted here --> </application> </manifest>
NOTE : Add this to your build.gradle and make sure you are using the same versions as '26.0.2' - configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '26.0.2' } } } }
Geoserver WMS service with CQL fitler polygon retuns always 0 matched features
I am trying to make a request with CQL filter intersects with a polygon that you can draw to my geoserver, but WFS service always returns 0 matched, I am using this configuration, and I am leaving an example polygon as filter. { 'service': 'wfs', 'version': '2.0.0', 'typename': 'workspace:layer', 'request': 'GetFeature', 'startIndex' :0, 'count': 10, 'CQL_FILTER' : 'intersects(geom,POLYGON((-103.33516105156251 21.13532635981934,-103.28227802846054 21.132733146568928,-103.229979857529 21.12498218902883,-103.17884473812032 21.112159207316008,-103.129437648214 21.09440598406221,-103.08230394289987 21.071918752547948,-103.03796319974948 21.044945968778553,-102.99690338665144 21.013785495572105,-102.95957542220131 20.97878123388898,-102.92638819220429 20.94031924318721,-102.89770407845843 20.898823398443987,-102.87383504794745 20.854750636568248,-102.85503934209035 20.808585849193573,-102.84151879698065 20.76083648225345,-102.8334168167928 20.712026905295165,-102.83081701391326 20.662692615193333,-102.83374252101711 20.613374339803585,-102.84215597238499 20.564612107190598,-102.8559601443285 20.516939345418038,-102.87499923773628 20.47087707655628,-102.89906077950268 20.42692826660399,-102.92787811397666 20.385572390490132,-102.9611334505628 20.347260268283343,-102.99846142920335 20.31240922524045,-103.03945316163956 20.281398624429745,-103.08366070305235 20.25456581641679,-103.13060190588125 20.232202545947004,-103.17976560527028 20.214551850743995,-103.23061708365469 20.201805482504277,-103.28260376044557 20.19410187494658,-103.33516105156251 20.191524678402207,-103.38771834267946 20.19410187494658,-103.43970501947032 20.201805482504277,-103.49055649785474 20.214551850743995,-103.53972019724378 20.232202545947004,-103.58666140007269 20.25456581641679,-103.63086894148547 20.281398624429745,-103.67186067392169 20.31240922524045,-103.70918865256225 20.347260268283343,-103.74244398914837 20.385572390490132,-103.77126132362237 20.42692826660399,-103.79532286538875 20.47087707655628,-103.81436195879652 20.516939345418038,-103.82816613074004 20.564612107190598,-103.8365795821079 20.613374339803585,-103.83950508921177 20.662692615193333,-103.83690528633221 20.712026905295165,-103.82880330614438 20.76083648225345,-103.81528276103468 20.808585849193573,-103.79648705517758 20.854750636568244,-103.77261802466661 20.898823398443987,-103.74393391092073 20.94031924318721,-103.71074668092372 20.97878123388898,-103.67341871647359 21.013785495572105,-103.63235890337553 21.044945968778553,-103.58801816022518 21.071918752547948,-103.54088445491104 21.09440598406221,-103.49147736500471 21.112159207316008,-103.44034224559604 21.12498218902883,-103.38804407466449 21.132733146568928,-103.33516105156251 21.13532635981934)))', 'PROPERTYNAME': 'id,name'} If I use the same polygon on WMS service 1.1.1, works perfectly. This is the response: "<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:mapa_jalisco="mapajalisco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="0" numberReturned="0" timeStamp="2017-03-29T22:35:42.807Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8181/geoserver/schemas/wfs/2.0/wfs.xsd mapajalisco http://localhost:8181/geoserver/mapa_jalisco/wfs?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=mapa_jalisco%3Amarginacion_municipios http://www.opengis.net/gml/3.2 http://localhost:8181/geoserver/schemas/gml/3.2.1/gml.xsd"/>" Help me please.
libxmljs: how to use xinclude?
I try to use libxmljs with nodejs. In my sample I want to use the xi:include. <ord:order xmlns:ord="http://example.org/ord" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://example.org/ord chapter04ord1.xsd" xmlns:xi="http://www.w3.org/2001/XInclude"> <number>123ABBCC123</number> <customer> <name>Priscilla Walmsley</name> <number>15466</number> </customer> <items> <xi:include href="/Users/mar/ws_e/libxml/test/resources/chapter5prod.xml" /> </items> </ord:order> include File: <ord:product xmlns:ord="http://example.org/ord" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://example.org/ord chapter04ord1.xsd"> <number>557</number> <name>Short-Sleeved Linen Blouse</name> <size system="US-DRESS">10</size> <color value="blue"/> </ord:product> This is my code: var xsdDoc = libxml.parseXml(schemaSource); var xmlDocValid = libxml.parseXml(docSource); var xmlDocInvalid = libxml.parseXml(xml_invalid); xmlDocValid.validate(xsdDoc); console.dir(xmlDocValid); console.dir(xmlDocValid.validationErrors); Then I get the error: Document { errors: [], validationErrors: [ { Error: Element '{http://www.w3.org/2001/XInclude}include': This element is not expected. Expected is ( product ). So my question is how to use the x:include right at libxmljs? Kind regards Markus