Automating document number assignment
Microsoft Dynamics GP uses document numbers to uniquely identify each document. Many types of documents have document numbers. Each document type has a specified series of numbers and a new document is given the next available number from the series. When you use eConnect to create a document, you have to give that document a unique document number.
To simplify the numbering of new documents, several types of eConnect XML documents automate the assignment of the document number. The document gets the next available number at the time that it is created in Microsoft Dynamics GP.
The following table shows the eConnect documents and schemas that support the automated assignment of a document number:
Document Type |
Schema name |
XML element |
---|---|---|
General Ledger |
GLTransaction |
<JRNENTRY></JRNENTRY> |
Inventory |
IVInventoryTransaction |
<IVDOCNBR></IVDOCNBR> |
Inventory |
IVInventoryTransfer |
<IVDOCNBR></IVDOCNBR> |
Purchase Order Processing |
POPReceivings |
<POPRCTNM></POPRCTNM> |
Purchase Order Processing |
POPTransaction |
<PONUMBER></PONUMBER> |
Purchasing |
PMTransaction |
<VCHNUMWK></VCHNUMWK> |
Receivables |
RMTransaction |
<DOCNUMBR></DOCNUMBR> |
Sales Order Processing |
SOPTransaction |
<SOPNUMBE></SOPNUMBE> |
To have eConnect supply a document number, your XML document must contain a schema that supports automatic numbering. The XML nodes in the schema must include the XML element that specifies the document number, but the value of the element must remain empty.
The following XML example shows how to use automated number assignment for a new GL transaction document. Notice how the value of the <JRNENTRY> element is empty. When the business object encounters the empty element, the business object performs a query that gets the next available GL journal entry number. The business object uses the query result to populate the <JRNENTRY> element.
<taGLTransactionHeaderInsert> <BACHNUMB>TEST14</BACHNUMB> <JRNENTRY></JRNENTRY> <REFRENCE>General Transaction</REFRENCE> <TRXDATE>2007-01-21</TRXDATE> <RVRSNGDT>1900-01-01</RVRSNGDT> <TRXTYPE>0</TRXTYPE> <SQNCLINE>16384</SQNCLINE> </taGLTransactionHeaderInsert>
However, SOP documents do not require an empty element. When you create a SOP document, eConnect assigns a document number even if the <SOPNUMBE> element is excluded from the XML document.
There are several types of SOP documents and each type uses a separate series of document numbers. To specify the type of a SOP document, you use the <SOPTYPE> and <DOCID> elements.
For example, you want to create a new sales order document. You add a <taSopHdrIvcInsert> XML node to you document. To get the correct type of document number, you populate the <SOPTYPE> with 2 and the <DOCID> with STDORD. You do not include the <SOPNUMBE> element. When you submit the document, it gets the next available document number for a sales order.
Hint: You can override the behavior that adds the document number. If you populate the document number element with a value, eConnect always uses the specified value in the Microsoft Dynamics GP document.
The following XML example shows an eConnect XML document that uses automatic document numbering. Notice how the <taGLTransactionLineInsert> and <taGLTransactionHeaderInsert> XML nodes include an empty <JRNENTRY> element.
<eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes"> <GLTransactionType> <taGLTransactionLineInsert_Items> <taGLTransactionLineInsert> <BACHNUMB>TEST14</BACHNUMB> <JRNENTRY></JRNENTRY> <SQNCLINE>16384</SQNCLINE> <ACTINDX>0</ACTINDX> <CRDTAMNT>15.00</CRDTAMNT> <DEBITAMT>0.00</DEBITAMT> <ACTNUMST>000-2300-00</ACTNUMST> </taGLTransactionLineInsert> <taGLTransactionLineInsert> <BACHNUMB>TEST14</BACHNUMB> <JRNENTRY></JRNENTRY> <SQNCLINE>32768</SQNCLINE> <ACTINDX>0</ACTINDX> <CRDTAMNT>0.00</CRDTAMNT> <DEBITAMT>15.00</DEBITAMT> <ACTNUMST>000-2310-00</ACTNUMST> </taGLTransactionLineInsert> </taGLTransactionLineInsert_Items> <taGLTransactionHeaderInsert> <BACHNUMB>TEST14</BACHNUMB> <JRNENTRY></JRNENTRY> <REFRENCE>General Transaction</REFRENCE> <TRXDATE>2007-01-21</TRXDATE> <RVRSNGDT>1900-01-01</RVRSNGDT> <TRXTYPE>0</TRXTYPE> <SQNCLINE>16384</SQNCLINE> </taGLTransactionHeaderInsert> </GLTransactionType> </eConnect>