You need to sign in to do that
Don't have an account?
Edwards71
Notes and attachments in Account object - prevent showing entries made in other objects
Is it possible to surpress the Notes and Attachments in the Account object from picking up all notes made in other objects that relate to that Account? When viewing the account record the notes are obviously all out of context.
I'm guessing I need a VF page with an extension to acheive this?
Thanks in advance!
Hi Edward,
still banging around on your question....
VF Page:
Controller (no change to your code):
All Answers
Hi-
Yeah, I think you need a page to do this - like:
...And the myControllerExtension would return the tasks filtered on your specific criteria.
Put the above page snippet on your account page layout and it should be all OK.... But it definitely is NOT a "clicks only" solution.
Yes, you need a VF and add it to Account page layout. I think it wil take about 3 hours.
Please send your develope account to my email if you want to let me do it.
Thanks,
Samba
thanks - I am able to display the Notes and Attachments using an extension easily enough - however the attachment just shows the file name. What do I need to do to be able to click on the attachment file name to open it up?
<apex:page standardcontroller="Account" showheader="false" extensions="AccountNotes" cache="true" >
<apex:pageBlock title="Notes">
<apex:pageBlockTable value="{!Notes}" var="item" cellpadding="10" rules="all" styleclass="pageblock" >
<apex:column value="{!item.LastModifiedDate}" />
<apex:column value="{!item.title}" />
<apex:column value="{!item.body}" />
<apex:column value="{!item.OwnerId}"/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock title="Attachments">
<apex:pageBlockTable value="{!DocAttachment}" var="item" cellpadding="10" rules="all" styleclass="pageblock" >
<apex:column value="{!item.LastModifiedDate}" />
<apex:column value="{!item.name}" />
<apex:column value="{!item.OwnerId}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Hi Edward71,That was the
comment I made in the previous ststement.
If you have a controller for your VF page, post it and we can all take a look at it.
here you go - thanks
public class AccountNotes {
// Extension controller for Visualforce page
public AccountNotes(ApexPages.StandardController controller) {
}
Public Note [] getNotes (){
return [Select Id, IsDeleted, ParentId, Title,IsPrivate, Body, OwnerId, CreatedDate, CreatedById,LastModifiedDate, LastModifiedById, SystemModstamp FROM Note where ParentId= :System.currentPageReference().getParameters().get('id') Order by LastModifiedDate DESC];
}
Public Attachment [] getDocAttachment () {
return [Select Id, IsDeleted, ParentId, Name, IsPrivate, ContentType, BodyLength, Body, OwnerId, CreatedDate,
CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description FROM Attachment
where ParentId= :System.currentPageReference ().getParameters().get('id')
Order by LastModifiedDate DESC];
}
Hi Edward,
still banging around on your question....
VF Page:
Controller (no change to your code):
Perfect - just what was needed. Thanks very much for your promptness with this one!