Hi guys,
Can somebody explain how the button "Open in SuperOffice CRM" for a given contact in Service works?

As far I can see, the button references to the following url:
http://cs.test.dk/Sale/default.aspx?contact.main.activate?contact_id=
I would like to implement the same functionality for a different context.
Tried to create an Extra Menu that adds a button to a Extra Table screen that calls a CRMScript.
Doing so, SuperOffice CRM shows the contact with rank 1 in the history list.
Tried different scenarios, including changing the history list with CRMScript, but none of them works. The history is changed in SQL, but the change is not applied to the list in S&M.
Environment: OnSite v. 8.1
CRMScript for redirecting to the contact id:
String id = getVariable("entryId");
SearchEngine se;
se.addField("y_potential.x_contact_id");
se.addCriteria("y_potential.id", "Equals", id);
if(se.execute() > 0)
{
setVariable("url", "http://crm_tst.ok.dk/Sale/default.aspx?contact.main.activate?contact_id=" + se.getField(0));
flushCaches();
}
CRMScript including changing the history list:
#setLanguageLevel 3;
String id = getVariable("entryId");
String aid = getVariable("activeAssociateId");
SearchEngine se;
se.addField("y_potential.x_contact_id");
se.addCriteria("y_potential.id", "Equals", id);
if(se.execute() > 0)
{
SearchEngine seh;
seh.setLimit(1);
seh.addField("History.history_id");
seh.addCriteria("History.associate_id", "Equals", aid);
seh.addCriteria("History.table_id", "Equals", "5");
//seh.addCriteria("History.rank", "Equals", "1");
seh.addOrder("History.rank", false);
if(seh.execute() > 0)
{
NSHistory history;
NSViewStateAgent view;
history = view.GetHistory(seh.getField(0).toInteger());
history.SetId(se.getField(0).toInteger());
//history.SetRank(1);
view.SaveCurrent(history);
}
setVariable("url", "http://crm_tst.ok.dk/Sale/default.aspx?contact.main.activate?contact_id=" + se.getField(0));
flushCaches();
}
Has anybody tried to replicate this functionality?
Thanks in advance.
/Kim