• saurabhEvent
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 12
    Replies

I am trying to write a trigger that will autofollow a group users to every new record in the object MPS__c

 

I have been able to automatically follow one user to the record, but when I try to autofollow additional users, I recieve the following error:

 

Error: Compile Error: Duplicate field initialization: subscriberid at line 24 column 34

 

 

Here is my trigger:

 

 

trigger MPSFollowers on MPS__c (After Insert) {

    Set<Id> mIds = new Set<Id>();
    Set<Id> fId = new Set<Id>();
    for(MPS__c mps :trigger.new) {
    
        mids.add(mps.id);
        System.debug('**** 1 mps id : '+ mps.id);
    }
    
   List<MPS__c> p = [select id from MPS__c where id in :mIds];

   
   List<User> u1 = [select id from User where name = 'Shawn Prendiville'];
   List<User> u2 = [select id from User where name = 'Mariann Harmon'];
   List<User> u3 = [select id from User where name = 'Paul van Vugt'];
   List<User> u4 = [select id from User where name = 'Gary Brown'];
   List<User> u5 = [select id from User where name = 'Dave Setzer'];
                    
    EntitySubscription follow = new EntitySubscription (

                                 parentId = p[0].id,
                                 subscriberid = u1[0].id,
                                 subscriberid = u2[0].id
                );

    insert follow;


}

 

 

How do I bulkify this trigger and assign multiple users to follow the record?

 

Thank you,

ckellie

Hi All,

 

Salesforce was allowing scheduling of apex batch job using script for every 10 minutes, with recent release they do not have any way use special characters in minutes variable.

 

Is their any work around for it?

 

//Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String sch = seconds + ‘ ‘ + minutes + ‘ ‘ + hours + ‘ ‘ + dayOfMonth + ‘ ‘ + month + ‘ ‘ + dayOfWeek + ‘ ‘ + year;
//String sch = ’0 10,20,30,40,50 * * 11 ? 2013′;

 

Thanks!

Hi All,

 

I am trying to build a REST app for pulling up Metadata components from an Salesforce Sandbox, I get following error:

 

If I use : https://cs1.salesforce.com/services/metadata/v25.0/components/

 

Error Message : [{"message":"The REST API is not enabled for this Organization.","errorCode":"API_DISABLED_FOR_ORG"}]

 

If I use : https://cs1.salesforce.com/services/metadata/25.0/components/

 

Error Message : [{"message":"The requested resource does not exist","errorCode":"NOT_FOUND"}]

 

I am passing Bearer as an authorization token in the header request.

 

Am I missing something here?

 

 

Thanks!

Hi All,

 

We have a functionality where portal user gets ability to change his account via a VF page, so behind the scene we are chaning account on the portal contact by running apex in system mode.

 

Our sharing model is based out on Account, so all visibility is controlled by Account. This all works fine.

 

However when volume of records associated with Account increase VF page can't handle the backend update on Portal Contact and comes back with a timeout error. To overcome this I pushed backend functionality into a future call, but my future call went dead with this error message --- "Message could not be processed and ended up in dead message queue

 

Any suggestions what can done to overcome this?

 

Thanks!

Hi All,

 

I am looking to construct a SOSL query where I need to do a find all of Accounts and Contacts owned by a logged in User.

 

FInd {__} in ALL Fields returning Account, Contact LIMIT 100

 

What should I put in the text field(__) for my SOSL so that I return all records.

 

Thanks in Advance!

Hi All,

 

I have built a detail page section on account record, I am placing visualforce page in it.

 

I have visualforce page extend Account Standard controller, however if my page contains nothing ..no html I am seeing a <div class="datepicker"> getting included in my page, and a date picker is displayed on my page,which is wierd.

 

So if i make a standardstylesheets attribute to false, this div goes away.

 

Seems like some bug in Visualforce or I am missing something.

 

Thanks!

Hi All,

 

When I try to extract profile meta file using ant script i am hitting a limitation in terms of number of components getting reterived as part of extract.

 

As anyone come around this limitation and or I need to set some parameter as part of extract.

 

Thanks,

Saurabh Rawane

Hi,

 

