You need to sign in to do that
Don't have an account?

Regarding Chatter
hi,
my need is we share something in chatter by using @ function particular users only recieve the message their mobiles(using of sms magic application).
i write the trigger its working but the sms will be going multiple users..
can anyone help me..please
trigger bouncedTrigger66 on FeedItem (after insert) {
List<smagicbasic__smsMagic__c> smsObjects = new List<smagicbasic__smsMagic__c>();
String tplText = null;
String query = null;
List<sObject> sObjects = null;
Id leadId = null;
EntitySubscription es;
list<user> uu;
Id userId = UserInfo.getUserId();
Id orgId = UserInfo.getOrganizationId();
for (FeedItem f : Trigger.new)
{
String parentId = f.parentId;
if(parentid!=null)
{
es = [SELECT id, parentid, subscriberid, parent.name FROM EntitySubscription WHERE parentid = : parentid];
if(es.subscriberid!=null)
{
uu = [select id,MobilePhone,name from user where id = :es.subscriberid];
}
}
for(user u :uu)
{
if(u.MobilePhone != null){
tplText = 'F.body';
smagicbasic__smsMagic__c smsObj = new smagicbasic__smsMagic__c();
smsObj.smagicbasic__PhoneNumber__c = u.MobilePhone;
smsObj.smagicbasic__SMSText__c = tplText;
smsObj.smagicbasic__senderId__c = 'smsMagic';
smsObj.smagicbasic__Name__c = u.Name;
smsObjects.add(smsObj);
}
}
}
insert smsObjects;
}
Thanks&Regards
bhagi
then revise the code around if(es.subscriberid!=null)
for details, please see http://boards.developerforce.com/t5/Chatter-and-Chatter-API/Compile-Error-Invalid-foreign-key-relationship-FeedItem/td-p/456735
All Answers
Compile Error: Invalid foreign key relationship: FeedItem.FeedTracking a
http://boards.developerforce.com/t5/Chatter-and-Chatter-API/Compile-Error-Invalid-foreign-key-relationship-FeedItem/m-p/458579#M2113
yes jaihu.what i wil do??can u suggest me?
i am also facing that problem.so...
then revise the code around if(es.subscriberid!=null)
for details, please see http://boards.developerforce.com/t5/Chatter-and-Chatter-API/Compile-Error-Invalid-foreign-key-relationship-FeedItem/td-p/456735
Thank you jai hu.
Its working.the error is rectified.but we share something in chatter the user unable to recieve the message thier mobile.