Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

How to get all activities of a person using PersonActivity archive

Hello,

We use the PersonActivity archive in order to get the list of all the activities related to a person. With our first attempt we managed to get only the activities for which the current person is the owner. What we actually want is the same list as displayed in the Activities tab, which includes the appointments with the current person as a participant.

Doing a bit of reverse engineering, we found out that the following list of restrictions is sent to fill the Activities tab:

      "ArchiveRestrictionInfo":[
         {
            "$type":"SuperOffice.CRM.ArchiveLists.ArchiveRestrictionInfo, SOCore",
            "Name":"personId",
            "Operator":"=",
            "Values":[
               "72"
            ],
            "DisplayValues":[

            ],
            "ColumnInfo":null,
            "IsActive":true,
            "SubRestrictions":null,
            "InterParenthesis":0,
            "InterOperator":1,
            "UniqueHash":-1498818214
         },
         {
            "$type":"SuperOffice.CRM.ArchiveLists.ArchiveRestrictionInfo, SOCore",
            "Name":"personId",
            "Operator":">",
            "Values":[
               "0"
            ],
            "DisplayValues":[

            ],
            "ColumnInfo":null,
            "IsActive":true,
            "SubRestrictions":null,
            "InterParenthesis":0,
            "InterOperator":1,
            "UniqueHash":-1465533190
         },
         {
            "$type":"SuperOffice.CRM.ArchiveLists.ArchiveRestrictionInfo, SOCore",
            "Name":"expandPersonId",
            "Operator":"=",
            "Values":[
               "1"
            ],
            "DisplayValues":[

            ],
            "ColumnInfo":null,
            "IsActive":true,
            "SubRestrictions":null,
            "InterParenthesis":0,
            "InterOperator":1,
            "UniqueHash":1316157234
         },
         {
            "$type":"SuperOffice.CRM.ArchiveLists.ArchiveRestrictionInfo, SOCore",
            "Name":"recipientStatus",
            "Operator":"in",
            "Values":[
               "4",
               "6"
            ],
            "DisplayValues":[

            ],
            "ColumnInfo":null,
            "IsActive":true,
            "SubRestrictions":null,
            "InterParenthesis":0,
            "InterOperator":1,
            "UniqueHash":449276015
         }
      ]

We tried using the same restrictions, and indeed we got the same list as the Activities tab.

Now of course we don't want to apply these restrictions without understanding them, and they raise a few questions:

  • Why is there a check on personId > 0 when there is already a condition personId = <current person ID>?
  • "expandPersonId" seems to be the column we need to get the appointments with the person as a participant, but this column is not documented in the PersonActivity archive provider documentation. We would like to know how this column works and what exactly we get with it.
  • According to that same documentation "recipientStatus" is an int, "Reception status: Status of mailing reception". Nothing indicates which status are 4 and 6. Are these status documented anywhere?

Thank you for your help!

RE: How to get all activities of a person using PersonActivity archive

Hello,

recipientStatus refers to the status column of the s_shipment_addr table, used when displaying mailings in the activity tab.

the status column of the s_shipment_addr table has the following enum behind it: EnumShipmentAddrStatus

Af: David Hollegien 3. mar 2020

RE: How to get all activities of a person using PersonActivity archive

The magic is hidden behind the expandPersonId restriction.
This is not a real column. It might as well have been implemented as a entity checkbox.
(In Win this is selectable from an extra dropdown button where I also added a Skip completed item).

I suspect Web also adds the pesonId > 0 restriction to guard against loading orphaned appointment records when creating a new Person since the current person id will then be 0. You don't need it in your use case.

The recipientStatus restriction is default added (by all clients) but has nothing to do with activities.
The provider will pass this one on to the proper sub-provider if the mailings entity is required.

/conrad

 

 

 

Af: Conrad Weyns 3. mar 2020

RE: How to get all activities of a person using PersonActivity archive

Thank you both, your answers are very helpful.

Af: Véronique Borel 4. mar 2020