Developer Programs

Learn

Docs

SL CustSrch Hyperlink

Tutorials > SL CustSrch Hyperlink

SilverLake offers a screen pop for several messages by making a hyperlink call through the Xperience Client Agent (XCA). The CustSrch message is an example XperienceMessageBus message. When the CustSrch message is sent to SilverLake in Xperience, it will display a customer search in SilverLake.

Here is an Angular example:

Angular example
import { Component } from '@angular/core';
import * as he from 'he';
import { Logger } from '@nsalaun/ng-logger';

@Component({
  styleUrls: ['./cust-srch.component.scss'],
  templateUrl: './cust-srch.component.html',
})
export class HyperlinkCustSrchComponent {
  private _xmlns: string;
  firstName: string;
  instance: string;
  instanceName = '';
  instRtId: string;

  constructor(private logger: Logger) {
    this._xmlns = 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://jackhenry.com/jxchange/JES/2008"';
  }

  createHyperlink(): void {
    if (this.firstName && this.firstName.length > 0) {
      // Override the global default setting:
      he.encode.options.useNamedReferences = true;

      if (this.instance && this.instance.length > 0) {
        this.instanceName = 'Instance=' + this.instance;
      }

      this.instRtId = (this.instRtId && this.instRtId.length > 0) ? this.instRtId : '011001276';

      const link: string = he.encode(
        'jhaXp:' +
        this.instanceName +
        '&Msg=<CustSrch ' +
        this._xmlns + '>' +
        '<XPMsgRqHdr><XPHdr><InstRtId>' +
        this.instRtId +
        '</InstRtId></XPHdr></XPMsgRqHdr><FirstName>' +
        this.firstName +
        '</FirstName></CustSrch>',
        {
          strict: true,
        },
      );

      this.logger.log(link);
      document.getElementById('link').setAttribute('href', link);
      document.getElementById('string-link').innerHTML = link;
    }
  }
}

Did this page help you?

Last updated Mon Dec 9 2024