Error in SY_SDataServer.pvc when trying to create Invoice with one line using SData

SOLVED

I’m using Sage 100 Premium ERP 2013 (5.00.0.9) and SDataCSharpClientLib to work with SData.

I’m trying to create an Invoice entry with one line in it with a single SData request. And I’m getting the error: ‘Error in E:\Sage\Sage100 Premium ERP\MAS90\SY\SY_SDataServer.pvc at line 1312, Method ServeCommon2, PVX Error code 23’. The similar request for Bill’s creation works fine. Can someone help me to resolve this issue? Thank you.

The request generated for the Invoice creation is the following:

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://schemas.sage.com/sdata/http/2008/1" xmlns="http://www.w3.org/2005/Atom">
  <id>http://192.168.110.27/sdata/MasApp/MasContract/ABX/SO_InvoiceHeader/$template</id>
  <sdata:payload>
    <SO_InvoiceHeaderSPECIAL sdata:uri="http://192.168.110.27/sdata/MasApp/MasContract/ABX/SO_InvoiceHeader/$template" xmlns="">
      <InvoiceNo>1234</InvoiceNo>
      <InvoiceDate>2014-09-22T00:00:00-07:00</InvoiceDate>
      <InvoiceType>IN</InvoiceType>
      <SalesOrderNo>0000011</SalesOrderNo>
      <OrderType>S</OrderType>
      <OrderStatus>N</OrderStatus>
      <OrderDate>2014-09-22T00:00:00-07:00</OrderDate>
      <ARDivisionNo>01</ARDivisionNo>
      <CustomerNo>ABF</CustomerNo>
      <BillToDivisionNo />
      <BillToCustomerNo />
      <BillToName>American Business Futures</BillToName>
      <BillToAddress1>2131 N. 14th Street</BillToAddress1>
      <BillToAddress2>Suite 100</BillToAddress2>
      <BillToAddress3>Accounting Department</BillToAddress3>
      <BillToCity>Irvine</BillToCity>
      <BillToState>CA</BillToState>
      <BillToZipCode>92618</BillToZipCode>
      <BillToCountryCode>USA</BillToCountryCode>
      <ShipToCode>2</ShipToCode>
      <ShipToName />
      <ShipToAddress1>2131 N. 14th Street</ShipToAddress1>
      <ShipToAddress2>Suite 100</ShipToAddress2>
      <ShipToAddress3>Accounting Department</ShipToAddress3>
      <ShipToCity>Irvine</ShipToCity>
      <ShipToState>CA</ShipToState>
      <ShipToZipCode>92618</ShipToZipCode>
      <ShipToCountryCode>USA</ShipToCountryCode>
      <ShipDate>2014-09-22T00:00:00-07:00</ShipDate>
      <ShipVia>YELLOW</ShipVia>
      <ShipZone />
      <ShipZoneActual />
      <ShipWeight />
      <CustomerPONo />
      <FOB />
      <WarehouseCode>000</WarehouseCode>
      <ConfirmTo>Artie Johnson</ConfirmTo>
      <Comment />
      <TaxSchedule>NONTAX</TaxSchedule>
      <TermsCode>01</TermsCode>
      <TaxExemptNo />
      <PrintInvoice>Y</PrintInvoice>
      <InvoicePrinted>N</InvoicePrinted>
      <AcceptCashOnly>N</AcceptCashOnly>
      <CustomerType />
      <ResidentialAddress>N</ResidentialAddress>
      <InvalidTaxCalc>N</InvalidTaxCalc>
      <FreightCalculationMethod>W</FreightCalculationMethod>
      <CheckNoForDeposit />
      <ApplyToInvoiceNo />
      <LotSerialLinesExist>N</LotSerialLinesExist>
      <SalespersonDivisionNo>01</SalespersonDivisionNo>
      <SalespersonNo>0300</SalespersonNo>
      <SplitCommissions>N</SplitCommissions>
      <SalespersonDivisionNo2 />
      <SalespersonNo2 />
      <SalespersonDivisionNo3 />
      <SalespersonNo3 />
      <SalespersonDivisionNo4 />
      <SalespersonNo4 />
      <SalespersonDivisionNo5 />
      <SalespersonNo5 />
      <InvoiceDueDate>2014-10-22T00:00:00-07:00</InvoiceDueDate>
      <DiscountDueDate>2014-09-22T00:00:00-07:00</DiscountDueDate>
      <BatchNo>00005</BatchNo>
      <EBMSubmissionType />
      <EBMUserIDSubmittingThisOrder />
      <EBMUserType />
      <EMailUpdateFlagForRestart />
      <FaxNo />
      <BatchFax>N</BatchFax>
      <BatchEmail>N</BatchEmail>
      <EmailAddress>[email protected]</EmailAddress>
      <PaymentType />
      <OtherPaymentTypeRefNo />
      <PaymentTypeCategory>D</PaymentTypeCategory>
      <OrderChangedInShipping>N</OrderChangedInShipping>
      <LinesChangedInShipping>N</LinesChangedInShipping>
      <ShipperID>1</ShipperID>
      <ShipStatus>S</ShipStatus>
      <StarshipFreightUsed>N</StarshipFreightUsed>
      <StarshipRecordsCreated>N</StarshipRecordsCreated>
      <JobNo />
      <RMANo />
      <CRMUserID />
      <CRMCompanyID />
      <CRMPersonID />
      <CRMOpportunityID />
      <InvalidWarrantyCode>N</InvalidWarrantyCode>
      <TaxableSubjectToDiscount>0.0000</TaxableSubjectToDiscount>
      <NonTaxableSubjectToDiscount>0.0000</NonTaxableSubjectToDiscount>
      <TaxSubjToDiscPrcntOfTotSubjTo>0.0000</TaxSubjToDiscPrcntOfTotSubjTo>
      <DiscountRate>0.0000</DiscountRate>
      <TaxableAmt>0.0000</TaxableAmt>
      <NonTaxableAmt>0.0000</NonTaxableAmt>
      <SalesTaxAmt>0.0000</SalesTaxAmt>
      <DiscountAmt>0.0000</DiscountAmt>
      <RetentionAmt>0.0000</RetentionAmt>
      <TotalSubjectToComm>0.0000</TotalSubjectToComm>
      <CommissionRate>10.0000</CommissionRate>
      <CommissionAmt>0.0000</CommissionAmt>
      <SplitCommRate2>0.0000</SplitCommRate2>
      <SplitCommRate3>0.0000</SplitCommRate3>
      <SplitCommRate4>0.0000</SplitCommRate4>
      <SplitCommRate5>0.0000</SplitCommRate5>
      <OverrideCommAmt>0.0000</OverrideCommAmt>
      <FreightAmt>0.0000</FreightAmt>
      <CostOfGoodsSoldAmt>0.0000</CostOfGoodsSoldAmt>
      <CostOfGoodsSoldSubjToComm>0.0000</CostOfGoodsSoldSubjToComm>
      <DepositAmt>0.0000</DepositAmt>
      <Weight>0.0000</Weight>
      <SIShippedLinesCOGS>0.0000</SIShippedLinesCOGS>
      <NumberOfCODLabels>0</NumberOfCODLabels>
      <NumberOfBackOrderLines>1</NumberOfBackOrderLines>
      <NumberOfShippingLabels>1</NumberOfShippingLabels>
      <LastNoOfShippingLabels>1</LastNoOfShippingLabels>
      <NumberofPackages>0</NumberofPackages>
      <DateCreated>2014-09-30T00:00:00-07:00</DateCreated>
      <TimeCreated>5.40425</TimeCreated>
      <UserCreatedKey>0000000006</UserCreatedKey>
      <DateUpdated>2014-09-30T00:00:00-07:00</DateUpdated>
      <TimeUpdated>5.40425</TimeUpdated>
      <UserUpdatedKey>0000000006</UserUpdatedKey>
      <SO_InvoicePayment />
      <SO_InvoiceHeaderSPECIALSECOND sdata:uri="http://192.168.110.27/sdata/MasApp/MasContract/ABX/SO_InvoiceDetail/$template">
        <InvoiceNo>1234</InvoiceNo>
        <LineKey>000001</LineKey>
        <LineSeqNo>00000100000000</LineSeqNo>
        <ItemCode>2480-8-50</ItemCode>
        <ItemType>1</ItemType>
        <ItemCodeDesc>Desk, Teak</ItemCodeDesc>
        <ExtendedDescriptionKey />
        <Discount>Y</Discount>
        <Commissionable>Y</Commissionable>
        <SubjectToExemption>Y</SubjectToExemption>
        <WarehouseCode>000</WarehouseCode>
        <ProductLine>DSK</ProductLine>
        <Valuation>3</Valuation>
        <PriceLevel>1</PriceLevel>
        <UnitOfMeasure>EACH</UnitOfMeasure>
        <DropShip>N</DropShip>
        <LotSerialFullyDistributed>Y</LotSerialFullyDistributed>
        <SalesKitLineKey />
        <CostOfGoodsSoldAcctKey>00000009H</CostOfGoodsSoldAcctKey>
        <SalesAcctKey>00000009G</SalesAcctKey>
        <PriceOverridden>N</PriceOverridden>
        <OrderWarehouse>000</OrderWarehouse>
        <ExplodedKitItem>N</ExplodedKitItem>
        <OrderLineKey>000001</OrderLineKey>
        <Revision />
        <BillOption1 />
        <BillOption2 />
        <BillOption3 />
        <BillOption4 />
        <BillOption5 />
        <BillOption6 />
        <BillOption7 />
        <BillOption8 />
        <BillOption9 />
        <BackorderKitCompLine>N</BackorderKitCompLine>
        <StandardKitBill>N</StandardKitBill>
        <SkipPrintCompLine>N</SkipPrintCompLine>
        <AliasItemNo />
        <TaxClass>TX</TaxClass>
        <SOHistoryDetlSeqNo>00000000000001</SOHistoryDetlSeqNo>
        <CustomerAction>N</CustomerAction>
        <WarrantyCode>120</WarrantyCode>
        <ExpirationDate>2015-01-20T00:00:00-08:00</ExpirationDate>
        <ExpirationOverridden>N</ExpirationOverridden>
        <CostOverridden>N</CostOverridden>
        <ItemAction>N</ItemAction>
        <CostCode />
        <CostType />
        <CommentText />
        <PromiseDate>2014-09-22T00:00:00-07:00</PromiseDate>
        <APDivisionNo>03</APDivisionNo>
        <VendorNo>UNITED</VendorNo>
        <PurchaseOrderNo />
        <PurchaseOrderRequiredDate>1753-01-01T00:00:00-08:00</PurchaseOrderRequiredDate>
        <QuantityOrdered>1.0000</QuantityOrdered>
        <QuantityShipped>0.0000</QuantityShipped>
        <QuantityBackordered>1.0000</QuantityBackordered>
        <UnitPrice>3244.9500</UnitPrice>
        <ExtensionAmt>0.0000</ExtensionAmt>
        <ExtendedCost>0.0000</ExtendedCost>
        <ExtendedNegQtyAdj>0.0000</ExtendedNegQtyAdj>
        <UnitCost>2328.0384</UnitCost>
        <UnitOfMeasureConvFactor>1.0000</UnitOfMeasureConvFactor>
        <CommissionAmt>0.0000</CommissionAmt>
        <QuantityPerBill>0.0000</QuantityPerBill>
        <LineDiscountPercent>0.0000</LineDiscountPercent>
        <LineWeight>0.0000</LineWeight>
        <SO_InvoiceTierDistribution />
      </SO_InvoiceHeaderSPECIALSECOND>
    </SO_InvoiceHeaderSPECIAL>
  </sdata:payload>
  <http:httpStatus>200</http:httpStatus>
