Skip to end of banner
Go to start of banner

Customise Variables Metadata

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Variables metadata file is used to define the global variables of the system.

 

What does this section cover?

Variables file

All custom variables are declared in variables.xml file, which must be created under <custom_project>/web/WebContent/metadata directory.

Define Custom Variables

To define a new custom variable you have to use a unique variable name.

variables.xml
<variableconfig>
	<variables>
		<variable>
			<name>myvariable</name>
			<value>testvalue</value>
			<description>This is a test variable.</description>
		</variable>
	</variables>
</variableconfig>

Retrieve Custom Variable Values

To retrieve the variable value, you must use getVariable(String variableName, String context, String organisationID) method of com.crm.framework.metadata.MetadataUtil class.

getVariable
public void myMethod() throws Exception{
	// variableValue = "testvalue"
	String variableValue = MetadataUtil.getVariable("myvariable", getCRMSession().getRealPath(), getOrganisationID());
	...
}
  • No labels