Does anybody know which table stores the 'Notes' in Salesforce.
I believe they are the new type of note.
You can query Note sobject.
SELECT Id, ParentId, Title, Body FROM Note
Have a look at more or Note.
Related
i have a view object that contains the following attributes
studentId
courseId
enrollDate
notes
and I have added 2 attributes, which are
studentName
courseName
and I want to select their values from another table(student,course) based on an SQL query.
i have tried to make a default value :SQL
and wrote the following query
select Course.courseName from Course where StudentCourse.CourseId = Course.id
but it didn't work.
You can get their values from an SQL query. This may help. Or this. Or this.
I have a junction object called "JIRA_Data" and its linked/ related to Accounts. How do I query to fetch data from this relationship. I am trying to extract id,type from Account object and Name from JIRA_Data junction object.
Could anyone assist. Thanks
You could do it multiple ways depending on how you want the data. If you query it from the parent account it would be something to the effect:
SELECT Id, Name, (Select ID, Name, Other_Parent__r.Name FROM Jira_Datas__r) FROM Account
or from the junction
SELECT Id, Name, Account.Name, Other_Parent__r.Name FROM Jira_Data__c
I am trying to select all comments ,feeds and feedcomments for an individual case.
The hierarchy is like
Case
|
CaseComment
|
FeedComments(commnets or feeds under a CaseComment)
I could not find any relation between CaseComments and FeedComments nor CaseComments and CaseFeeds.
How can I select all together in a soql or individual soqls which relates Case, CaseComment,CaseFeed,FeedComment?
EDIT
The query you've included in the comment looks good. I'd write it as something like that:
SELECT Id, Body, ParentId, Parent.CaseNumber, CreatedDate,
(SELECT Id, CommentBody, CommentType FROM FeedComments)
FROM CaseFeed
ORDER BY Parent.CaseNumber, CreatedDate
(this is sample output rendered in Real Force Explorer, a pretty neat tool)
If I'll click into the "2 records" bit I can drill down to the fields selected from FeedComment for "this" CaseFeed:
If your query renders differently for you (some stuff is blank) - maybe try this different editor or even go to https://workbench.developerforce.com
If only some comments contain text - they might be uploaded images for example - filter them by CommentType = 'TextComment'?
ORIGINAL
FeedComments(commnets or feeds under a CaseComment)
No, not really. FeedComment is a Chatter table that can link to many objects but CaseComment is not one of them.
Maybe study the Chatter Entity Relationship Diagram?
Anyway - relationship to feed* objects doesn't have a nice name exposed so we can't query it all in one go:
I think you'll need something like this:
SELECT Id, CaseNumber,
(SELECT Id, CommentBody FROM CaseComments),
(SELECT Id, Body FROM Feeds)
FROM Case
SELECT Id, FeedItemId, ParentId, CommentBody
FROM FeedComment
WHERE ParentId = :caseIdHere
I have requirement to fetch comment likes. I'm not able to figure out on how to retrieve commentlikes.
FeedLike object represents likes. You can't query FeedLike records directly. They can only be queried via the parent NewsFeed, UserProfileFeed, or entity feed, such as AccountFeed.
So to query FeedPost likes, use following:
SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM UserFeed
to query group post likes, use following:
SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM CollaborationGroupFeed
How to retrieve comment likes?
They are available through the Chatter REST API: http://wiki.developerforce.com/page/Chatter_API
I think you want to ChatterActivity SObject
Select c.ParentId, c.LikeReceivedCount, c.Id, c.CommentReceivedCount From ChatterActivity c
This should get what you are looking for.
EDIT:
Strange, I don't seem to be able to find anything on doing this in apex, you can do it through the api by calling
/chatter/comments/commentId/likes
So it should be possible somewhere along the line.This could work as a workaround though.
I want to get the field userhomepage from the custom table WebsiteUser via a SOQL query on the Account table. I tried about 10 different queries but i'm not getting it working...
fe. I've tried SELECT field1, (SELECT userhomepage FROM User) FROM Account with all the __c and __r combinations.
I've got the following structure:
<complexType name="Account">
<complexContent>
<extension base="ens:sObject">
<sequence>
...
<element name="WebsiteUser__c" nillable="true" minOccurs="0" type="tns:ID"/>
<element name="WebsiteUser__r" nillable="true" minOccurs="0" type="ens:WebsiteUser"/>
And the WebsiteUser table has a string field called userhomepage.
How do I put that in a query? i'm completely stuck, thnx in advance!
Maybe a child-to-parent style query will work.
Try this?
SELECT Account__r.field1, userhomepage FROM WebsiteUser__c
Relevant-looking documentation:
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql.htm
I'm assuming that WebsiteUser__c has a lookup to Account which is what I believe the snippet you've posted is showing, however that doesn't look like the standard object XML so I'm not 100% on where it's coming from.
A lookup from WebsiteUser__c to account creates a Many Website User to One Account relationship. If you were selecting from the Website User table you'd do something like:
select Id, UserHomePage__c, Account__r.Name
from WebsiteUser__c where some conditional
Querying the other way around requires a subquery:
select Id, Name, (select Id, UserHomePage__c from WebsiteUser__r)
from Account
This will return an Account with a list of all WebsiteUser__c records which are associated with it, you could run through the results like so:
for(Account sAcct : select Id, Name,
(select Id, UserHomePage__c from WebsiteUser__r)
from Account limit 200)
{
for(WebsiteUser__c sUser : sAcct.WebsiteUser__r)
{
System.Debug(sUser.UserHomePage__c);
// etc.
Some things to watch out for are that WebsiteUser__r might be a plural, i.e. WebsiteUsers__r, and if you've tried all combinations and it's not working, check that you didn't put in __c or __r yourself into the API object name, the system does this automatically so you'd end up with fields ending in __c__c or __r__r.
If you say what information you have to base the query on I might be able to make this answer a little bit more specific for you!
SELECT id, (SELECT UserHomePage__c FROM WebsiteUser__r) FROM ACCOUNT
if websiteUser__r is the child relation
SELECT id, WebsiteUser__r.UserHomePage__c FROM ACCOUNT
if websiteUser__r is the parent relation
it seems like a parent relationship to me so I think the later query would work...
Hope that helps