Create a contact through row collection (Rows)
Some tooltip text!
• 1 minute to read
• 1 minute to read
Because the Rows
type consists of a collection of Row
objects, it is possible to create a ContactRow
with the ContactRows
class.
Code
using SuperOffice.CRM.Rows;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("sam", "sam"))
{
ContactRows newConRows = ContactRows.CreateNew();
//Instantiate a ContactRow type
ContactRow newContact = ContactRow.CreateNew();
//Assign values to the instantiated ContactRow
newContact.SetDefaults();
newContact.Name = "EuroCenter";
newContact.OrgNr = "1234523";
newContact.Number1 = "7412885";
//Adding the created Contacted to the Collection
newConRows.Add(newContact);
//Saving the ContactRows Collection
newConRows.Save();
}
Walk-through
Instantiate the
ContactRows
class using theCreateNew
method.Instantiate a
ContactRow
class and assign the necessary values to it. The instance can then be added to the collection with the execution of theAdd
method.Save the contact:
newConRows.Add(newContact); newConRows.Save();