• MPetersen
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 12
    Replies

Hello,

 

I've been trying to use the  AutomationWrapper class for SalesForce for Twitter.  Here is the code I am using as a test of the doSearch method in the AutomationWrapper:

 

 global class TwitterScheduler {
    webService static void runTwitterSearch(){
        
        integer i=1;
        List<sf4twitter__Twitter_Search__c> tsearch = [SELECT Id, Name, sf4twitter__Twitter_Keyword_Search__c FROM sf4twitter__Twitter_Search__c];
        
        for(sf4twitter__Twitter_Search__c twitsearch: tsearch){
            while (i>0){
                i=AutomationWrapper.doSearch(twitsearch,i);
            }
        }
    }

}

 

When trying to save I get  "Save error: Method does not exist or incorrect signature: AutomationWrapper.doSearch(SOBJECT:sf4twitter__Twitter_Search__c, Integer)    WTL/src/classes    TwitterScheduler.cls    line 9    1259686413987    2942".

 

This is what I'm reading for this method:

 

"Get tweets from Twitter Searches
Integer doSearch(Twitter_Search__c, Integer)
Params:
Twitter_Search__c : Search Keyword to be searched for matches
Integer : Page number to be queried.
Returns:
Integer : Next page to be queried if any, or 0 if no more pages available."

 

Any thoughts on what I'm doing wrong?  Thanks,

Marc

Hello,

I'm hoping that someone can shed some light on this for me.  Is there a way to add a custom button that links to a URL to the right of the "New" button in Recent Cases? 

 

I already have a custom button and can add it to Case Layout, the Search Views, and all that but is there anywhere in SalesForce that allows you to edit the Recent Cases View and add a button.

 

To clarify, the Recent Cases View I am talking about is the view that pops up when you click the tab for Cases.

 

Please let me know.

 

Thank you,

Marc Petersen

Hello,

 

I am trying to setup a date time stamp at the top of an email template so it would look something like this:

 

Jul 15 2009 10:01AM

 

I have tried using the {!Now()} function in my email template but it comes out as GMT which is a few hours ahead of us here in CST.  

 

Could anyone tell me a better way to add today's date to the top of an email?  I've been all through the discussion boards and Technical Library and can't seem to find it.  If I missed an example or discription a link to that would be great too.

 

Thanks in advance,

Marc Petersen

Hello,  I have read that the reason I get this error is due to my SOQL query being in the FOR loop of the below trigger.  Could someone take a look at it and let me know how I could go about bulk safing this trigger.

 

trigger SetAccountField on Domains__c (before insert) {
    for (Domains__c domain : Trigger.new) {
        String cid = domain.Contact__c;
       
        List<Contact> contacts = [SELECT AccountId,
                                    MailingStreet,
                                    MailingState,
                                    MailingCity,
                                    MailingPostalCode,
                                    Company__c
                                    FROM Contact WHERE Id = :cid];
       
        if(contacts.size() > 0){
            domain.Account__c = contacts.get(0).AccountId;
            domain.Company__c = contacts.get(0).Company__c;
            if(contacts.get(0).MailingStreet != null){
                domain.House_Number__c = contacts.get(0).MailingStreet.substring(0,contacts.get(0).MailingStreet.indexOf(' '));
                    domain.Bill_To__c = contacts.get(0).MailingStreet.substring(contacts.get(0).MailingStreet.indexOf(' '));
            }       
            domain.City__c = contacts.get(0).MailingCity;
            domain.State_Province__c = contacts.get(0).MailingState;
            domain.Zipcode__c = contacts.get(0).MailingPostalCode;
        }
    }
 }

 

 

Any help is greatly appreciated.

 

Thanks,

Marc

 

 

Hello,

 

I am trying to call an Apex Class that will send an email from C#.  I don't know if I am missing something or trying to call the class incorrectly or what, but I receive an error saying I have "Invalid Session ID Illegal Session".  I have looked on the boards for this error and have found a number of responses for PHP, but I know nothing about that language so cannot figure out exactly what their solution is.

 

Here is my Apex Class:

 

 global class DomainNameRenewalEmails {
    
    webservice static void runFirstRenewalEmail(){
        
        for(Domains__c domains : [SELECT Name, Id, Contact__c FROM Domains__c WHERE Do_Not_Renew__c = False AND Domain_Expiration__c >= :StartDate AND Domain_Expiration__c < :EndDate]){
               
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            
            mail.setSenderDisplayName('Member Services');
               
               mail.setTargetObjectId(domains.Contact__c);
            mail.setWhatId(domains.Id);
            mail.setTemplateId('00X40000000y7KI');
            
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        }
    }

}

 

 

