contacts.addContact
Creates a new contact including address.
address_Title string
address_FirstName string
address_Surname string
address_CompanyName string
address_Address string
address_PostCode string
contact_Phone string
contact_Mobile string
contact_Email string
contact_Notes string
contact_ContactTypeId integer
contactID integer (-1 if failed)
local newContactID = contacts.addContact("Mr", "Jack", "O'Neill", "", "1 The Road\nSometown\nCounty", "ST1 1ST", "01234567", "07123456", "email@domain.com", "Notes line 1\nNotes line 2\n\nTHIS IS A TEST CONTACT", 1)
if newContactID == -1 then
print("Error adding contact")
else
print("Added contact ID " .. newContactID)
end
Use \n to add newline characters in address or notes parameters.
Contact types IDs are listed in the ContactTypes table. Use the following code to view all contact type IDs in the output window.
local grid = data.runSelectQuery("SELECT * FROM [ContactTypes]")
data.printGrid(grid)
Generated on the 26 June 2024 at 22:01:27 (UK Time)