Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Request for code snippet - Script-based selection (Service)

Hi all,

I am looking for a basic code snippet to find out how a script-based selection in Service actually works.
The best I have found so far can be found in this post, but unfortunately it gives me no results.

The code in that post shows me:

#setLanguageLevel 2;
 
Integer[] ids;
 
Integer execute()
{
  Integer count = 0;
 
  SearchEngine se;
 
  se.addField("contact.id");
 
  for (se.execute(); !se.eof(); se.next())
  {
    ids.pushBack(se.getField(0).toInteger());
 
    count++;
  }
 
  return count;
}
 
Integer[] getIds()
{
 
  return ids;
}

 

Thanks in advance!

 

RE: Request for code snippet - Script-based selection (Service)

Hi,

What kind of source table did you create your script-based selection?

Von: Michel Krohn-Dale 28. Apr 2020

RE: Request for code snippet - Script-based selection (Service)

Hi Michel,

I tried the contact/company-table based on the code snippet from the other post, but also the ticket-table. The results were empty however. A simple example would be really helpful.

Von: Bas Kreijveld 28. Apr 2020

RE: Request for code snippet - Script-based selection (Service)

My bad, I still had an incorrect Integer reference in the bottom part. In short: the code snippet works perfectly well :)

Von: Bas Kreijveld 28. Apr 2020