title: Netsuite reconfigure inventory detail error
body: <p>On a custom record creation i am calling a map reduce script that in creating a negative inventory adjustment.
  The script is called on after submit.
  I am using following code to populate the inventory detail subrecords</p>
  <pre><code>for (var n = 0; n &lt; cp_lotsearch.length; n++) {
                      if (cree_onhand &gt; 0) {
                          var cp_lotid = cp_lotsearch[n].getValue({name: 'internalid'});
                          var cp_parentcasenum = cp_lotsearch[n].getValue({name: 'custrecord_nsts_ia_lot'});
                          var itemsearch = search.create({
                              type: 'item',
                              filters: ['inventorynumber.inventorynumber', 'is', cp_parentcasenum],
                              columns: [search.createColumn({name: &quot;quantityonhand&quot;, join: &quot;inventorynumber&quot;})]
                          }).run().getRange({
                              start: 0,
                              end: 1000
                          });
                          var qtyonhand = itemsearch[0].getValue({name: 'quantityonhand', join: 'inventorynumber'});
                          var remain_qtyonhand = Number(qtyonhand) - Number(cree_onhand);
                          if (remain_qtyonhand &gt;= 0) {
                              var reduceqty = 0 - Number(cree_onhand);
                          } else {
                              var reduceqty = 0 - Number(qtyonhand);
                          }
                          log.debug(&quot;reduceqty&quot;, reduceqty);
                          subrecord.insertLine({sublistId: 'inventoryassignment',line: n});
  
                          subrecord.setSublistText({ sublistId: 'inventoryassignment',fieldId: 'issueinventorynumber',line: n,text: cp_parentcasenum});
                          subrecord.setSublistValue({sublistId: 'inventoryassignment',fieldId: 'binnumber', line: n, value: cree_bin});
                          subrecord.setSublistValue({sublistId: 'inventoryassignment',fieldId: 'quantity',line: n,value: reduceqty});
                          log.debug(&quot;reduceqty added to inventory detail&quot;, reduceqty);
                          cree_onhand = Number(cree_onhand) + Number(reduceqty);
                          
                      }
                  }
                  var invadjid = parentcase_inv_Adj.save({
                      enableSourcing: true,
                      ignoreMandatoryFields: true
                  });
  </code></pre>
  <p>When i try to run this code i am getting following error:</p>
  <p><strong>&quot;type&quot;:&quot;error.SuiteScriptError&quot;,&quot;name&quot;:&quot;USER_ERROR&quot;,&quot;message&quot;:&quot;You still need to reconfigure the inventory detail record after changing the quantity.&quot;</strong></p>
  <p>Same code is running perfect in sandbox account but in production it is throwing error</p>
  <p>Can anyone help me to solve this error?</p>
  <p>I Got one solution in suite answer that i already tried but it is not working here is link to it:
  <a href="https://netsuite.custhelp.com/app/answers/detail/a_id/80790/kw/reconfigure%20error" rel="nofollow noreferrer">https://netsuite.custhelp.com/app/answers/detail/a_id/80790/kw/reconfigure%20error</a></p>