Versions Compared

Key

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

...

The entity's DO class must implement ICRMDOWorkflowRuleEntity interface and its two methods: getAuditTrailLogs() and setAuditTrailLogs(Set<CRMDO> auditTrailLogs). Keep in mind that auditTrailLogs set is defined in superclass CRMDO.28 methods: 

  1. setUserField1(String userField1)
  2. setUserField2(String userField2)
  3. setUserField3(String userField3)
  4. setUserField4(String userField4)
  5. setUserField5(String userField5)
  6. setUserField6(String userField6)
  7. setUserField7(String userField7)
  8. setUserField8(String userField8)
  9. setDateTime1(Date dateTime1)
  10. setDateTime2(Date dateTime2)
  11. setDateTime3(Date dateTime3)
  12. setDateTime4(Date dateTime4)
  13. setFloat1(BigDecimal float1)
  14. setFloat2(BigDecimal float2)
  15. setFloat3(BigDecimal float3)
  16. setFloat4(BigDecimal float4)
  17. setStatusTransitionExceptionEnabled(Integer statusTransitionExceptionEnabled)
  18. getStatusTransitionExceptionEnabled()
  19. isStatusTransitionExceptionEnabled()
  20. setACRExceptionEnabled(Integer acrExceptionEnabled)
  21. getACRExceptionEnabled()
  22. isACRExceptionEnabled()
  23. setPLARExceptionEnabled(Integer plarExceptionEnabled)
  24. getPLARExceptionEnabled()
  25. isPLARExceptionEnabled()
  26. setOwnedByGroupExceptionEnabled(Integer ownedByGroupExceptionEnabled)
  27. getOwnedByGroupExceptionEnabled()
  28. isOwnedByGroupExceptionEnabled()

Note that for any of 1-16 methods there is no corresponding database field, no functionality should be implemented.

In order to implement methods 17-28 the following java transient fields should be declared:

  1. Integer statusTransitionExceptionEnabled
  2. Integer acrExceptionEnabled
  3. Integer plarExceptionEnabled
  4. Integer ownedByGroupExceptionEnabled

