0

I'm using NetSuite SOAP API to create new departments from another application. The request is treated without errors and the department is created. My problem is the new internalid incrementation jump to 100 (ex: last created department internalid is 657, if i use SOAP API new created department got id 757 instead of 658).

Did i miss something to get a correct +1 incrementation ?

Here an code exemple of the SOAP request:

<SOAP-ENV:Body>
    <ns3:add>
        <ns3:record xsi:type="ns1:Department" externalId="80004">
            <ns1:name>80004 - my new Department</ns1:name>
            <ns1:parent/>
            <ns1:subsidiaryList>
                <ns2:recordRef internalId="1"/>
            </ns1:subsidiaryList>
            <ns1:customFieldList>
                <ns2:customField xsi:type="ns2:SelectCustomFieldRef" internalId="18">
                    <ns2:value typeId="4" internalId="7">
                        <ns2:name>Projet</ns2:name>
                    </ns2:value>
                </ns2:customField>
            </ns1:customFieldList>
        </ns3:record>
    </ns3:add>
</SOAP-ENV:Body>
tompasto
  • 3
  • 3

1 Answers1

2

You cannot rely on internal ids being sequential. They sometimes jump by 100 for items created in the same run of a script.

I believe it has to do with Netsuite not being transactional but whatever the reason it's normal.

bknights
  • 14,408
  • 2
  • 18
  • 31
  • This wouldn't be transactional vs non-transactional, but quite simply a fact of life in SQL (whether MS or Oracle) that IDENTITY does not guarantee the auto-increment value because it depends on things like server restarts, other activity, etc. Bottom line, it's nothing to be concerned about. – Pierre Plourde Jan 05 '22 at 14:48