Last active
May 30, 2018 12:28
-
-
Save alikrc/b09e45f1f965e43b0636628a16ca6087 to your computer and use it in GitHub Desktop.
MS CRM Audit Database Table Columns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AttributeMask - Column number of attribute from either Attribute table or from MetadataSchema.Attribute | |
CRM stores all attributes changed in single transaction in a string format concatenate by , | |
Attribute mask column | |
SELECT ar.name, | |
ar.ColumnNumber | |
FROM MetadataSchema.Attribute ar INNER JOIN | |
MetadataSchema.Entity en ON ar.EntityId = en.EntityId | |
WHERE en.ObjectTypeCode=2 AND ar.ColumnNumber=47 | |
Or | |
SELECT ar.name, | |
ar.ColumnNumber | |
FROM Attribute ar INNER JOIN | |
Entity en ON ar.EntityId = en.EntityId | |
WHERE en.ObjectTypeCode=2 AND ar.ColumnNumber=47 | |
Action: | |
SELECT Value as Action,AttributeValue as ActionValue FROM StringMap WHERE AttributeName='action' | |
0 - Unknown, 25 - Disqualify, 44 - Win, 63 - Enabled for organization, | |
1 - Create, 26 - Submit, 45 - Lose, 64 - User Access via Web, | |
2 - Update, 27 - Reject, 46 - Internal Processing, 65 - User Access via Web Services, | |
3 - Delete, 28 - Approve, 47 - Reschedule, 100 - Delete Entity, | |
4 - Activate, 29 - Invoice, 48 - Modify Share, 101 - Delete Attribute, | |
5 - Deactivate, 30 - Hold, 49 - Unshare, 102 - Audit Change at Entity Level, | |
11 - Cascade, 31 - Add Member, 50 - Book, 103 - Audit Change at Attribute Level, | |
12 - Merge, 32 - Remove Member, 51 - Generate Quote From Opportunity, 104 - Audit Change at Org Level, | |
13 - Assign, 33 - Associate Entities, 52 - Add To Queue, 105 - Entity Audit Started, | |
14 - Share, 34 - Disassociate Entities, 53 - Assign Role To Team, 106 - Attribute Audit Started, | |
15 - Retrieve, 35 - Add Members, 54 - Remove Role From Team, 107 - Audit Enabled, | |
16 - Close, 36 - Remove Members, 55 - Assign Role To User, 108 - Entity Audit Stopped, | |
17 - Cancel, 37 - Add Item, 56 - Remove Role From User, 109 - Attribute Audit Stopped, | |
18 - Complete, 38 - Remove Item, 57 - Add Privileges to Role, 110 - Audit Disabled, | |
20 - Resolve, 39 - Add Substitute, 58 - Remove Privileges From Role, 111 - Audit Log Deletion, | |
21 - Reopen, 40 - Remove Substitute, 59 - Replace Privileges In Role, 112 - User Access Audit Started, | |
22 - Fulfill, 41 - Set State, 60 - Import Mappings, 113 - User Access Audit Stopped, | |
23 - Paid, 42 - Renew, 61 - Clone, | |
24 - Qualify, 43 - Revise, 62 - Send Direct Email, | |
ObjectId: | |
Object Id the record id, for which this audit record is created. | |
UserId: | |
The user who performed action on record. | |
ChangeData: | |
Change Data column stores old data for the attribute. If you changed First name of contact from James to Jim, then in Change data James will be stored. | |
Values in Change Data are stored in same order as attribute mask stored. | |
If First name attribute mask is 2 and last name is 3, then in AttributeMask it would be ,2,3 and Change data would be James~Bond | |
Change Data column data is separated by ~ by per attribute. | |
Operation: | |
Operation column stores information of what kind of operation is performed on record. | |
CRM has only four operations | |
1 - Create , 2 - Update, 3 - Delete, 4 - Access. | |
To get directly operation values from database use | |
SELECT Value,AttributeValue FROM StringMap WHERE AttributeName='operation' | |
ObjectTypeCode: | |
Object Type code is entity object type code. | |
To find object type code for entity use | |
SELECT ObjectTypeCode, LogicalName FROM Entity WHERE Name='contact' | |
If want to get entity details from object type code then use | |
SELECT ObjectTypeCode, LogicalName FROM Entity WHERE ObjectTypeCode=1 | |
ref | |
https://mahadeomatre.blogspot.com/2015/02/ms-crm-audit-database-table-details.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment