Using Client-Side Prompts Dialogs to Present Options for a User in the Infor CRM Web Client

There are times when you need to prompt the user in Infor CRM, to ask them some question to find out how to proceed – such as “would you like to do this or that?”. Often times, I’ve seen a QuickForm used for this, but that is less than ideal. There is a built-in, client-side dialog you can use for this. Let’s take a look how to use it.

Asking the User a Question Prompt

The javascript library Sage.UI.Dialogs contains a function called raiseQueryDialog. This function takes the following arguments:

  1. Title – this displays as the title of the dialog/prompt
  2. Question – this is the question you’d like to ask the user
  3. Callback function – this is the Javascript function that is invoked when the user chooses one of the prompts options
  4. Option #1 – the first choice for the user
  5. Option #2 – the second choice for the user

Let’s take a look at the code to use this (keep in mind, this is a client-side library, so this is Javascript):

// This is the callback function that is invoked when the user makes a choice
var fn = function(answer) {
	if (answer) { 
		console.log('user selected option 1');
	} 
	else { 
		console.log('user selected option 2');
	}
};

// Display the prompt
Sage.UI.Dialogs.raiseQueryDialog('Some Question', 'Would you like to choose Option 1 or Option 2?', fn, 'Option 1', 'Option 2');

This is what the user will see when this code executes:

 

If you want to trigger server-side actions as a result, you could use __doPostBack (and pass the name of a server-side control, such as a button to trigger it’s change action).

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!