</entry>

The Sales Order contains just one line (Sales Order Header) and looks like this:

<sdata:payload>
      <SO_SalesOrderHeader sdata:uri="http://192.168.110.27/sdata/MasApp/MasContract/ABX/SO_SalesOrderHeader('0000011')" xmlns="">
        <SalesOrderNo>0000011</SalesOrderNo>
        <OrderDate>2014-09-22T00:00:00-07:00</OrderDate>
        <OrderType>S</OrderType>
        <OrderStatus>N</OrderStatus>
        <MasterRepeatingOrderNo />
        <ShipExpireDate>2014-09-22T00:00:00-07:00</ShipExpireDate>
        <ARDivisionNo>01</ARDivisionNo>
        <CustomerNo>ABF</CustomerNo>
        <BillToDivisionNo />
        <BillToCustomerNo />
        <BillToName>American Business Futures</BillToName>
        <BillToAddress1>2131 N. 14th Street</BillToAddress1>
        <BillToAddress2>Suite 100</BillToAddress2>
        <BillToAddress3>Accounting Department</BillToAddress3>
        <BillToCity>Irvine</BillToCity>
        <BillToState>CA</BillToState>
        <BillToZipCode>92618</BillToZipCode>
        <BillToCountryCode>USA</BillToCountryCode>
        <ShipToCode>2</ShipToCode>
        <ShipToName />
        <ShipToAddress1>2131 N. 14th Street</ShipToAddress1>
        <ShipToAddress2>Suite 100</ShipToAddress2>
        <ShipToAddress3>Accounting Department</ShipToAddress3>
        <ShipToCity>Irvine</ShipToCity>
        <ShipToState>CA</ShipToState>
        <ShipToZipCode>92618</ShipToZipCode>
        <ShipToCountryCode>USA</ShipToCountryCode>
        <ShipVia>YELLOW</ShipVia>
        <ShipZone />
        <ShipZoneActual />
        <ShipWeight />
        <CustomerPONo />
        <FOB />
        <WarehouseCode>000</WarehouseCode>
        <ConfirmTo>Artie Johnson</ConfirmTo>
        <Comment />
        <TermsCode>01</TermsCode>
        <TaxSchedule>NONTAX</TaxSchedule>
        <TaxExemptNo />
        <InvalidTaxCalc>N</InvalidTaxCalc>
        <PrintSalesOrders>Y</PrintSalesOrders>
        <SalesOrderPrinted>N</SalesOrderPrinted>
        <PrintPickingSheets>Y</PrintPickingSheets>
        <PickingSheetPrinted>N</PickingSheetPrinted>
        <LastInvoiceOrderDate>1753-01-01T00:00:00-08:00</LastInvoiceOrderDate>
        <LastInvoiceOrderNo />
        <CurrentInvoiceNo>0001234</CurrentInvoiceNo>
        <CheckNoForDeposit />
        <CycleCode />
        <FaxNo />
        <BatchFax>N</BatchFax>
        <BatchEmail>N</BatchEmail>
        <EmailAddress>[email protected]</EmailAddress>
        <FreightCalculationMethod>W</FreightCalculationMethod>
        <LotSerialLinesExist>N</LotSerialLinesExist>
        <SalespersonDivisionNo>01</SalespersonDivisionNo>
        <SalespersonNo>0300</SalespersonNo>
        <SplitCommissions>N</SplitCommissions>
        <SalespersonDivisionNo2 />
        <SalespersonNo2 />
        <SalespersonDivisionNo3 />
        <SalespersonNo3 />
        <SalespersonDivisionNo4 />
        <SalespersonNo4 />
        <SalespersonDivisionNo5 />
        <SalespersonNo5 />
        <EBMUserType />
        <EBMSubmissionType />
        <EBMUserIDSubmittingThisOrder />
        <PaymentType />
        <OtherPaymentTypeRefNo />
        <PaymentTypeCategory>D</PaymentTypeCategory>
        <CancelReasonCode />
        <RMANo />
        <JobNo />
        <ResidentialAddress>N</ResidentialAddress>
        <CRMUserID />
        <CRMPersonID />
        <CRMOpportunityID />
        <CRMCompanyID />
        <CRMProspectID />
        <TaxableSubjectToDiscount>0.0000</TaxableSubjectToDiscount>
        <NonTaxableSubjectToDiscount>3244.9500</NonTaxableSubjectToDiscount>
        <TaxSubjToDiscPrcntOfTotSubjTo>0.0000</TaxSubjToDiscPrcntOfTotSubjTo>
        <DiscountRate>0.0000</DiscountRate>
        <DiscountAmt>0.0000</DiscountAmt>
        <TaxableAmt>0.0000</TaxableAmt>
        <NonTaxableAmt>3244.9500</NonTaxableAmt>
        <SalesTaxAmt>0.0000</SalesTaxAmt>
        <Weight>0.0000</Weight>
        <FreightAmt>0.0000</FreightAmt>
        <DepositAmt>0.0000</DepositAmt>
        <CommissionRate>10.0000</CommissionRate>
        <SplitCommRate2>0.0000</SplitCommRate2>
        <SplitCommRate3>0.0000</SplitCommRate3>
        <SplitCommRate4>0.0000</SplitCommRate4>
        <SplitCommRate5>0.0000</SplitCommRate5>
        <NumberOfShippingLabels>1</NumberOfShippingLabels>
        <LastNoOfShippingLabels>1</LastNoOfShippingLabels>
        <DateCreated>2014-09-30T00:00:00-07:00</DateCreated>
        <TimeCreated>6.64996</TimeCreated>
        <UserCreatedKey>0000000006</UserCreatedKey>
        <DateUpdated>2014-09-30T00:00:00-07:00</DateUpdated>
        <TimeUpdated>6.64996</TimeUpdated>
        <UserUpdatedKey>0000000006</UserUpdatedKey>
      </SO_SalesOrderHeader>
    </sdata:payload>