And here is my call to the class from c#:

 

 DomainRenewalEmailClasses.DomainNameRenewalEmailsService run = new DomainRenewalEmailClasses.DomainNameRenewalEmailsService();
                
                try
                {
                    run.runFirstRenewalEmail();
                }
                catch (SoapException e)
                {
                    Console.WriteLine("Error: " + e);
                }
               

 

As this is the first time I am attempting this it is entirely possible that I have missed something very obvious that I am not aware of.  Any help would be greatly appreciated.

 

Also,  I am using the login method that I copied from the startup guide:

 

 private bool login()
        {
            // Create a service object
            binding = new SforceService();

            // Timeout after a minute
            binding.Timeout = 60000;

            // Try logging in
            LoginResult lr;
            try
            {
                Console.WriteLine("LOGGING IN NOW...");
                //***********************************************
                //*******Add admin username and password*********
                //***********************************************
                lr = binding.login("marc.petersen@teamwheretolive.com.wtl", "Taco1999");
            }
            // ApiFault is a proxy stub generated from the WSDL contract when
            // the web service was imported
            catch (SoapException e)
            {
                // Write the fault code to the console
                Console.WriteLine(e.Code);

                // Write the fault message to the console
                Console.WriteLine("An unexpected error has occurred: " + e.Message);

                // Write the stack trace to the console
                Console.WriteLine(e.StackTrace);

                // Return False to indicate that the login was not successful
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
                return false;
            }

            // Check if the password has expired
            if (lr.passwordExpired)
            {
                Console.WriteLine("An error has occurred. Your password has expired.");
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
                return false;
            }

            /** Once the client application has logged in successfully, it will use
             * the results of the login call to reset the endpoint of the service
             * to the virtual server instance that is servicing your organization
             */
            binding.Url = lr.serverUrl;

            /** The sample client application now has an instance of the SforceService
             * that is pointing to the correct endpoint. Next, the sample client
             * application sets a persistent SOAP header (to be included on all
             * subsequent calls that are made with SforceService) that contains the
             * valid sessionId for our login credentials. To do this, the sample
             * client application creates a new SessionHeader object and persist it to
             * the SforceService. Add the session ID returned from the login to the
             * session header
             */
            binding.SessionHeaderValue = new sforce.SessionHeader();
            binding.SessionHeaderValue.sessionId = lr.sessionId;

            // Return true to indicate that we are logged in, pointed
            // at the right URL and have our security token in place.
            Console.WriteLine("SUCCESSFULLY LOGGED IN...");
            return true;
        }

 

Thanks in advance.

 

Marc

Hello,

 

I need a little help with a trigger I am working on.  I created a trigger that would send an email if the status on an object was changed to completed.  I am trying to get this email to show up in the Activity History.  Could someone explain a good way to do this?  I'm getting confused on how the email should be attached to this object.  

 

I'm thinking that Task.ID should somehow be connected with the the Domain__c.ID.  I'm just not sure how.

 

Any help would be greatly appreciated.

 

Thanks,

Marc

Hello,

I've recently started working with triggers and I seem to be having problems with custom objects.  I've tried this a few different ways, but I get either Invalid Type(what this is getting now) or Invalid sObject if I try to query SFDC_Bug_c.  

 

Any help you could give me would be greatly appreciated.

 

Thanks,

 

 

trigger SendToBug on Case (before update) {
   
    for(Case c : Trigger.new){
        if(c.Reason == 'Bug')   
            SDFC_Bug_c b = new SDFC_Bug_c(Status_c='Open', Priority_c='P3-Medium', Problem_Description_c = c.Description);
            insert b;
           
    }
}

Hello,

I've recently started working with triggers and I seem to be having problems with custom objects.  I've tried this a few different ways, but I get either Invalid Type(what this is getting now) or Invalid sObject if I try to query SFDC_Bug_c.  

 

Any help you could give me would be greatly appreciated.

 

Thanks,

 

 

