Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleExample


keys used: key_new, key_set_privacy_level

 

Code Block
languagexml
titleSummary page actions
<actions>
		<action>
			<caption>key_new</caption>
			<topmenu>true</topmenu>
			<link>page.do?xml=communications/communication&amp;act=new&amp;jndi=ejb/CRMUICommunication&amp;fc=createButton&amp;pvc=0</link>
		</action>
		<action>
			<caption>key_set_privacy_level</caption>
			<modal>true</modal>
			<link>javascript:displayModalCreate('communications/setPrivacyLevel','ejb/CRMUICommunication','loadPrivacyLevelForm','java.util.ArrayList@[[SummaryComponent_((component))]]','edit',null,'','')</link>
		</action>
	</actions>

 

 

Data Entry Pages

This section shows how to use the Glossary Mechanism when creating data entry pages. 

Definition File

In data entry definition files, all name, label, sidelabel, truelabel, falselabel, tipexpression tags must contain only keys in order for their values to be translated by the glossary mechanism.

...

The following example demonstrates how to make use of the glossary mechanism when defining the title of a data entry page.

 

Expand
titleExample

keys used: key_communication


Code Block
languagexml
titleData entry page title
<?xml version="1.0" encoding="UTF-8"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/dataEntry.xsd">
	<id>communications/communications</id>
	<name>key_communication</name>
	<datapath>number</datapath>
	.
	.
	.
</page>

 

...

The following examples demonstrate how to make use of the glossary mechanism when implementing the main menu of a data entry page. 

Expand
titleExample 1

keys used: key_new


Code Block
languagexml
titleNew menu option
<mainmenu>
	<components>
		<component>
				<id>cmpNew</id>
				<name>key_new</name>
				<visiblemodes>read</visiblemodes>
				<hideinmodal>true</hideinmodal>
				<elements>
					<button>
							<id>btnNew</id>
							<name>key_new</name>
							.
							.
							.
						</button>
					</elements>
			</component>
			.
			.
			.
		</components>
</mainmenu>

 

...

  1. searchcaption and label tags should always contain a key in order for their values to be translated by the glossary mechanism.
  2. displaytype tag should make use of keys to define the available search criterion options.

...

Expand
titleSearch Page Example

keys used: key_search_accounts_receivable, key_life_cycle_state, key_active, key_suspended, key_terminated


Code Block
languagexml
titlesearch page
<searchcaption>key_search_accounts_receivable</searchcaption>
.
.
.
	<fields>
		<fielditem>
			<field>ACCOUNTSRECEIVABLE.LIFECYCLESTATE</field>
			<label>key_life_cycle_state</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>10</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<displaytype>combobox;;;ACTIVE;key_active;SUSPENDED;key_suspended;TERMINATED;key_terminated</displaytype>
			<indexorder>50</indexorder>
		</fielditem>
	.
	.
	.
</fields>
.
.
.

...

Expand
titleModule printouts example

keys used: key_warranty, key_view_the_warranty_policy_printout


Code Block
languagexml
titleModule printout
<printouts>
	<printout>
		<id>WARRANTY_PRINTOUT</id>
		<name>key_warranty</name>
		<description>key_view_the_warranty_policy_printout</description>
		<printoutfilename>InstalledItems/warranty_policy_printout.jrxml</printoutfilename>
		<entityid>INSTALLEDITEMS</entityid>
	</printout>
	.
	.
	.
</printouts>

 

Exceptions

This section shows how to use the Glossary Mechanism when creating exceptions.

The following examples demonstrate how to make use of the glossary mechanism when defining and throw an exception.

Expand
titleDefining an exception example

1. Create the exception class.

Code Block
languagejava
titleException class
public class OnlyOneRecordException extends CRMValidationException {
 /**
 * Only one %1 %2 must be specified.
 * 
 * @param crmSession - the session object
 * @param value1 - the exception first value
 * @param value2 - the exception second value 
 * @throws Exception
 */
 	public OnlyOneRecordException(CRMSession crmSession, String value1,String value2) throws Exception {
 
 		super();
 
 		ArrayList<String> parameters = new ArrayList<String>();
 
 		parameters.add(value1);
 		parameters.add(value2);
 
		try 
 		{
 			setMessage(this.getClass().getName().toUpperCase(), crmSession, parameters);
 		} 
 		catch (Exception e) 
 		{
 			e.printStackTrace();
 		}
 	}
}

 

2. Define the exception in the messages.xmlfile. Use a unique key for the expression tag. Keys used: key_com_crm_exception_onlyonerecordexception

Code Block
languagexml
titlemessages.xml
<messages>
	<message>
 		<code>COM.CRM.EXCEPTION.ONLYONERECORDEXCEPTION</code>
 		<expression>key_com_crm_exception_onlyonerecordexception</expression>
 		<description>Only one record must be specified.</description>
 	</message>
	.
	.
	.
</messages>

 

3. Define the exception in the properties file, by using the expression tag key defined in metadata messages file as the entry key, and specifying the exception message.

Code Block
languagexml
titletranslation_eng.properties
<properties>
	<entry key="key_com_crm_exception_onlyonerecordexception">Only one %1 %2 must be specified.</entry>
	.
	.
	.
</properties>

...

This section shows how to use the Glossary Mechanism when defining mandatory while creating business object classes.

Expand
titleMandatory fields example

keys used: key_website

 

Code Block
languagejava
titleCRMBOWebCustomerEventBean
@Override
protected LinkedHashMap<String, String> getMandatoryFields(CRMDO dto) throws Exception {
   		
	LinkedHashMap<String, String> mandatoryFields = new LinkedHashMap<String, String>();
   		
   	mandatoryFields.putAll(super.getMandatoryFields(dto));
   	mandatoryFields.put("key_website", "website");
   	return mandatoryFields;
}