Code Block
languagejava
titleCUSTOMCRMDORental
collapsetrue
publicppublic class CUSTOMCRMDORental extends CRMDO implements ICRMDOAuditTrailedEntity ICRMDOWorkflowRuleEntity{

	private CUSTOMCRMDORentalType type;
	private CUSTOMRentalState state;
	private CRMDOAccountReceivable accountReceivable;
	private Date effectiveDate;
	private Date expirationDate;
	
	private Set<CUSTOMCRMDORentalItem> items;
	public
CUSTOMCRMDORentalType getType() {
		return type	//transient fields
	private Integer statusTransitionExceptionEnabled;
	}private 	public void setType(CUSTOMCRMDORentalType type) {
		setChange("type", this.type, type);
		this.type = type;
	}
	Integer acrExceptionEnabled;
	private Integer plarExceptionEnabled;
	private Integer ownedByGroupExceptionEnabled;
	public CUSTOMRentalState getState() {
		return state;
	}
	public void setState(CUSTOMRentalState state) {
		setChange("state", this.state, state);
		this.state = state;
	}
	public CRMDOAccountReceivable getAccountReceivable() {
		return accountReceivable;
	}
	public void setAccountReceivable(CRMDOAccountReceivable accountReceivable) {
		setChange("accountReceivable", this.accountReceivable, accountReceivable);
		this.accountReceivable = accountReceivable;
	}
	public Date getEffectiveDate() {
		return effectiveDate;
	}
	public void setEffectiveDate(Date effectiveDate) {
		setChange("effectiveDate", this.effectiveDate, effectiveDate);
		this.effectiveDate = effectiveDate;
	}
	public Date getExpirationDate() {
		return expirationDate;
	}
	public void setExpirationDate(Date expirationDate) {
		setChange("expirationDate", this.expirationDate, expirationDate);
		this.expirationDate = expirationDate;
	}
	public Set<CUSTOMCRMDORentalItem> getItems() {
		return items;
	}
	public void setItems(Set<CUSTOMCRMDORentalItem> items) {
		setChange("items", this.items, items);
		this.items = items;
	}
	public CUSTOMCRMDORentalType getType() {
		return type;
	}
	public void setType(CUSTOMCRMDORentalType type) {
		setChange("type", this.type, type);
		this.type = type;
	}
	@Override
	public void setUserField1(String userField1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField2(String userField2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField3(String userField3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField4(String userField4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField5(String userField5) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField6(String userField6) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField7(String userField7) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField8(String userField8) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime1(Date dateTime1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime2(Date dateTime2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime3(Date dateTime3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime4(Date dateTime4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat1(BigDecimal float1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat2(BigDecimal float2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat3(BigDecimal float3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat4(BigDecimal float4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setStatusTransitionExceptionEnabled(Integer statusTransitionExceptionEnabled) {
		this.statusTransitionExceptionEnabled = statusTransitionExceptionEnabled;
	}
	
	@Override
	public Integer getStatusTransitionExceptionEnabled() {
		return this.statusTransitionExceptionEnabled;
	}
	@Override
	public Set<CRMDO> getAuditTrailLogs() throws Exception Boolean isStatusTransitionExceptionEnabled() {
		return ((this.statusTransitionExceptionEnabled!=null && this.statusTransitionExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setACRExceptionEnabled(Integer acrExceptionEnabled) {
		this.acrExceptionEnabled = acrExceptionEnabled;		
	}
	@Override
	public Integer getACRExceptionEnabled() {
		return this.acrExceptionEnabled;
	}
	@Override
	public Boolean isACRExceptionEnabled() {
		return auditTrailLogs((this.acrExceptionEnabled!=null && this.acrExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setAuditTrailLogssetPLARExceptionEnabled(Set<CRMDO>Integer auditTrailLogs) throws ExceptionplarExceptionEnabled) {
		this.plarExceptionEnabled = plarExceptionEnabled;	
	}
	@Override
	public Integer getPLARExceptionEnabled() {
		this.auditTrailLogs=auditTrailLogs;
		
	}
}

return this.plarExceptionEnabled;
	}
	@Override
	public Boolean isPLARExceptionEnabled() {
		return ((this.plarExceptionEnabled!=null && this.plarExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setOwnedByGroupExceptionEnabled(Integer ownedByGroupExceptionEnabled) {
		this.ownedByGroupExceptionEnabled = ownedByGroupExceptionEnabled;		
	}
	@Override
	public Integer getOwnedByGroupExceptionEnabled() {
		return this.ownedByGroupExceptionEnabled;
	}
	@Override
	public Boolean isOwnedByGroupExceptionEnabled() {
		return ((this.ownedByGroupExceptionEnabled!=null && this.ownedByGroupExceptionEnabled.equals(new Integer(1))) ? true : false);
	}	
}

2. Entities Metadata File

In entities metadata file, <audittrailexcluded>  <workflowruleincluded> tag's value must be set to falsetrue. Keep in mind that <audittrailexcluded> <workflowruleincluded> default value is false, so in such cases, it can be omitted.

Also if you want 'Applicable on Entity Types' setting to be available <entitytypeid> must be defined as well as the corresponding entity.

Ui expand
titleAudit Trail Entities
Code Block
languagexml
titleentities.xml
collapsetrue
<entities>
		<entity>
			<id>CUSTOMRENTALS</id>
			<name>key_rental</name>
		<description/>
		<tablename>TRN_RENTALS</tablename>
			<classname>com.crm.dataobject.rentals.CUSTOMCRMDORental</classname>
			<moduleid>CUSTOM_RENTALS</moduleid>
			<metadatafile>rentals</metadatafile>
			<workflowruleincluded>true</workflowruleincluded>
			<typeentityid>CUSTOMRENTALTYPES<<entitytypeid>CUSTOMRENTALTYPES</typeentityid>entitytypeid>
		<masterentityid/></entity>
		
		<entity>
		<moduleid>CUSTOM_RENTALS</moduleid>
		<metadatafile>rentals</metadatafile>
		<csrexcluded>false</csrexcluded>
		<plarexcluded>true</plarexcluded>
		<acrexcluded>true</acrexcluded>
		<audittrailexcluded>false</audittrailexcluded>
		<id>CUSTOMRENTALTYPES</id>
			<name>key_rental_type</name>
			<tablename>TRN_RENTALTYPES</tablename>
			<classname>com.crm.dataobject.rentals.CUSTOMCRMDORentalType</classname>
			<moduleid>CUSTOMRENTALS</moduleid>
			<metadatafile>rentaltypes</metadatafile>
		</entity>
	...
</entities>

 

 

...

Ui expand
titleMonitored Fields
Code Block
languagexml
titleentities.xml
collapsetrue
<mainfield>
	<id>custom_number</id>
	<name>key_number</name>
	<xpath>number</xpath>
	<csrexcluded>true</csrexcluded>
	<plarexcluded>true</plarexcluded>
	<acrexcluded>true</acrexcluded>
	<audittrailexcluded>true</audittrailexcluded>
</mainfield>
<fields>
	<field>
			<id>custom_type</id>
			<name>key_type</name>
			<relatedentityxpath>type</relatedentityxpath>
			<xpath>name</xpath>
		</field>
		<field>
			<id>custom_account</id>
			<name>key_account</name>
			<relatedentityxpath>accountReceivable</relatedentityxpath>
			<xpath>name</xpath>
		</field>
		<field>
			<id>custom_state</id>
			<name>key_state</name>
			<xpath>state</xpath>
		</field>
		<field>
			<id>custom_effective_date</id>
			<name>key_effective_date</name>
			<xpath>effectiveDate</xpath>
		</field>
	...
</fields>
<collections>
		<collection>
			<id>custom_items</id>
			<name>key_items</name>
			<relatedentityxpath/>
			<xpath>items</xpath>
			<csrexcluded>false</csrexcluded>
			<plarexcluded>true</plarexcluded>
			<acrexcluded>true</acrexcluded>
			<method>
				<ejbname>CUSTOMCRMUIRental</ejbname>
				<methodname>loadItemsTab</methodname>
				<parameters>
					<parameter>
						<xpath>[DTO]</xpath>
					</parameter>
				</parameters>
			</method>
			<mainfield>
				<id>custom_serialNumber</id>
				<name>key_serialNumber</name>
				<relatedentityxpath>installedItem</relatedentityxpath>
				<xpath>serialNumber</xpath>
				<audittrailexcluded>true</audittrailexcluded>
			</mainfield>
			<fields>
				<field>
					<id>custom_code</id>
					<name>key_product_code</name>
					<relatedentityxpath>installedItem</relatedentityxpath>
					<xpath>product/code</xpath>
					<audittrailexcluded>true</audittrailexcluded>
				</field>
				<field>
					<id>custom_type</id>
					<name>key_product_type</name>
					<relatedentityxpath>installedItem</relatedentityxpath>
					<xpath>product/type/name</xpath>
					<audittrailexcluded>true</audittrailexcluded>
				</field>
		</fields>
	</collection>
</collections>