function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Parth Patel 184Parth Patel 184 

async soql field map to lookup field fails

Using Async SOQL as per below:

{
  "query": "SELECT EventDate,EventIdentifier,Operation,QueriedEntities,RecordId,SourceIp,Username,UserType FROM LightningUriEvent WHERE QueriedEntities LIKE '%contact%'",
  "targetObject": "UsersAccessingHPC__c",
  "targetFieldMap": {
    
    "EventDate": "EventDate__c",
    "Operation": "Operation__c",
    "EventIdentifier": "EventIdentifier__c",
    "QueriedEntities": "QueriedEntities__c",
    "RecordId": "Contact__c",
    "SourceIp": "IPAddress__c",
    "Username": "User__c",
    "UserType": "UserType__c"
  }
}


As highlighted above Contact__s is a lookup key field, that i want to populate from RecordId from LightningUriEvent object. The main reason is I want to report on this for users. This fails with an error:
async soql does not know what to do with this field. it's an id field that is not the pk and has no fk domains

If I use normal field to map RecordId it works fine as I need to update a lookup key for reporting, it fails.

Any help would be appreciated.
Parth Patel 184Parth Patel 184

To me this where clause has an issue WHERE QueriedEntities LIKE '%contact%
Not sure if we can have only records for Object Contact to be extracted out?

Please advise.