Various Useful Client-Side Functions Available in Infor CRM Web

In a previous post, I mentioned how shifting your code from server-side code to client-side can improve the performance of the client and improve the end user experience. This post will provide a list of some helpful client-side functions available to make that transition easier and more productive.

Navigate to the Entity Page Detail for a Record

// show a page for an account 
Link.entityDetail('ACCOUNT', 'AGHEA0002669');

Navigate to the List/Groups for the Current Entity Page

Sage.Link.toListView();

Check the Mode of the Current Page (For Example, Detail vs Insert)

if (Sage.Utility.getModeId() == 'insert') {
    alert('We are adding a new record');
}

Invoke the New Note Dialog

// invoke the note dialog, if on a contact/account/etc record it will be the default
Link.newNote();

Invoke Activity Dialog

// show Activity for new phone call
Link.schedulePhoneCall();

// show Activity for new meeting
Link.scheduleMeeting();

// show Activity for new to-do
Link.scheduleToDo();

// show Activity for new personal activity
Link.schedulePersonalActivity()

// show Activity for new event
Link.scheduleEvent();

Note: “Link” can also be accessed via “Sage.Link”. Also, there’s a whole lot more you can do using Link, such as completing activities, editing activities or history, deleting activities/history and even deal with user confirmations.

Get The Current Page Name

// For example, returns "Account.aspx"
var val = Sage.Utility.getPageName();

Get Current Page Entity ID

// will return an ID such as "AGHEA0002669"
var val = Sage.Utility.getCurrentEntityId();

Get a User’s Name Given the ID

// for example, will return "Hogan, Lee"
var val = Sage.Utility.getUserName('UDEMOA00000I');

// note: the first time this is called, it makes a request to the server to build a cache of all
// users. Subsequent calls will use the cache rather than another trip to the server.

Get an Owner’s Name Given the ID

// for example, will return "Everyone"
var val = Sage.Utility.getOwnerName('SYST00000001');

// note: the first time this is called, it makes a request to the server to build a cache of all
// owners. Subsequent calls will use the cache rather than another trip to the server.

Download an Attachment Given the ID

Sage.Utility.File.Attachment.getAttachment('EDEMOA000001');

Show or Hide the Spinning Loading Animation in the Toolbar Area

// if you're doing some long client-side operation and want to show the "loading" spinner
Sage.Utility.showRequestIndicator();

//then to turn it off
Sage.Utility.hideRequestIndicator();
ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He’s been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!