trigger SendToBug on Case (before update) {
   
    for(Case c : Trigger.new){
        if(c.Reason == 'Bug')   
            SDFC_Bug_c b = new SDFC_Bug_c(Status_c='Open', Priority_c='P3-Medium', Problem_Description_c = c.Description);
            insert b;
           
    }
}

Hello,

 

I've been trying to use the  AutomationWrapper class for SalesForce for Twitter.  Here is the code I am using as a test of the doSearch method in the AutomationWrapper:

 

 global class TwitterScheduler {
    webService static void runTwitterSearch(){
        
        integer i=1;
        List<sf4twitter__Twitter_Search__c> tsearch = [SELECT Id, Name, sf4twitter__Twitter_Keyword_Search__c FROM sf4twitter__Twitter_Search__c];
        
        for(sf4twitter__Twitter_Search__c twitsearch: tsearch){
            while (i>0){
                i=AutomationWrapper.doSearch(twitsearch,i);
            }
        }
    }

}

 

When trying to save I get  "Save error: Method does not exist or incorrect signature: AutomationWrapper.doSearch(SOBJECT:sf4twitter__Twitter_Search__c, Integer)    WTL/src/classes    TwitterScheduler.cls    line 9    1259686413987    2942".

 

This is what I'm reading for this method:

 

"Get tweets from Twitter Searches
Integer doSearch(Twitter_Search__c, Integer)
Params:
Twitter_Search__c : Search Keyword to be searched for matches
Integer : Page number to be queried.
Returns:
Integer : Next page to be queried if any, or 0 if no more pages available."

 

Any thoughts on what I'm doing wrong?  Thanks,

Marc

Hello,

 

I am trying to setup a date time stamp at the top of an email template so it would look something like this:

 

Jul 15 2009 10:01AM

 

I have tried using the {!Now()} function in my email template but it comes out as GMT which is a few hours ahead of us here in CST.  

 

Could anyone tell me a better way to add today's date to the top of an email?  I've been all through the discussion boards and Technical Library and can't seem to find it.  If I missed an example or discription a link to that would be great too.

 

Thanks in advance,

Marc Petersen

Hello,  I have read that the reason I get this error is due to my SOQL query being in the FOR loop of the below trigger.  Could someone take a look at it and let me know how I could go about bulk safing this trigger.

 

trigger SetAccountField on Domains__c (before insert) {
    for (Domains__c domain : Trigger.new) {
        String cid = domain.Contact__c;
       
        List<Contact> contacts = [SELECT AccountId,
                                    MailingStreet,
                                    MailingState,
                                    MailingCity,
                                    MailingPostalCode,
                                    Company__c
                                    FROM Contact WHERE Id = :cid];
       
        if(contacts.size() > 0){
            domain.Account__c = contacts.get(0).AccountId;
            domain.Company__c = contacts.get(0).Company__c;
            if(contacts.get(0).MailingStreet != null){
                domain.House_Number__c = contacts.get(0).MailingStreet.substring(0,contacts.get(0).MailingStreet.indexOf(' '));
                    domain.Bill_To__c = contacts.get(0).MailingStreet.substring(contacts.get(0).MailingStreet.indexOf(' '));
            }       
            domain.City__c = contacts.get(0).MailingCity;
            domain.State_Province__c = contacts.get(0).MailingState;
            domain.Zipcode__c = contacts.get(0).MailingPostalCode;
        }
    }
 }

 

 

Any help is greatly appreciated.

 

Thanks,

Marc

 

 

Hello,

 

I am trying to call an Apex Class that will send an email from C#.  I don't know if I am missing something or trying to call the class incorrectly or what, but I receive an error saying I have "Invalid Session ID Illegal Session".  I have looked on the boards for this error and have found a number of responses for PHP, but I know nothing about that language so cannot figure out exactly what their solution is.

 

Here is my Apex Class:

 

 global class DomainNameRenewalEmails {
    
    webservice static void runFirstRenewalEmail(){
        
        for(Domains__c domains : [SELECT Name, Id, Contact__c FROM Domains__c WHERE Do_Not_Renew__c = False AND Domain_Expiration__c >= :StartDate AND Domain_Expiration__c < :EndDate]){
               
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            
            mail.setSenderDisplayName('Member Services');
               
               mail.setTargetObjectId(domains.Contact__c);
            mail.setWhatId(domains.Id);
            mail.setTemplateId('00X40000000y7KI');
            
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        }
    }

}

 

 