SO Line (Sales Order Detail) is:

<sdata:payload>
      <SO_SalesOrderDetail sdata:uri="http://192.168.110.27/sdata/MasApp/MasContract/ABX/SO_SalesOrderDetail('0000011;000001')" xmlns="">
        <SalesOrderNo>0000011</SalesOrderNo>
        <LineKey>000001</LineKey>
        <LineSeqNo>00000100000000</LineSeqNo>
        <ItemCode>2480-8-50</ItemCode>
        <ItemType>1</ItemType>
        <ItemCodeDesc>Desk, Teak</ItemCodeDesc>
        <ExtendedDescriptionKey />
        <Discount>Y</Discount>
        <Commissionable>Y</Commissionable>
        <SubjectToExemption>Y</SubjectToExemption>
        <WarehouseCode>000</WarehouseCode>
        <Valuation>3</Valuation>
        <PriceLevel>1</PriceLevel>
        <MasterOrderLineKey />
        <UnitOfMeasure>EACH</UnitOfMeasure>
        <DropShip>N</DropShip>
        <LotSerialFullyDistributed>N</LotSerialFullyDistributed>
        <PrintDropShipment>N</PrintDropShipment>
        <SalesKitLineKey />
        <CostOfGoodsSoldAcctKey>00000009H</CostOfGoodsSoldAcctKey>
        <SalesAcctKey>00000009G</SalesAcctKey>
        <PriceOverridden>N</PriceOverridden>
        <ExplodedKitItem>N</ExplodedKitItem>
        <StandardKitBill>N</StandardKitBill>
        <Revision />
        <BillOption1 />
        <BillOption2 />
        <BillOption3 />
        <BillOption4 />
        <BillOption5 />
        <BillOption6 />
        <BillOption7 />
        <BillOption8 />
        <BillOption9 />
        <BackorderKitCompLine>N</BackorderKitCompLine>
        <SkipPrintCompLine>N</SkipPrintCompLine>
        <PromiseDate>2014-09-22T00:00:00-07:00</PromiseDate>
        <AliasItemNo />
        <SOHistoryDetlSeqNo>00000000000001</SOHistoryDetlSeqNo>
        <TaxClass>TX</TaxClass>
        <CustomerAction>N</CustomerAction>
        <ItemAction>N</ItemAction>
        <WarrantyCode>120</WarrantyCode>
        <ExpirationDate>1753-01-01T00:00:00-08:00</ExpirationDate>
        <ExpirationOverridden>N</ExpirationOverridden>
        <CostOverridden>N</CostOverridden>
        <CostCode />
        <CostType />
        <CommentText />
        <APDivisionNo>03</APDivisionNo>
        <VendorNo>UNITED</VendorNo>
        <PurchaseOrderNo />
        <PurchaseOrderRequiredDate>1753-01-01T00:00:00-08:00</PurchaseOrderRequiredDate>
        <QuantityOrdered>1.0000</QuantityOrdered>
        <QuantityShipped>0.0000</QuantityShipped>
        <QuantityBackordered>1.0000</QuantityBackordered>
        <MasterOriginalQty>0.0000</MasterOriginalQty>
        <MasterQtyBalance>0.0000</MasterQtyBalance>
        <MasterQtyOrderedToDate>0.0000</MasterQtyOrderedToDate>
        <RepeatingQtyShippedToDate>0.0000</RepeatingQtyShippedToDate>
        <UnitPrice>3244.9500</UnitPrice>
        <UnitCost>2328.0384</UnitCost>
        <ExtensionAmt>3244.9500</ExtensionAmt>
        <UnitOfMeasureConvFactor>1.0000</UnitOfMeasureConvFactor>
        <QuantityPerBill>0.0000</QuantityPerBill>
        <LineDiscountPercent>0.0000</LineDiscountPercent>
        <LineWeight>0.0000</LineWeight>
      </SO_SalesOrderDetail>
    </sdata:payload>

  • 0
    verified answer

    Greetings,

    Is it only the Saels Order Invoice request that fails (i.e. the Sales Order entry request works)?  

    The request is passing a lot of empty or zero value fields.  These should not be needed. You should consider pairing down the request to only those elements whose values you need to set.  Start with the minimun required values to create a Sales Order Invoice and then add in additional elements one at a time until everything you need is being submitted.  If at some point one of the elements causes the error, then that helps identify the problem.

    We have a sample SData Project that we demopnstrated at Sage Summit a few years ago that has a request to create a Sales Order.  That project is available to Partners on SageSell.  If you haven't already reviewed that project, I reccomend it.  If you aren't a partner, you can ask your partner to provide it to you.

    Thanks,

    Kent

  • 0 in reply to Kent Mackall

    Hi Kent!

    Thank you very much for your help. We removed everything except SalesOrderNo from the SO_InvoiceHeader creation request and it was created. Now we are going to add SO_InvoiceHeader fields one by one and see which one causes the error.

    And thank you for the reference to the SData project on SageSell. I’m sure it will help a lot.

    Best wishes,

    Alexander Nurullaev.