Versions Compared

Key

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

...

Code Block
languagejava
titleAccountTerminationException.java
collapsetrue
 public class AccountTerminationException extends CRMValidationException {
	/**
	 * You are not allowed to terminate the Accounts Receivable %1. This is only allowed for Active or Suspended accounts.
	 * 
	 * @param crmSession - the session object
	 * @param value - the exception value
	 * @throws Exception
	 */
	public AccountTerminationException(CRMSession crmSession, String value) throws Exception {

		super();

		ArrayList<String> parameters = new ArrayList<String>();
		parameters.add(value);

		try 
		{
			setMessage(this.getClass().getName().toUpperCase(), crmSession, parameters);
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
	}
}

...

Code Block
languagexml
titlemessages.xml
collapsetrue
<messages>
	<message>
		<code>COM.CRM.EXCEPTION.ACCOUNTS.ACCOUNTTERMINATIONEXCEPTION</code>
		<expression>key_com_crm_exception_accounts_accountterminationexception</expression>
		<description>You are not allowed to terminate the accounts receivable. This is only allowed for Active or Suspended accounts.</description>
	</message>
	.
	.
	.
</messages>

...

Code Block
languagexml
titletranslation_eng.properties
collapsetrue
<properties>
	<entry key="key_com_crm_exception_accounts_accountterminationexception">You are not allowed to terminate the accounts receivable %1. This is only allowed for Active or Suspended accounts.</entry>
	.
	.
	.
</properties>

...

Code Block
themeEclipse
languagejava
titleInvalidAccountCreditPeriodException.java
collapsetrue
public void validateTermination(CRMDOAccountReceivable account)  throws Exception, AccountTerminationException{
		
		if (account.getLifeCycleState()==null || 
		   (!account.getLifeCycleState().equals(AccountReceivableLifeCycleState.ACTIVE) && 
			!account.getLifeCycleState().equals(AccountReceivableLifeCycleState.SUSPENDED)))
		{
		    throw new AccountTerminationException(getCRMSession(), account.getNumber());
		}
		...
}

Question Messages

...

Expand
titleQuestion Message

...