Automating document number assignment

eConnect XML documents that create Microsoft Dynamics GP documents require you to supply a number that uniquely identifies the Microsoft Dynamics GP document being created. To simplify the numbering of new documents, several types of eConnect XML documents can automatically retrieve and assign a document number from Microsoft Dynamics GP.

To have eConnect supply the 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 element’s value must remain empty.

The following XML example shows an XML node from a GL transactions schema that uses eConnect to assign the GL journal entry number. Notice how the value of the <JRNENTRY> element of the <taGLTransactionHeaderInsert> XML node is empty.

<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>

The empty <JRNENTRY> element prompts eConnect to query Microsoft Dynamics GP for the next available GL journal entry number. The query returns a number that eConnect uses to populate the empty <JRNENTRY> element.

SOP documents do not require you to include an empty element. For new SOP documents, eConnect automatically assigns the next SOP document number if the <SOPNUMBE> element is empty or the SOP transaction schema’s XML node excludes the <SOPNUMBE> element.


The following table displays the eConnect documents and schemas that support the automatic assignment of document numbers:

[spacer]

Document Type

Schema name

XML element

General Ledger

GL transactions

<JRNENTRY></JRNENTRY>

Inventory

IV inventory transaction

<IVDOCNBR></IVDOCNBR>

Inventory

IV inventory transfer

<IVDOCNBR></IVDOCNBR>

Purchase Order Processing

POP receivings

<POPRCTNM></POPRCTNM>

Purchase Order Processing

POP transaction

<PONUMBER></PONUMBER>

Purchasing

PM transaction

<VCHNUMWK></VCHNUMWK>

Receivables

RM transaction

<DOCNUMBR></DOCNUMBR>

Sales Order Processing

SOP transaction

<SOPNUMBE></SOPNUMBE>


If your eConnect XML document populates the XML elements that identify the document, eConnect always uses your value when creating the Microsoft Dynamics GP document.

To automatically assign a number to a SOP document, eConnect uses the values of the <SOPTYPE> and <DOCID> elements of the <taSopHdrIvcInsert> XML node to determine the type of SOP document number to retrieve.


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>


Documentation Feedback