Search code examples
sage-crm

Sage CRM - It is possible to create an appointment through Classic ASP code?


Using this:

var NewComm = CRM.CreateRecord("Communication");
NewComm("Comm_ChannelId") = Request.Form("chanId");
NewComm("Comm_Type") = "Appointment";
NewComm("Comm_DateTime") = Request.Form("initialHour");
NewComm.SaveChanges()

I can see in the DDBB that the Communication is created

Just for testing (and to see if it needs a Comm_Link row to be able to show), i updated some row in the Comm_Link table (CmLi_Comm_CommunicationId column) to the ID equals to the Communication i just created, but still i do not see my Comm when clicking in My Calender

There is somethgin else i need to do?


Solution

  • There are certain fields that are required for security, namely Team (Channel) fields and Territory (Secterr) fields.

    With Communications, you also need to make sure there are other default fields, as Communicationa are often filtered.

    For example, Communication lists are filtered by the Status field = Pending by default, so make sure the comm_status field is set.

    Also, all Communications generally have an Action (comm_action) and some other fields.

    We advise setting the following fields, in addition to those you have already set:

    NewComm("comm_status") = 'Pending';
    NewComm("comm_action") = 'Meeting';
    NewComm("comm_secterr") = *A Territory Id*;
    NewComm("comm_subject") = 'A Subject';
    NewComm("Comm_ToDateTime") = *End Date/Time*;
    
    NewCommLink("cmli_comm_userid") = *The User Id*;
    NewCommLink("cmli_comm_communicationid") = *The Communication Id*;
    NewCommLink("cmli_comm_personid") = *The Person Id if required*;
    NewCommLink("cmli_comm_companyid") = *The Company Id if required*;
    

    Hope that helps!

    Six Ticks Support