You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 3
Next »
This section describes how an audit trail entity can be created
What does this section cover?
Create an Implicit Viewing Access Entity
Entities with implicit viewing access are the entities which don’t hold information about who owns a record, but they cannot be viewed by users belonging to any Community, Group, or Unit, as their collaboration level is implied by their master entity.
In order for an entity to be considered as implicit, it has to meet the following conditions
1. Data Object
The entity's DO class must:
- Implement ICRMDOImplicitAccessibleEntity interface
- Implement interface's getMasterDO() method. Note that getMasterDO() method must always return a data object whose class:
- Extends CRMDOMasterEntity and
- Implements ICRMDOExplicitAccessibleEntity.
Example 1
In this case, because CRMDOAccountReceivable extends CRMDOMasterEntity and implements ICRMDOExplicitAccessibleEntity, accountReceivable can be returned by getMasterDO() method.
public class CUSTOMCRMDORental extends CRMDO implements ICRMDOImplicitAccessibleEntity {
private CUSTOMCRMDORentalType type;
private CUSTOMRentalState state;
private CRMDOAccountReceivable accountReceivable;
private Date effectiveDate;
private Date expirationDate;
private CRMDOPrivacyLevel privacyLevel;
private Set<CUSTOMCRMDORentalItem> items;
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 CRMDOPrivacyLevel getPrivacyLevel() {
return privacyLevel;
}
public void setPrivacyLevel(CRMDOPrivacyLevel privacyLevel) {
setChange("privacyLevel", this.privacyLevel, privacyLevel);
this.privacyLevel = privacyLevel;
}
public CUSTOMCRMDORentalType getType() {
return type;
}
public void setType(CUSTOMCRMDORentalType type) {
setChange("type", this.type, type);
this.type = type;
}
@Override
public ICRMDOExplicitAccessibleEntity getMasterDO() {
return this.accountReceivable;
}
}
Example 2
In this case, because CUSTOMCRMDORental, which is CUSTOMCRMDORentalItem class' main entity, does not extend CRMDOMasterEntity nor it implements ICRMDOExplicitAccessibleEntity, CUSTOMCRMDORental class' master data object, accountReceivable, must be returned.
public class CUSTOMCRMDORentalItem extends CRMDO implements ICRMDOImplicitAccessibleEntity{
private CUSTOMCRMDORental rental;
private CRMDOInstalledItem installedItem;
private Set<CUSTOMCRMDORentalItemUsage> usagePeriods;
public CUSTOMCRMDORental getRental() {
return rental;
}
public void setRental(CUSTOMCRMDORental rental) {
setChange("rental", this.rental, rental);
this.rental = rental;
}
public CRMDOInstalledItem getInstalledItem() {
return installedItem;
}
public void setInstalledItem(CRMDOInstalledItem installedItem) {
setChange("installedItem", this.installedItem, installedItem);
this.installedItem = installedItem;
}
public Set<CUSTOMCRMDORentalItemUsage> getUsagePeriods() {
return usagePeriods;
}
public void setUsagePeriods(Set<CUSTOMCRMDORentalItemUsage> usagePeriods) {
setChange("usagePeriods", this.usagePeriods, usagePeriods);
this.usagePeriods = usagePeriods;
}
@Override
public ICRMDOExplicitAccessibleEntity getMasterDO() {
return this.rental.getMasterDO();
}
}