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
NAGAM VENKATA KRISHNA 8NAGAM VENKATA KRISHNA 8 

can any one explain the purpose of attachment ParentId?

Best Answer chosen by NAGAM VENKATA KRISHNA 8
Suraj Tripathi 47Suraj Tripathi 47
Hi Nagam,

It is showing lookup with Account just see in the below example.
Account accDetail=[SELECT Id,Name FROM Account WHERE Name='CloudAnalogy10' Limit 1];
 List<Attachment> contentAttachment=[Select ParentId,Id,Name,Body FROM Attachment WHERE ParentId=: accDetail.Id];

If you find your Solution then mark this as the best answer.    


Thank you!

Regards 
Suraj Tripathi

All Answers

Suraj Tripathi 47Suraj Tripathi 47
Hi Nagam,

It is showing lookup with Account just see in the below example.
Account accDetail=[SELECT Id,Name FROM Account WHERE Name='CloudAnalogy10' Limit 1];
 List<Attachment> contentAttachment=[Select ParentId,Id,Name,Body FROM Attachment WHERE ParentId=: accDetail.Id];

If you find your Solution then mark this as the best answer.    


Thank you!

Regards 
Suraj Tripathi
This was selected as the best answer
VinayVinay (Salesforce Developers) 
ParentId is a system field; it comes standard in Salesforce. For example, let's say I want to connect a feed item with an account record the ID of the account is linked to the ParentId.

Thanks,