Retrieve newest association

0
Hi all,   I want to retrieve the departments of an specific account.   For reasons I want to have the newest set association between the account and department. Does anyone have a solution? There does not seem to be a sorting option for associations   Kind regards,   Roy
asked
2 answers
2

Roy,

You are correct - you cannot query associations based on create or change date.  If this is a requirement, you will need to create a third entity (in addition to Account and Department) called AccountDepartment, or something similar.  You would use this entity to manage the Departments that an Account is associated with.  You can then retrieve from this entity using create or change date.

 

Hope that helps,

Mike

answered
1

Hi Roy,

Depending on the type of association (1-* or *-*) you could either save the datetime of adding the association on the * side or use an information entity to store it.

Alternative solution could be auditing. Not entirely sure what the audit trail modules offer. Changes in associations can also be audited, but I am not 100% what information can be used.

Good luck.

answered