XERO JINT: Difference between revisions
From Data Islands
WikiSysopdi (talk | contribs) No edit summary |
WikiSysopdi (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
There are specific commands in the Javascript Engine (JINT) relating to XERO Only. | |||
'''XeroRecord''' | '''XeroRecord''' | ||
You can update XERO now from javascript code using the JINT functionality | |||
//Insert | |||
jint di | |||
var xeroRecord = XeroRecord('contacts'); | |||
xeroRecord.Set("Name", "TestXeroContact9"); | |||
xeroRecord.Insert(); | |||
//Update | |||
jint di | |||
var xeroRecord = XeroRecord('contacts'); | |||
xeroRecord.Set("EmailAddress", "test@test.com"); | |||
var id = '76912505-520c-4b1d-8739-24a98493508c'; | |||
xeroRecord.Update(id); | |||
//Delete/Archive | |||
jint di | |||
var xeroRecord = XeroRecord('contacts'); | |||
xeroRecord.Set("Name", "TestXeroContact5"); | |||
var id = '76912505-520c-4b1d-8739-24a98493508c'; | |||
xeroRecord.Delete(id) | |||
# getGUID - This is used where you have a given key value and need the Guid ID. Only one result is returned so this depends on the named key value being unique. Otherwise use querydb. | # getGUID - This is used where you have a given key value and need the Guid ID. Only one result is returned so this depends on the named key value being unique. Otherwise use querydb. |
Revision as of 08:46, 14 August 2025
There are specific commands in the Javascript Engine (JINT) relating to XERO Only.
XeroRecord
You can update XERO now from javascript code using the JINT functionality
//Insert
jint di
var xeroRecord = XeroRecord('contacts');
xeroRecord.Set("Name", "TestXeroContact9");
xeroRecord.Insert();
//Update
jint di
var xeroRecord = XeroRecord('contacts');
xeroRecord.Set("EmailAddress", "test@test.com");
var id = '76912505-520c-4b1d-8739-24a98493508c';
xeroRecord.Update(id);
//Delete/Archive
jint di
var xeroRecord = XeroRecord('contacts');
xeroRecord.Set("Name", "TestXeroContact5");
var id = '76912505-520c-4b1d-8739-24a98493508c';
xeroRecord.Delete(id)
- getGUID - This is used where you have a given key value and need the Guid ID. Only one result is returned so this depends on the named key value being unique. Otherwise use querydb.
- Parameters (a) ENTITY(b) FILTER - returns GUID value EG >var quoteid=di.getguid("Quotes", "QT-1234");
- di.getguid("Accounts", "Name_Value") => Will pass "Name" and will get "AccountID"
- di.getguid("BankTransactions", "Reference_Value") => Will pass "Reference" and will get "BankTransactionID"
- di.getguid("BrandingThemes", "Name_Value")=> Will pass "Name" and will get "BrandingThemeID"
- di.getguid("ContactGroups", "Name_Value")=> Will pass "Name" and will get "ContactGroupID"
- di.getguid("Contacts", "Name_Value")=> Will pass "Name" and will get "ContactID"
- di.getguid("CreditNotes", "CreditNoteNumber_Value")=> Will pass "CreditNoteNumber" and will get "CreditNoteID"
- di.getguid("Employees", "FirstName_Value")=> Will pass "FirstName" and will get "EmployeeID"
- di.getguid("ExpenseClaims", "Status_Value")=> Will pass "Status" and will get "ExpenseClaimID"
- di.getguid("Invoices", "InvoiceNumber_Value")=> Will pass "InvoiceNumber" and will get "InvoiceID"
- di.getguid("Items", "Name_Value")=> Will pass "Name" and will get "ItemID"
- di.getguid("ManualJournals", "Narration_Value")=> Will pass "Narration" and will get "ManualJournalID"
- di.getguid("Organisations", "Name_Value")=> Will pass "Name" and will get "OrganisationID"
- di.getguid("Payments", "Reference_Value")=> Will pass "Reference" and will get "PaymentID"
- di.getguid("PurchaseOrders", "PurchaseOrderNumber_Value")=> Will pass "PurchaseOrderNumber" and will get "PurchaseOrderID"
- di.getguid("Quotes", "QuoteNumber_Value")=> Will pass "QuoteNumber" and will get "QuoteID"
- di.getguid("Receipts", "ReceiptNumber_Value")=> Will pass "ReceiptNumber" and will get "ReceiptID"
- di.getguid("RepeatingInvoices", "Reference_Value")=> Will pass "Reference" and will get "RepeatingInvoiceID"