Soql query to access Topics associated with FeedItems in salesforce Chatter - soql

I am trying to access FeedItems and topics(tags) associated to each FeedItem in a chatter Group. I am not able to figure out the relationship between FeedItems and Topics tagged with FeedItem.
I am able to get all the FeedItems in a chatter Group using the following soql Query:
SELECT c.id, c.CreatedDate, c.InsertedBy.Name FROM CollaborationGroupFeed c
WHERE c.Parent.Name = 'Chatter_Group_name'
Similarly I can get all the Topics using following soql Query:
Select Id, Name from Topic
But i need to get each FeedItem with Topics tagged with it (if any).
Following is the image to better understand it.
I need to get the topics mentioned in the black rectangle.
Can anyone help me to get the Required output? Let me know if Other information is required regarding this.

You need to query the TopicAssignment object like this:
List<TopicAssignment> myFeedItemFeedAssignments = [
SELECT
Id,
NetworkId,
TopicId,
Topic.Name,
EntityId,
EntityKeyPrefix
FROM
TopicAssignment
WHERE
EntityId IN :feedItemId
Each TopicAssignment record has a Name property
P.S. You might get more responses by posting on salesforce.stackexchange.com

Related

Find User IDs not on OPRDEFN in PeopleSoft FIN

Our former security admin team off-boarded terminated users by deleting their user profiles from the system. We have changed that policy but there is potential for duplicates. I am attempting to find user ids on the various module tables that are not on the OPRDEFN but having no luck.
I would like to query the major tables to return a list of all user ids to compare to the current OPRDEFN. From there, I can either have them added or create a reference list the admins to use prior to creating a new user id.
Does anyone have any tips or already written SQL? I am not the best SQL writer, I've tried several different things but nothings works.
Any help would be greatly appreciated.
Here you have a list of tables using the OPRID field. I have already formatted it in a way you can just run the result to get the Oprids.
Also, consider other columns like OPERATOR
SELECT 'SELECT DISTINCT OPRID FROM PS_'||RECNAME||';' FROM PSRECDEFN WHERE RECTYPE=0
AND RECNAME IN
(SELECT RECNAME FROM PSRECFIELD WHERE FIELDNAME IN ('OPRID','OPERATOR'))
AND RECNAME NOT LIKE '%AET'
AND RECNAME NOT LIKE '%TMP'
Also, you may just look at PSACCESSLOG, it will show you when someone access, so you may save time by querying it only

Query to get the Shipping Method and Payment Terms of Sales Order

I'm creating a report that contains details of sales order per order number in BI Publisher using Oracle Fusion Cloud r13. Now, my problem is, I can't find the table that contains the shipping method and payment terms. I tried to search it to Google but I can't find anything that can help me. Can someone here knows what the query for it is? Or the table only. Thanks
These should help you. You'll have to do some more digging to know what exactly these do and how to link to them.
Don't forget about select * from all_tab_cols you can query against that to find any table that has a column your looking for.
Also, while in Oracle EBS, there's always the help, diagnostics, examine which should get you the field. And record history will give you the table/view name
Ship Method
oe_order_headers_all.shipping_method_code
wsh_trips.ship_method_code
wsh_new_deliveries.ship_method_code
wsh_delivery_details.ship_method_code
wsh_carrier_ship_methods
wsh_carrier_services
Payment terms
oe_order_headers_all.payment_term_id
ra_terms_tl.payment_term_id

how to join two tables in linq? Using WCF Data Service

I want to join two tables in one of my linq query. I have written one code but it gives me an error like below
The method 'Join' is not supported.
I have tried this code:
var query = (from ls in this.testEntities.abc
join itm in this.testEntities.edf on ls.ID equals itm.ID
where itm.val == param
select new
{
ls.Name,
ls.Contact
}).ToList();
Am I missing something?
If anyone have any idea about it than please help me...
WCF Data Services is able to directly expand related objects based upon the Entity Data Model. (Don't worry about it if you don't know a lot about an EDM; it's not particularly important to the answer.) Since WCF Data Services is already aware, for instance, that a Product has a Category, I can fire up LinqPad, give it this URL, and issue a query like the following:
Products.Expand("Category").Take(2)
The result is two products, each with a property of type Category.
I'm not really sure what that translates to in the other LINQ syntax, sorry.
HTH,
Mark

Cypher Query to get connected nodes from two relations

I'm newbie to Neo4j/GraphDB and have created following simple graph
node[1]user1 which is 'friend' with node[2]user2 and node[3]user3
and all 3 above user have 'post' nodes connected to them as well..
question is how to get user1's connected friend and their post as well?
following query returns friends of user1 and his post only...
START user1=node(2) MATCH user1-->all_node RETURN all_node
Depending on the relationship types you have chosen, something like this should work:
START user1=node(2)
MATCH user1-[:FRIEND]->friend-[:POST]->post
RETURN friend,post

I am having some problems querying relationship within our schema using the SOAP API?

I am trying to query the relationship "Assigned_To__r" within the "Case" object, so I can return the Name of the User that is currently assigned to the case.I have tried many different syntaxes, and read many different web pages on this, but can't seem to figure it out. Here is my current syntax that isn't working, but as I said, I've tried many different combinations
Please help.
`select Id,CaseNumber,Subject,(select Name from Assigned_To__r)
from Case
where Closure_Code__c <> 'Invalid Support Case'
and Closure_Code__c <> 'Duplicate Case'
and Closure_Code__c <> 'Spam''
This is the error I am getting:
INVALID_TYPE:
CaseNumber,Subject,(select Name from Assigned_To__r) from Case where
^
ERROR at Row:1:Column:48 Didn't understand relationship
'Assigned_To_r' in FROM part of query call. If you are attempting to
use a custom relationship, be sure to append the '_r' after the
custom relationship name. Please reference your WSDL or the describe
call for the appropriate names.
Your SOQL has a few formatting issues.
If you can clarify how the Assigned_To__c custom field relates to a Case, I can be a bit clearer in how to help solve your problem. However, based upon my best guess of your situation (specifically, Closure_Code__c is a standard picklist and Assigned_To__r is a custom child-to-parent relationship field on the Case), I'll wager your desired SOQL looks something like this:
SELECT Id, CaseNumber, Subject, Assigned_To__r.Name
FROM Case
WHERE Closure_Code__c NOT IN ('Invalid Support Case', 'Duplicate Case', 'Spam')

Resources