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 NAME | FIELD NAME (old) | QUERYABLE | UPDATEABLE | REQUIRED ON UPDATE | INSERTABLE | REQUIRED ON INSERT |
TxnID | true | false | true | false | false | |
TimeCreated | true | false | true | false | false | |
TimeModified | true | false | true | false | false | |
EditSequence | true | false | true | false | false | |
TxnNumber | true | false | false | false | false | |
CustomerRef_ListID | true | true | optional | true | true | |
CustomerRef_FullName | true | true | optional | true | true | |
ClassRef_ListID | true | true | optional | true | optional | |
ClassRef_FullName | true | true | optional | true | optional | |
ARAccountRef_ListID | true | true | optional | true | optional | |
ARAccountRef_FullName | true | true | optional | true | optional | |
TemplateRef_ListID | true | true | optional | true | optional | |
TemplateRef_FullName | true | true | optional | true | optional | |
TxnDate | true | true | optional | true | optional | |
RefNumber | true | true | optional | true | optional | |
BillAddress_Addr1 | true | true | optional | true | optional | |
BillAddress_Addr2 | true | true | optional | true | optional | |
BillAddress_Addr3 | true | true | optional | true | optional | |
BillAddress_Addr4 | true | true | optional | true | optional | |
BillAddress_Addr5 | true | true | optional | true | optional | |
BillAddress_City | true | true | optional | true | optional | |
BillAddress_State | true | true | optional | true | optional | |
BillAddress_PostalCode | true | true | optional | true | optional | |
BillAddress_Country | true | true | optional | true | optional | |
BillAddress_Note | true | true | optional | true | optional | |
ShipAddress_Addr1 | true | true | optional | true | optional | |
ShipAddress_Addr2 | true | true | optional | true | optional | |
ShipAddress_Addr3 | true | true | optional | true | optional | |
ShipAddress_Addr4 | true | true | optional | true | optional | |
ShipAddress_Addr5 | true | true | optional | true | optional | |
ShipAddress_City | true | true | optional | true | optional | |
ShipAddress_State | true | true | optional | true | optional | |
ShipAddress_PostalCode | true | true | optional | true | optional | |
ShipAddress_Country | true | true | optional | true | optional | |
ShipAddress_Note | true | true | optional | true | optional | |
IsPending | true | true | optional | true | optional | |
IsFinanceCharge | true | false | false | true | optional | |
PONumber | true | true | optional | true | optional | |
TermsRef_ListID | true | true | optional | true | optional | |
TermsRef_FullName | true | true | optional | true | optional | |
DueDate | true | true | optional | true | optional | |
SalesRepRef_ListID | true | true | optional | true | optional | |
SalesRepRef_FullName | true | true | optional | true | optional | |
FOB | true | true | optional | true | optional | |
ShipDate | true | true | optional | true | optional | |
ShipMethodRef_ListID | true | true | optional | true | optional | |
ShipMethodRef_FullName | true | true | optional | true | optional | |
Subtotal | true | false | false | false | false | |
ItemSalesTaxRef_ListID | true | true | optional | true | optional | |
ItemSalesTaxRef_FullName | true | true | optional | true | optional | |
SalesTaxPercentage | true | false | false | false | false | |
SalesTaxTotal | true | false | false | false | false | |
AppliedAmount | true | true | optional | false | false | |
BalanceRemaining | true | false | false | false | false | |
CurrencyRef_ListID | true | false | false | false | false | |
CurrencyRef_FullName | true | false | false | false | false | |
ExchangeRate | true | true | optional | true | optional | |
BalRemainingInHomeCurrency | BalanceRemainingInHomeCurrency | true | false | false | false | false |
Memo | true | true | optional | true | optional | |
IsPaid | true | false | false | false | false | |
CustomerMsgRef_ListID | true | true | optional | true | optional | |
CustomerMsgRef_FullName | true | true | optional | true | optional | |
IsToBePrinted | true | true | optional | true | optional | |
IsToBeEmailed | true | true | optional | true | optional | |
IsTaxIncluded | true | true | optional | true | optional | |
CustSalesTaxCodeRef_ListID | CustomerSalesTaxCodeRef_ListID | true | true | optional | true | optional |
CustSalesTaxCodeRef_FullName | CustomerSalesTaxCodeRef_FullName | true | true | optional | true | optional |
SuggestedDiscountAmount | true | false | false | false | false | |
SuggestedDiscountDate | true | false | false | false | false | |
Other | true | true | optional | true | optional | |
CustomField1 | true | true | optional | true | optional | |
CustomField2 | true | true | optional | true | optional | |
CustomField3 | true | true | optional | true | optional | |
CustomField4 | true | true | optional | true | optional | |
CustomField5 | true | true | optional | true | optional | |
CustomField6 | true | true | optional | true | optional | |
CustomField7 | true | true | optional | true | optional | |
CustomField8 | true | true | optional | true | optional | |
CustomField9 | true | true | optional | true | optional | |
CustomField10 | true | true | optional | true | optional | |
CustomField11 | true | true | optional | true | optional | |
CustomField12 | true | true | optional | true | optional | |
CustomField13 | true | true | optional | true | optional | |
CustomField14 | true | true | optional | true | optional | |
CustomField15 | true | true | optional | true | optional | |
ExternalGUID | true | true | optional | true | optional | |
UserData | user field | |||||
Operation | add,update,delete | update | add |