And here is my call to the class from c#:

 

 DomainRenewalEmailClasses.DomainNameRenewalEmailsService run = new DomainRenewalEmailClasses.DomainNameRenewalEmailsService();
                
                try
                {
                    run.runFirstRenewalEmail();
                }
                catch (SoapException e)
                {
                    Console.WriteLine("Error: " + e);
                }
               

 

As this is the first time I am attempting this it is entirely possible that I have missed something very obvious that I am not aware of.  Any help would be greatly appreciated.

 

Also,  I am using the login method that I copied from the startup guide:

 

 private bool login()
        {
            // Create a service object
            binding = new SforceService();

            // Timeout after a minute
            binding.Timeout = 60000;

            // Try logging in
            LoginResult lr;
            try
            {
                Console.WriteLine("LOGGING IN NOW...");
                //***********************************************
                //*******Add admin username and password*********
                //***********************************************
                lr = binding.login("marc.petersen@teamwheretolive.com.wtl", "Taco1999");
            }
            // ApiFault is a proxy stub generated from the WSDL contract when
            // the web service was imported
            catch (SoapException e)
            {
                // Write the fault code to the console
                Console.WriteLine(e.Code);

                // Write the fault message to the console
                Console.WriteLine("An unexpected error has occurred: " + e.Message);

                // Write the stack trace to the console
                Console.WriteLine(e.StackTrace);

                // Return False to indicate that the login was not successful
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
                return false;
            }

            // Check if the password has expired
            if (lr.passwordExpired)
            {
                Console.WriteLine("An error has occurred. Your password has expired.");
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
                return false;
            }

            /** Once the client application has logged in successfully, it will use
             * the results of the login call to reset the endpoint of the service
             * to the virtual server instance that is servicing your organization
             */
            binding.Url = lr.serverUrl;

            /** The sample client application now has an instance of the SforceService
             * that is pointing to the correct endpoint. Next, the sample client
             * application sets a persistent SOAP header (to be included on all
             * subsequent calls that are made with SforceService) that contains the
             * valid sessionId for our login credentials. To do this, the sample
             * client application creates a new SessionHeader object and persist it to
             * the SforceService. Add the session ID returned from the login to the
             * session header
             */
            binding.SessionHeaderValue = new sforce.SessionHeader();
            binding.SessionHeaderValue.sessionId = lr.sessionId;

            // Return true to indicate that we are logged in, pointed
            // at the right URL and have our security token in place.
            Console.WriteLine("SUCCESSFULLY LOGGED IN...");
            return true;
        }

 

Thanks in advance.

 

Marc

Hello,

I've recently started working with triggers and I seem to be having problems with custom objects.  I've tried this a few different ways, but I get either Invalid Type(what this is getting now) or Invalid sObject if I try to query SFDC_Bug_c.  

 

Any help you could give me would be greatly appreciated.

 

Thanks,

 

 

trigger SendToBug on Case (before update) {
   
    for(Case c : Trigger.new){
        if(c.Reason == 'Bug')   
            SDFC_Bug_c b = new SDFC_Bug_c(Status_c='Open', Priority_c='P3-Medium', Problem_Description_c = c.Description);
            insert b;
           
    }
}

Hello,

I've recently started working with triggers and I seem to be having problems with custom objects.  I've tried this a few different ways, but I get either Invalid Type(what this is getting now) or Invalid sObject if I try to query SFDC_Bug_c.  

 

Any help you could give me would be greatly appreciated.

 

Thanks,

 

 

trigger SendToBug on Case (before update) {
   
    for(Case c : Trigger.new){
        if(c.Reason == 'Bug')   
            SDFC_Bug_c b = new SDFC_Bug_c(Status_c='Open', Priority_c='P3-Medium', Problem_Description_c = c.Description);
            insert b;
           
    }
}

I have searched the boards looking for an answer, and can't quite find what I'm looking for.

We have a custom object called 'domains' which is simply a form listing off any domains that a user may have purchased through us.  Each contact is associated with an account, a company and an office.  In the cases section when we select a contact it auto-populates the account and office information.  In this new custom object it doesn't seem to grab the account or office info.

Tried creating a trigger to update these fields, but was not successful.  I'm a bit of a SalesForce n00b and would greatly appreciate any help in creating this function.  Basically, when we select a contact the contacts account and office information should auto populate those fields, either on save or when it is selected.

Help?

Thanks,

Benjamin Higginbotham