English 中文(简体)
实施限制: FefLotem 需要 Id 过滤器
原标题:Implementation restriction: FeedItem requires a filter by Id
When T tested with non-admin user this error occurred. Any possible solution for this ? I have class which called by trigger. According to my functionality i have to calculate latest Activity s days since activity happened to current date. With the admin user all functionality runs successfully, but when tested with non-admin user error occurred on FeedItem s list. enter image description here ` List feeditemList =[SELECT ID, CreatedDate, CreatedById, CreatedBy.Name, ParentId, Parent.Name, Body FROM FeedItem where parentId =:oppId_Set ORDER BY CreatedDate DESC limit 1]; system.debug( $$$ feeditemList: + feeditemList); //FeedItem for(FeedItem fi : feeditemList) { if(!feeditemList.isEmpty()) { if(fi.CreatedDate<>Null) { latestFeeditemDate =fi.CreatedDate; system.debug( latestFeeditemDate in feeditem loop +latestFeeditemDate); } } } ` Any Possible Solution for this.
问题回答
One way to bypass this error is to use the keyword "WITH SYSTEM_MODE" in your query. This will allow the user to see all messages, regardless of their permissions. However, in this specific case, it seems acceptable as you only need to retrieve the last date from the latest chatter message.




相关问题
Using Aggregate Functions Inside a Trigger In MySQL

I have a People table with several attributes including age . Each time I insert a new tuple into this table, I would like to find out the average age of all the people listed in the table. If the ...

Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

creation of trigger

I have this trigger procedure CASE_A as UPDATE table1 SET field1 = (SELECT bus FROM view1 WHERE table1.document = view1.document) end; the below trigger is supposed to execute the above ...

Inserting trigger (SQL 2005)

I have a temp table (question_desc, ans1, ans2, ans3, ans4, correct_ans, marks) with say 10 entries. From this table I have to insert values in two other tables: questions (q_id(auto-generated), ...

Before trigger in SQL Server

I have 2 tables: survey (id(PK), name) and survey_to_topic (survey_id(PK,FK,not null), topic_id(PK,FK,not null)). When I try to delete from survey table, I get exception: "The DELETE statement ...

Jquery mouseover/mouseout triggering inconsistently

I have two sortable lists, one being nested, with a mouse over effect on the li elements of the nested sortable list. My problem is that the mouseover and mouseout functions are being called ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签