Skip to content

4. Helpers: quick integration

Theo Paraskevopoulos edited this page Oct 15, 2016 · 2 revisions

Helpers

Pipeline comes with a number of Helper methods to make integration easier.

##Getting started Add the Pipeline assemblies:

@using PipelineCRM.Models;
@using PipelineCRM.Helpers;

##Methods

###CreatePipeline Creates a new Pipeline, Contact, Organisation and initial Task in a single step. Returns the newly created Pipeline.

Pipeline newPipeline = CreatePipeline(
    string Title, 
    string contactName, 
    string contactEmail,
    [string contactTelephone = ""],
    [string organisationName = ""],
    [string Comments = ""],
    [int opportunityValue = 0],
    [int opportunityProbability = 0],
    [int opportunityStatusId = 0])

NB: if a Contact with the given email address is found, the method will update their details, not create a new one.

###CreateTask Creates a new Task, setting the author to a given Contact by Email, and returns the newly created Task. If a Pipeline Id is given, the Task is linked to that Pipeline, and if not to the Contact.

.CreateTask(
    string Note, 
    string contactEmail,
    [int PipelineId = 0])

###CreateContact Creates a new Contact and Organisation in a single step, and returns the newly created Contact.

Contact newContact = CreateContact(
    string Name, 
    string contactEmail,
    [string contactTelephone = ""],
    [string organisationName = ""])

###CreateOrganisation Creates a new Organisation, and returns it.

Organisation newOrganisation = CreateContact(
    string Name,
    [string Telephone = ""],
    [string Email= ""], 
    [string Website = ""])