Skip to main content
May 21, 2024
Question

Record Level Security and Custom Fields

  • May 21, 2024
  • 8 replies
  • 0 views

Scenario:

I have a record like below:

Container Record which has fields like id, caseId, claimsId, providerId and these 3 fields point to primary keys of 3 other records Case, Claim and Provider.

Whenever an entry is made in Case an associated entry is made in Container for fields id and caseId

Whenever an entry is made in Claim an associated entry is made in Container for fields id and claimId

Whenever an entry is made in Provider an associated entry is made in Container for fields id and providerId

At any point there would be only 2 column in Container which would have values.

On Container we also have added custom fields to fetch other data fields like summary from Case, Claim, Provider and each of these 3 records have summary field

We are using realtime custom field using customfieldmatch to decide which related record should be used to get the summary field for the custom field by looking at which identifier is not null.

a!customFieldMatch(
  value: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.fields.{8c51d2ea-b8f6-420c-a2a1-1f0b6fbce346}containerId',
  whenTrue: a!customFieldCondition(
    field: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.fields.{ae24d835-8cac-42f7-b192-394a6ad713e1}crtStandardFieldsId',
    operator: "not null"
  ),
  then: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.relationships.{f9cefa68-b1db-42a0-b041-737f6643253c}crt.fields.{e1e6480f-e6a2-4169-bd05-0a538ec0f604}createdDt',
  whenTrue: a!customFieldCondition(
    field: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.fields.{718d97c1-228f-4779-9a51-f300280bb237}clmRequestId',
    operator: "not null"
  ),
  then: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.relationships.{cf544733-65d7-46c6-82fb-fd9ca0965581}clm.fields.{fb041636-a610-4ba7-b8a0-81efb5a68a4b}createdDt',
  whenTrue: a!customFieldCondition(
    field: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.fields.{c192123a-53a8-4aec-99f5-3d0ba3787ec8}caseId',
    operator: "not null"
  ),
  then: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.relationships.{39e703a6-3cbd-420e-aae2-c8c6c9d3f467}case.fields.{a8665c5a-25d9-43a0-a792-f56bfb0d9ad5}createdDt',
  whenTrue: a!customFieldCondition(
    field: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.fields.{08f3427f-cba9-4039-879b-81c30ef112a9}ppoRequestId',
    operator: "not null"
  ),
  then: 'recordType!{6453c614-aa7e-4b62-bc94-364fa1539a31}OPS Container.relationships.{714676ca-f05d-4d0d-8389-f84ea7c1903f}ppo.fields.{790fa23a-6fe7-4bf3-9f3b-cae34c27037d}createdDt',
  default: today(),
)

Now we also have different set of users who have access to each of these 3 apps Case, Claim, Provider and hence we added record level security to control who would see what records.

All seems ok, but when we use this inside grid and a user who is only having access to some of these apps and not all 3 apps, they are not able to see any data for summary.

But if instead of using the customField, we take the same code and put it on interface gridColumn, the data seem to be coming along fine for whatever record user has access for.

Is there any difference how custom fields are evaluated?

I know it's long shot and not everyday problem, any experience/insight around this is appreciated

    8 replies

    stefanhelzle0001
    Brainy
    May 21, 2024

    I do not see any certifications on your profile. How much experience do you have?

    On which record do you apply security? I ask, because Appian applies security rules at the lowest possible level. This means, before it evaluates your custom fields. If you rely on non-accessible data, this will fail.

    May 21, 2024

    This is not my primary profile! rest assured!

    Record level security is applied to the Container record to control only records visible to the users should be the one they have access, eg. if user has access to Case record, they should only see container record that is related to Case and so on!

    stefanhelzle0001
    Brainy
    May 21, 2024

    I am just asking to have an idea how much detailed guidance you might need.

    Did you try to query the data outside of a grid? When using different accounts, I would expect to see the same behaviour. I think it is important to get the grid out of the game.

    Do you see any errors in log files?

    Is the problem with the custom record field, or the security rules? From your description, I understand that when removing the custom field, things work as expected. Is that correct?