I'm new in salesforce and I installed a package and i have access for all my custom tabs under system administrator, but i can't acces to the tabs in standard user profile, I have my app visible for this profile and the custom tabs are in default on. I don't know what I'm doing wrong. It's got to be something simple.

 

Any help would be appreciated.

Hi All,

 

I am trying to build a REST app for pulling up Metadata components from an Salesforce Sandbox, I get following error:

 

If I use : https://cs1.salesforce.com/services/metadata/v25.0/components/

 

Error Message : [{"message":"The REST API is not enabled for this Organization.","errorCode":"API_DISABLED_FOR_ORG"}]

 

If I use : https://cs1.salesforce.com/services/metadata/25.0/components/

 

Error Message : [{"message":"The requested resource does not exist","errorCode":"NOT_FOUND"}]

 

I am passing Bearer as an authorization token in the header request.

 

Am I missing something here?

 

 

Thanks!

Hi All,

 

We have a functionality where portal user gets ability to change his account via a VF page, so behind the scene we are chaning account on the portal contact by running apex in system mode.

 

Our sharing model is based out on Account, so all visibility is controlled by Account. This all works fine.

 

However when volume of records associated with Account increase VF page can't handle the backend update on Portal Contact and comes back with a timeout error. To overcome this I pushed backend functionality into a future call, but my future call went dead with this error message --- "Message could not be processed and ended up in dead message queue

 

Any suggestions what can done to overcome this?

 

Thanks!

Hi All,

 

I am looking to construct a SOSL query where I need to do a find all of Accounts and Contacts owned by a logged in User.

 

FInd {__} in ALL Fields returning Account, Contact LIMIT 100

 

What should I put in the text field(__) for my SOSL so that I return all records.

 

Thanks in Advance!

Hi to all,

My requirement is If we check a check box in perticular profile of a account owner. Then if any of his employess r any one create a contact then Contact Name is same as account owner .

 

 

public class Cont
{
public static void cb(Contact[] c1)
{
for(Contact c2:c1)
{
user c3;
if(c3.Auto_save_account_owner__c == true)
{
c2.Owner == c3.Name;
update c2;
}
}  
}
}

 

Error Is :
 Comparison arguments must be compatible types: SOBJECT:User, String at line 10 column 1

Hi All,

 

I have requirement that I have to add  colors  to Account filed.

 

I have two fields on Account object I need to display those two in different colors.

 

If any one having an idea please share with me.

 

Thanks,

  • April 25, 2011
  • Like
  • 0

I am trying to write a trigger that will autofollow a group users to every new record in the object MPS__c

 

I have been able to automatically follow one user to the record, but when I try to autofollow additional users, I recieve the following error:

 

Error: Compile Error: Duplicate field initialization: subscriberid at line 24 column 34

 

 

Here is my trigger:

 

 

trigger MPSFollowers on MPS__c (After Insert) {

    Set<Id> mIds = new Set<Id>();
    Set<Id> fId = new Set<Id>();
    for(MPS__c mps :trigger.new) {
    
        mids.add(mps.id);
        System.debug('**** 1 mps id : '+ mps.id);
    }
    
   List<MPS__c> p = [select id from MPS__c where id in :mIds];

   
   List<User> u1 = [select id from User where name = 'Shawn Prendiville'];
   List<User> u2 = [select id from User where name = 'Mariann Harmon'];
   List<User> u3 = [select id from User where name = 'Paul van Vugt'];
   List<User> u4 = [select id from User where name = 'Gary Brown'];
   List<User> u5 = [select id from User where name = 'Dave Setzer'];
                    
    EntitySubscription follow = new EntitySubscription (

                                 parentId = p[0].id,
                                 subscriberid = u1[0].id,
                                 subscriberid = u2[0].id
                );

    insert follow;


}

 

 

How do I bulkify this trigger and assign multiple users to follow the record?

 

Thank you,

ckellie

Hi,

 

 

I have small scenario like to display users who are in online for chatter.Can you  please help me in this scenario.



Thanksin Advance
     Sri

Hi,

 

I try this code:

http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

 

And when I execute, get a Salesforce.com Login, I put my login and when back to my computer (a localhost), get this error:

   https://login.salesforce.com/services/oauth2/token failed with status 0

 

Anyone can explain whats append?!!!

 

Best Regards,

LB

  • December 22, 2010
  • Like
  • 0