group by in SearchEngine

lock
push_pin
done
Beantwortet
4

hi,

we want to auto-fill in Tickets the extra-field "Cost Center" (in Germn "Kostenstelle") depending on its Ticket Person (in German "Ansprechpartner"), because each person in our Company belongs to a certain Cost Center:

This Association is stored in our Active Directoary. But in crm scripts there is no Connection to our AD. My Idee will be, seach in all Tickets, what is the most Cost Center for that Person, this will be auto. filled in new Ticket. In SO Database, i reach that with SQL-Statement for my Person, important is here group by in SQL:

Now i want to convert it in SearchEngine in crm scripts,

 

but it posts me Runtime Error  by Using grouping.

 

Thanks!

3 h, 8 m vor | 12:55 PM

Alle Antworten (4)

Is bypassing of NetServer enabled in the registry? As documented here:

Running a query

2 h, 33 m vor | 01:30 PM

Hi David,

thanks! I have updated the Reg ID 235 to Value 1, but it executed after 60 Sec. Timeout and posted me the same Runtime Error as above. Any Issues may be at setGroup(true)?

49 m vor | 03:14 PM

This time it works and delivery me the same results as in Database.

i use "in" in stead of "OperatorIn", 

Problem is, it ran almost one min., i do believe if this runs in Trigger, it will last many times to save the Ticket.

and how could i sort by this with desc:

se2.addField("ticket.id", "COUNT");
 
Thanks!
31 m vor | 03:32 PM

Using:

se2.setLimit(1);
se2.addOrder("ticket.id", "COUNT", false);
now I get Results sorted and limited. now the single Problem is, it lasts to long runtime.
9 m vor | 03:53 PM

Antwort hinzufügen