+ Start a Discussion
Behzad Bahadori 18Behzad Bahadori 18 

Retriving Notes and attachments from Quote Page

I need to Query the Last notes and attachments that was added in a Quote, into a PDF, I dont now how to query that , any suggestions?
Best Answer chosen by Behzad Bahadori 18
Brian Cherry FWIBrian Cherry FWI
public Attachment[] attachments {
    get {
        if (attachments == null) {
            attachments = [
                    select Id, Name, Description, LastModifiedDate
                    from Attachment
                    where ParentId = YourObjectId
                    order by Description
                    ];
        }
        return attachments;
    }
    private set;
}

 

All Answers

Brian Cherry FWIBrian Cherry FWI
public Attachment[] attachments {
    get {
        if (attachments == null) {
            attachments = [
                    select Id, Name, Description, LastModifiedDate
                    from Attachment
                    where ParentId = YourObjectId
                    order by Description
                    ];
        }
        return attachments;
    }
    private set;
}

 
This was selected as the best answer
Behzad Bahadori 18Behzad Bahadori 18
Thank you Brian, would the ObjectId be The QuoteID in this case?
Brian Cherry FWIBrian Cherry FWI
Yes so you should have query for the variable of your QuoteID which you would replace YourObjectId

 
Behzad Bahadori 18Behzad Bahadori 18
Perfect thank you so much