Hi guys
For years i've been frustrated everytime i needed to use the so-called "Virtual fields" in searchengine - the only "documentation" i can find about this, is this blog post:
https://docs.superoffice.com/en/automation/crmscript/searchengine/using-the-searchengine-class-blog-post.html
It briefly mentions a couple, such as fullname
, emailAddress
, and direct/formattedNumber
.
Yet the post implies there are others.... Where can i find a list of these???
It would save me so much time and guesswork if someone could point me in the direction of some documentation on these fields, and preferably all of them!
Thanks in advance.
All Replies (5)
Hi Dennis,
Archive provider columns...
Consider, instead of using SearchEngine, using ArchiveProviders directly...
NSArchiveRestrictionInfo[] restrictions;
NSArchiveRestrictionInfo res1;
res1.SetName("fullName");
res1.SetOperator("contains");
res1.SetValues(String("Dennis Aagaard Mortensgaard").split(","));
restrictions.pushBack(res1);
NSArchiveOrderByInfo[] order;
String[] entities = String("person").split(",");
Integer pageSize = 250;
NSArchiveAgent archiveAgent;
NSArchiveListItem[] rows = archiveAgent.GetArchiveListByColumns("SimplePerson", String("personId,fullName,email/emailAddress").split(","), order, restrictions, entities, 0, pageSize);
foreach (NSArchiveListItem row in rows) {
Map rowData = row.GetColumnData();
String person_personId = rowData.get("personId");
String person_fullName = rowData.get("fullName");
String person_emailAddress = rowData.get("email/emailAddress");
printLine(person_personId + ": " + person_fullName + " => " + person_emailAddress);
}
Best regards.
Hi Dennis,
just to reply to your question, although I guess we should start looking into the Archive Provider as Tony says, I have accumulated a list of virtual fields based on the eJournal => Customer Service conversion we had to do some few years back, it might be incomplete - but should cover the most used fields:
eJournal | Service |
cust_email.id | Email.email_id |
cust_email.cust_id | Email.person_id |
cust_email.email | Email.email_address |
cust_email.dbi_agent_id | Email.dbi_agent_id |
cust_email.internal_rank | Email.rank |
Person | |
customer.id | person.person_id |
customer.display_name | person.fullName |
customer.firstname | person.firstname |
customer.lastname | person.lastname |
customer.username | person.(user_candidate->person_id).secret_key |
customer.password | person.(user_candidate->person_id).secret_value |
customer.display_email | person.emailAddress |
customer.phone | person.direct/formattedNumber |
customer.phone_searchable | person.direct/formattedNumber |
customer.cellphone | person.mobile/formattedNumber |
customer.cellphone_searchable | person.mobile/formattedNumber |
customer.company | person.contact_id |
customer.display_company | person.contact_id.name |
customer.deleted | person.retired |
customer.our_contact | person.supportAssociateId.ejuserId |
customer.language | person.supportLanguageId |
customer.priority_id | person.ticketPriorityId |
customer.note | person.infoText |
customer.deleted | person.retired |
customer.block_spm | person.nomailing |
customer.block_ejspm | person.nomailing |
customer.dbi_agent_id | person.dbi_agent_id |
customer.dbi_key | person.dbi_key |
customer.dbi_last_syncronized | person.dbi_last_syncronized |
customer.dbi_last_modified | person.dbi_last_modified |
Contact | |
cust_company.id | contact.contact_id |
cust_company.name | contact.name |
cust_company.note | contact.infoText |
company_domain.domain_name | contact.(company_domain->company_id).domain_name |
cust_company.domain | contact.(company_domain->company_id).domain_name |
cust_company.phone | contact.phone/formattedNumber |
cust_company.fax | contact.fax/formattedNumber |
cust_company.adr | contact.address/formattedAddress |
cust_company.priority_id | contact.ticketPriorityId |
cust_company.deleted | contact.deleted |
cust_company.our_contact | contact.supportAssociateId.ejuserId |
cust_company.prim_contact | contact.supportPersonId |
cust_company.priority_id | contact.ticketPriorityId |
cust_company.dbi_agent_id | contact.dbi_agent_id |
cust_company.dbi_key | contact.dbi_key |
cust_company.dbi_last_syncronized | contact.dbi_last_syncronized |
cust_company.dbi_last_modified | contact.dbi_last_modified |
Hello Dennis,
I'm not sure if it completely answers your question (and you already have gotten very nice feedback from both Tony and Simen), but you could also go through the API to get available fields/columns.
Take a look at our Custom objects search documentation.
To build on Tonys example for SimplePerson:
POST {{api_url}}/v1/Agents/Archive/GetAvailableColumns?$select=name HTTP/1.1
Authorization: Bearer {{access_token}}
Accept: application/json; charset=utf-8
Content-Type: application/json
{
"ProviderName": "SimplePerson",
"Columns": ""
}
This should return a good idea of what columns you have available for that Provider, and would make it easy to work with `GetArchiveListByColumns`
//Eivind
Virtual fields declared with in the CDD/database model:
Contact | |
contact.phone/formattedNumber | Virtual field containing the direct phone formatted number |
contact.fax/formattedNumber | Virtual field containing the fax formatted number |
contact.address/formattedAddress | Virtual field containing the address formatted without new lines |
contact.address/formattedMultiLineAddress | Virtual field containing the address formatted with line breaks |
contact.address/line1 | Virtual field containing line 1 of the addres |
contact.address/line2 | Virtual field containing line 2 of the address |
contact.address/city | Virtual field containing city of the address |
contact.address/zip | Virtual field containing zip code of the address |
contact.infoText | Virtual field containing the note |
contact.emailAddress | Virtual field containing the primary email address for the contact |
Person | |
person.fullName | Virtual field containing the full name of the person |
person.emailAddress | Virtual field containing the primary email address for the person |
person.direct/formattedNumber | Virtual field containing the direct phone formatted number |
person.mobile/formattedNumber | Virtual field containing the mobile formatted number |
person.phone/formattedNumber | Virtual field containing the best formatted number for the person |
person.infoText | Virtual field containing the note |
person.searchPhone/formattedNumber | Virtual field used for searching phone number |
But like Tony said, there is a reason these are set using 'legacy' flags in the database model. You should be using the default archive provider if possible, and if they dont fit your needs, use the Dynamic archive provider since then you have the full advantage of the dot syntax (CRMScript searchgine doesnt support all of it, like the [ ] notation to force join tables).