Activities in DataBase

Hi,

I want to know where are the Database table which corresponding to the Activities (Pane Activities under Sales).

thanks

RE: Activities in DataBase

Hi Fabrice, look at

crm7.appointment where sale_id > 0

Av: Frode Lillerud 21. nov 2019

RE: Activities in DataBase

Hi Frode,

thanks I will look this

Av: Fabrice Reithinger 21. nov 2019

RE: Activities in DataBase

Hi Frode,

can you tell me how I can count how many "Follow ups" it gives ?

I have that for the documents:

//Search seDocument
SearchEngine seDocument;
//SQL bauen - Suche alle DocTmpl die nicht gelöscht sind
seDocument.bypassNetServer(true);
seDocument.addField("DocTmpl.DocTmpl_id");
seDocument.addField("DocTmpl.name");
seDocument.addCriteria("DocTmpl.deleted", "OperatorEquals", "0", "And", 0);
seDocument.addOrder("DocTmpl.name", true);
for (seDocument.execute(); !seDocument.eof(); seDocument.next())
{
  //für alle Dokument.. prüfen wieviel diesen benutzt sind
  String sDocTmpl_id = seDocument.getField(0);
  String sDocTmpl_name = seDocument.getField(1);
  SearchEngine seDocumentCount;
  seDocumentCount.bypassNetServer(true);
  seDocumentCount.addField("appointment.appointment_id");
  seDocumentCount.addCriteria("appointment.document_id","notequals","0");
	seDocumentCount.addCriteria("appointment.task_idx", "OperatorEquals", sDocTmpl_id);
  output.append(sDocTmpl_name+";"+seDocumentCount.execute().toString()+"\n");
}

thanks

Av: Fabrice Reithinger 21. nov 2019

RE: Activities in DataBase

Hi Fabrice, here is a startingpoint that you can continue to develop.

#setLanguageLevel 3;

//Get all document templates. The SearchEngine doesn't handle templates really well, 
//so we cache a list of template ID's and template names.
Map docTemplates;
NSListAgent listAgent;
NSDocumentTemplate[] templates = listAgent.GetDocumentTemplates();
for (Integer i = 0; i < templates.length(); i++)
{
  NSDocumentTemplate template = templates[i];
  docTemplates.insert(template.GetDocumentTemplateId().toString(), template.GetName());
}

// Get all documents
SearchEngine se;
se.addField("appointment.task_idx"); //NB, points to crm8.doctmpl for documents
se.addField("appointment.appointment_id", "COUNT");
se.addCriteria("appointment.document_id", "gt", "0"); //Only documents
se.setGroup(true);
se.bypassNetServer(true);
for (se.execute(); !se.eof(); se.next())
{
  
  String docTmplId = se.getField(0);
  Integer count = se.getField("appointment.appointment_id", "COUNT").toInteger();
  printLine(docTemplates.get(docTmplId) + " ==> " + count.toString());
}
Av: Frode Lillerud 21. nov 2019