Users may have noticed that Files under the Notes & Attachments related list don’t show up on the Account record when a user switches to Lightning Experience, however the same files are available when you switch back to Salesforce Classic.
Similarly, the same behavior can be observed when converting leads with attachments:
1. Create a Lead
2. Add a attachment to the lead [Newly added attachment shows up under the Notes & Attachments related list in Salesforce Classic]
3. Now convert the lead by creating a new account ‘or’ Add to an existing account
4. Open the newly created account in Salesforce Classic and you will see the attachment record created in Step 2
5. Switch over to Lightning Experience and navigate to the account, you will not see the attachment under the Notes & Attachment related list.
Note: Upload a File under the Notes & Attachments for a Lead record in Lightning Experience. When a lead is converted, the file will not get transferred to contact/account. The attachment in lightning experience is an action to upload a “File”. At the moment, Files don’t support the roll-up during lead conversion. Thus, the “Files” are not visible in contact/account.
Account objAccount=[select id,(select id from contacts),(select id from Orders),(select id from Cases),(select id from ActivityHistories ORDER BY ActivityDate DESC , LastModifiedDate DESC LIMIT 500),(select id from OpenActivities ORDER BY ActivityDate ASC , LastModifiedDate DESC LIMIT 500),(select id from Opportunities)
,(select id from Deliveries__r),(select id from Invoices__r)
from Account where id=:accountID];
mpAttachment.put(‘Attachment’,new list<attachment>([select id,Name,Body,BodyLength,ContentType,Description,
LastModifiedById,LastModifiedBy.Name,CreatedById,CreatedBy.Name from attachment where ParentId in:parentIDs ORDER BY LastModifiedDate DESC]));
mpAttachment.put(‘File’,new list<ContentDocumentLink>([SELECT ContentDocumentId,LinkedEntityId,LinkedEntity.Name,ContentDocument.ContentAssetId,
ContentDocument.LastModifiedById,ContentDocument.CreatedById,ContentDocument.CreatedBy.Name FROM ContentDocumentLink WHERE LinkedEntityId in :parentIDs ORDER BY ContentDocument.LastModifiedDate DESC]));
In my case, we have attachments that are related to child objects(Contacts, Cases, Orders, Opportunities, Activity History, Open Activities, Invoices, Deliveries). If you just want attachments that are related to any specific child object you can just query the same.
Custom Object Not Showing Up in the Select Field Type Drop Down.
I faced this problem, the Custom Object was not showing in the drop down list. Since, there was a Standard object with the same name.
When I try to merge the Fields in the Email Template I was looking at the standard object fields.
Example: Case Standard Object
Case__c Custom Object
How I resolved:
Just change the label of the Custom Object. This brings out the custom object in the drop down list of the Select Field Type.
Now you can merge the required fields into the Email Template