When used with InvoiceAdd, the transaction you are linking to via this field must be a SalesOrder; links to other transactions, such as to estimates, are not currently supported.

The LinkToTxn aggregate allows you to bring in a specific line item from a transaction. If you want to link an entire transaction and bring in all its lines, use the LinkToTxnID aggregate. Notice that if you use LinkToTxn in the item line, you cannot use ItemRef in that line: you’ll get a runtime error. LinkToTxn brings in all the item information you need. (You can, however, specify whatever quantity or rate that you want, or any other item line element other than ItemRef.

You can use both LinkToTxnID and LinkToTxn in the same request, as long as these do NOT link to the same TxnID. You get an error if the transaction specified by LinkToTxnID is already closed or fully received and the request does not contain any other lines. You get error if you attempt to save an empty transaction. You get a warning if you attempt to link to a transaction that’s already closed.

If you want to link the whole sales order you have to create a record on: “LinkedTxnRet” table. This can only be done when adding the invoice for the first time. After the invoice is added, you won’t be able to link it.

  • linkedtxnret.TxnID = SalesOrder.TxnId 
  • linkedtxnret.PARENT_IDKEY = Invoice.TxnId 

If you want a partial sales order (some items from sales order) you have to use “LinkToTxn_TxnID(SalesOrder. TxnID)”  and “LinkToTxn_TxnLineID (SalesOrderLineRet.TxnLineID)”  ,  fields on the “InvoiceLineRet” table. Also, when you set these ( “LinkToTxn_TxnID” and “LinkToTxn_TxnLineID”) fields, you cannot set “ItemRef_ListID” or “ItemRef_FullName”, even if you do, their value will be disregard by LetSync Desktop. This can only be done when adding the invoice for the first time. After the invoice is added, you won’t be able to link it.

  • LinkToTxn_TxnID = SalesOrder.TxnID
  • LinkToTxn_TxnLineID = SalesOrderLineRet.TxnLineID

Sub tables:

  • LinkedTxnRet
  • InvoiceLineRet
  • InvoiceLineGroupRet
FIELD NAMEFIELD NAME (old)QUERYABLEUPDATEABLEREQUIRED
ON UPDATE
INSERTABLEREQUIRED
ON INSERT
TxnIDtruefalse true false false
TimeCreatedtruefalse true false false
TimeModifiedtruefalse true false false
EditSequencetruefalse true false false
TxnNumbertruefalse false false false
CustomerRef_ListIDtrue true optional true true
CustomerRef_FullNametrue true optional true true
ClassRef_ListIDtrue true optional true optional
ClassRef_FullNametrue true optional true optional
ARAccountRef_ListIDtrue true optional true optional
ARAccountRef_FullNametrue true optional true optional
TemplateRef_ListIDtrue true optional true optional
TemplateRef_FullNametrue true optional true optional
TxnDatetrue true optional true optional
RefNumbertrue true optional true optional
BillAddress_Addr1true true optional true optional
BillAddress_Addr2true true optional true optional
BillAddress_Addr3true true optional true optional
BillAddress_Addr4true true optional true optional
BillAddress_Addr5true true optional true optional
BillAddress_Citytrue true optional true optional
BillAddress_Statetrue true optional true optional
BillAddress_PostalCodetrue true optional true optional
BillAddress_Countrytrue true optional true optional
BillAddress_Notetrue true optional true optional
ShipAddress_Addr1true true optional true optional
ShipAddress_Addr2true true optional true optional
ShipAddress_Addr3true true optional true optional
ShipAddress_Addr4true true optional true optional
ShipAddress_Addr5true true optional true optional
ShipAddress_Citytrue true optional true optional
ShipAddress_Statetrue true optional true optional
ShipAddress_PostalCodetrue true optional true optional
ShipAddress_Countrytrue true optional true optional
ShipAddress_Notetrue true optional true optional
IsPendingtrue true optional true optional
IsFinanceChargetruefalsefalse true optional
PONumbertrue true optional true optional
TermsRef_ListIDtrue true optional true optional
TermsRef_FullNametrue true optional true optional
DueDatetrue true optional true optional
SalesRepRef_ListIDtrue true optional true optional
SalesRepRef_FullNametrue true optional true optional
FOBtrue true optional true optional
ShipDatetrue true optional true optional
ShipMethodRef_ListIDtrue true optional true optional
ShipMethodRef_FullNametrue true optional true optional
Subtotaltruefalsefalsefalse false
ItemSalesTaxRef_ListIDtrue true optional true optional
ItemSalesTaxRef_FullNametrue true optional true optional
SalesTaxPercentagetruefalsefalsefalse false
SalesTaxTotaltruefalsefalsefalse false
AppliedAmounttruetrueoptionalfalse false
BalanceRemainingtruefalsefalsefalse false
CurrencyRef_ListIDtruefalsefalsefalse false
CurrencyRef_FullNametruefalsefalsefalse false
ExchangeRatetruetrueoptionaltrue optional
BalRemainingInHomeCurrencyBalanceRemainingInHomeCurrencytruefalsefalsefalse false
Memotruetrueoptionaltrue optional
IsPaidtruefalsefalsefalse false
CustomerMsgRef_ListIDtrue true optionaltrue optional
CustomerMsgRef_FullNametrue true optionaltrue optional
IsToBePrintedtrue true optional true optional
IsToBeEmailedtrue true optional true optional
IsTaxIncludedtrue true optional true optional
CustSalesTaxCodeRef_ListIDCustomerSalesTaxCodeRef_ListIDtrue trueoptional true optional
CustSalesTaxCodeRef_FullNameCustomerSalesTaxCodeRef_FullNametruetrueoptional true optional
SuggestedDiscountAmounttruefalsefalsefalsefalse
SuggestedDiscountDatetruefalsefalsefalsefalse
Othertruetrueoptional true optional
CustomField1true true optional true optional
CustomField2true true optional true optional
CustomField3true true optional true optional
CustomField4true true optional true optional
CustomField5true true optional true optional
CustomField6true true optional true optional
CustomField7true true optional true optional
CustomField8true true optional true optional
CustomField9true true optional true optional
CustomField10true true optional true optional
CustomField11true true optional true optional
CustomField12true true optional true optional
CustomField13true true optional true optional
CustomField14true true optional true optional
CustomField15true true optional true optional
ExternalGUIDtrue true optional true optional
UserDatauser field
Operationadd,update,deleteupdateadd

Powered by BetterDocs