Skip to main content
March 6, 2024
Question

Related record data is not displaying

  • March 6, 2024
  • 13 replies
  • 0 views

Hello, I have two record types that are related to each other, but when I am trying to retrieve with relationship.relatedRecord.field, it displays only null, what can be the problem? How can I fix it?

    13 replies

    konduruc733182
    March 6, 2024

    Hello [mention:0d77b95d889c420097b2afce6f897f56:e9ed411860ed4f2ba0265705b8793d05] 

    I understand your requirement. But it would be much easier to get details on where the issue might be happening. Could you please provide the Code Snippet or Screenshots of the Expression that you are trying to evaluate.

    March 6, 2024

    I am trying in unnamed rule just to test it, but even though there are data it is displaying null

    konduruc733182
    March 6, 2024

    Please share the expression from the rule. You might have missed adding the additional fields from the related record in your query.

    If its only few fields that you would be indexing from the related record, I would highly recommend you to add only those fields in the fields parameter of your query. If you wish to have the complete set of related record, please add the relatedRecords parameter and write an additional get using a!relatedRecordData()

    varuntejg243705
    March 6, 2024

    Hi [mention:0d77b95d889c420097b2afce6f897f56:e9ed411860ed4f2ba0265705b8793d05] ,

    Are you trying to query the records?

    If not this might help a!relatedRecordData() function.


    March 6, 2024

    I tried, but the alert to event record is in a many-to-one relationship with cmc alerts and it is not working. But it is interesting because I never used the relatedRecordData and the data in other grids are displayed

    nikhilk162764
    Participating Frequently
    March 6, 2024

    I think while querying record you need to define a!relatedRecordData() in relatedRecordData inside a!queryRecordType

    a!relatedRecordData() Function

    March 6, 2024

    I tried, but the alert to event record is in a many-to-one relationship with cmc alerts and it is not working. But it is interesting because I never used the relatedRecordData and the data in other grids are displayed

    nikhilk162764
    Participating Frequently
    March 6, 2024

    Yes it will work only for one-to-many relationship

    harshitb6843
    March 6, 2024

    If they are related 1:M and you are querying the base record (1), then you can add that field in the queryRecordType's fields parameter and it will give you the data.

    March 6, 2024

    Yes, but I am not querying the base record but the other one. Thanks anyways

    harshitb6843
    March 6, 2024

    I think for that too it should work. Did you try?

    March 7, 2024

    I added the fields parameter in queryRecordType, and then added the relationship that I needed to get data from.