JavaScript global method: RCtoString

Converts a Service Manager global return code value into a localized text string.

Syntax

RCtoString( return code );

Arguments

The following arguments are valid for this function:

Argument Data type Required Description
return code Integer Yes This argument contains the Service Manager global return code value you want to convert to a localized string.

Return values

A localized text string

Throws

None

Description

This method converts a Service Manager global return code value into a localized text string.

Example

This example does the following:

  • Searches the contacts table for any contact name you define in the search variable
  • Displays the contact record as a text string

This example requires the following sample data:

  • A valid contact name (for example, "ADMINISTRATOR, SYSTEM")
  • A invalid contact name (for example, "NOT A, CONTACT")
var contactName;

function findContactName( name )
{
 print( "Searching for contact: " + name + "..." );
 var contactList = new SCFile( "contacts" );
 var findContact = contactList.doSelect( "contact.name=\""+ name + "\"" )
 if ( findContact == RC_SUCCESS )
 {
  print( "Success. found " + name + " in contact record:\n" + contactList.getText() );
  return contactList
 }
 else
 {
  print( "Could not find contact. " + RCtoString( findContact ) );
  return null
 }
}

contactName = "ADMINISTRATOR, SYSTEM";
findContactName( contactName );

contactName = "NOT A, CONTACT";
findContactName( contactName );