• JD2010
  • NEWBIE
  • 55 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 33
    Replies

In Opportunities, I have a required custom user lookup field called Sales Representative.  I currently have a bunch of cumbersome workflow rules set up to send email as the Sales Representative specified in that lookup field. (I created org-wide email addresses for the Sales Reps).  The sales assistant almost always creates the opportunities for the sales reps.  What makes the workflows so cumbersome is that each sales assistant has multiple sales people assigned to them so I have to ake multiple workflow rules for each sales assistant.

 

I would like to create a trigger that will simply send out an email as the sales rep who is specified in the Sales Representative lookup field.  Is this possible?  If so, please expound on how to go about it.  I've been working on it with a developer here, but we have not been able to figure out how to send email AS someone else if that someone else will be different every time.

 

Please help!  Thanks!

i am just a beginner on salesforce....

i have created a sample custom object which has fields of name and contact...

i have created the visual force page for the same...

i want to create an apex page to save the data using SOQL queires.

All the examples that i am getting is for standard objects...

Can i get some data for custom objects also.....

Wanted to get some insight from some of the great developers on the forum here regarding an architecting challenge we're coming against. Basically, we have an app that interacts with a system other than ours based on a set of credentials (which we provide). What we want to do is, instead of having the customer installing the app have to mess with the credentials (particularly when the password gets updated), we want their configuration with their app installation to auto-update to our configuration -- effectively centralizing the configuration (and pushing updates to the customer orgs every so often). Reason for this is we don't want to add the additional load time and api call outs to our org for the config data every time something might run.

 

Does anyone have any ideas on the best way to do that, or corrections on our current logic? I was thinking of potentially doing some sort of SOAP call to our master salesforce org, but not sure if that's particularly efficient, either.

 

Thanks for your time!

  • October 18, 2011
  • Like
  • 0

Currently examining an update that we want to make to our system where daily, our system checks the date of particular items, and if they're past the current date, an action is ran. I've been looking into batch apex and some other features of SF trying to determine what may be the best route for this, and was curious as to whether batch apex would be the best route for this? Can anyone shine some possible light on what the best instances are to use batch apex?

 

Thanks!

So here's the thing, I realize that salesforce does not support the running of getContentAsPDF from a trigger -- which consiquently, is a royal pain. That said, I decided to embark on a journey to accomplish the task anyway. I've gone a bit into it, and had some success, but wanted to share with some other apex coders that are more versed than I the result, hoping to see if anyone can lend some extra ideas/insight to accomplish this.

 

Thus far, I've been able to actually run the getcontentasPDF as the reslt of a trigger, however, I've been stonewalled in that the returned document is blank (it's a PDF with nothing in it). I've tried it two different ways, and have gotten the same result (blank PDF). So my question is, any ideas on how to make it so the returned PDF is not blank (when you view the VF page normally, it shows properly) or am I stuck?

 

The two ways I am able to run getContentAsPDF:

 

1) When the trigger runs, I have a class that has a function that runs the getContentAsPDF function as a @future method. This works but has the issue of returning a blank pdf.

 

2) Thinking that was their systems way of blocking it, I decided to do a more convoluted and tricky route. The second method is from the trigger I call a visualforce page that has an autorun function that calls getContentAsPDF. This also works successfully, but again, the returned PDF is blank.

 

Any one have any ideas as to why the PDF may be turning up blank?

 

Thanks for any input!

Been looking at adding some additional functionality, but it goes a bit beyond what SF offers with their various "Team" functions. I've looked around but haven't seen anything about it in particular, but is it possible to create your own recipient type, much like the "Case Team" or "Sales Team" or that sort of thing?

Looking for an experienced VF/Apex developer for a quick turn around project, and if things go well, more projects after that.

 

Experience with Customer Portal is a big plus, and preferrably located in either Atlanta or North Carolina. Must have examples of past salesforce work.

 

Contact: nathan.snell@liveoakbank.com

  • March 28, 2011
  • Like
  • 0

Have a bit of a tricky situation I am trying to figure out here. It's broken really into 3 parts:

1) We want our salesforce users to be able to share any Opportunities or Accounts with any of our partner users

2) We only want our partner users to be able to see the Opportunities or Accounts that our users specify. 

4) The tricky part is that the users who are doing the sharing of the Accounts and Opportunities are not the original owners of those objects. Using Sharing Rules, we allow them to see all Accounts and Opportunities (with read/write access)

5) Based on #4, I cannot figure out how to allow those users to be able to re-share (as it were) Accounts or Opportunities without setting their profile to "Modify All" which we do not want, since we don't want them to be able to delete Accounts or Opportunities

Any ideas?

  • March 21, 2011
  • Like
  • 0

For you experts out there who have done a bunch with the webservices, I am curious. Is it possible for users to create their own, custom web service API methods in the Force.com platform utilizing Apex? For example, a webservices call is sent to the server, such as GetDate, which is an apex defined function (or perhaps a class) that returns, for example, a date? If so, where have I missed the information regarding it in the documentation (or perhaps on the forums)? I've looked around to no avail thus far.

 

Thanks!

  • March 03, 2011
  • Like
  • 0

I'm trying to do something I think is relatively simple. I am basically monitoring the insersts on a Task object. If one of the subjects of those inserts meets a certain criteria, I want to update the Comments field (Description) and have the new comments area inserted along with the rest of the Task information.

 

Been racking my brain on this, searched across the board and all but still haven't had much luck. If you have any insight, it's much appreciated!

 

The code below is runs without issue, I have a unit test and that's fine. Even when I throw in debugs in there, everything executes as it should. But still, the field never shows up updated.

 

 

trigger task_StoreMassEmailBody_upd on Task (before insert) {
	if(Trigger.isBefore) {
		for(Task t : Trigger.new) {
		    Boolean LogBody = Trigger.new[0].Subject.contains('special subject');
			if(LogBody) { t.Description = 'Win'; }
		}
	}
}

 What am I missing here? I've also tried it with an after update, and create a set of all the trigger.new ID's related to the task, and then iterate through those and do an update after (since, iirc, after insert the fields are ready only) but still no luck.

 

 

Thanks in advance!

  • February 16, 2011
  • Like
  • 0

I wrote a trigger to find the largest amount value for all Opportunities under a particular Account and then update a custom field on Account with the name of the Opportunity.  It works fine with single records but as you can see it doesn't take bulk processing into account and fails because it calls too many SOQL queries.

 

I've tried putting the queries into maps but I generally end up with null values.  If someone could point me in the right direction, I think I could figure it out, but I'm kind of stuck right now.

 

Thanks

 

trigger UpdateLoanName on Opportunity (before update) {
  for (Opportunity opp : Trigger.new){
    if(opp.AccountId != null){
      Opportunity oppname = [SELECT name, amount FROM Opportunity WHERE accountid = :opp.AccountId ORDER BY amount DESC LIMIT 1];
      Account acc = [SELECT loan_name__c FROM Account WHERE id = :opp.AccountId];
      acc.loan_name__c = oppname.name;
      if(acc.loan_name__c != null){
        update acc;  
      }
    }
  }
}
  • December 17, 2010
  • Like
  • 0

Currently examining an update that we want to make to our system where daily, our system checks the date of particular items, and if they're past the current date, an action is ran. I've been looking into batch apex and some other features of SF trying to determine what may be the best route for this, and was curious as to whether batch apex would be the best route for this? Can anyone shine some possible light on what the best instances are to use batch apex?

 

Thanks!

Hey Guys,

 

I have configured sites to use our Customer Portal.

 

We want to use the custom siteLogin VF page. is it possible to use that login page only and have ti send the users to our standard customer portal after login? Or are the sessions not compatible?

Hi,

 

I am trying to setup the Customer Portal user authentication using Force.com sites. I followed the steps that are provided to do this setup and there were no hitches in it. I also setup the default Site Login page and tried to login, when I provide correct customer portal user details and click on submit the sites login page just refreshes and does nothing, when I provide incorrect details to login it throws proper error messages.

I need help in completing the authentication process and redirecting the customers towards their home page.

 

Thanks

KD

Can salesforce partner wsdl be used to make API calls from one org to other?

Hiiiiii......

I am new in salesforce.com & I want one simple example which contain link between VFPage, Controller & Bean Class....

So please can you give me that....

Even though I went through the reference copy but I am nt getting any example...

I also got familiar with the fact of Test class too so nothing worry abt that & just need one example to start my skill here...

Please give me any example which is based on MVC architecture here...

So here's the thing, I realize that salesforce does not support the running of getContentAsPDF from a trigger -- which consiquently, is a royal pain. That said, I decided to embark on a journey to accomplish the task anyway. I've gone a bit into it, and had some success, but wanted to share with some other apex coders that are more versed than I the result, hoping to see if anyone can lend some extra ideas/insight to accomplish this.

 

Thus far, I've been able to actually run the getcontentasPDF as the reslt of a trigger, however, I've been stonewalled in that the returned document is blank (it's a PDF with nothing in it). I've tried it two different ways, and have gotten the same result (blank PDF). So my question is, any ideas on how to make it so the returned PDF is not blank (when you view the VF page normally, it shows properly) or am I stuck?

 

The two ways I am able to run getContentAsPDF:

 

1) When the trigger runs, I have a class that has a function that runs the getContentAsPDF function as a @future method. This works but has the issue of returning a blank pdf.

 

2) Thinking that was their systems way of blocking it, I decided to do a more convoluted and tricky route. The second method is from the trigger I call a visualforce page that has an autorun function that calls getContentAsPDF. This also works successfully, but again, the returned PDF is blank.

 

Any one have any ideas as to why the PDF may be turning up blank?

 

Thanks for any input!

In Opportunities, I have a required custom user lookup field called Sales Representative.  I currently have a bunch of cumbersome workflow rules set up to send email as the Sales Representative specified in that lookup field. (I created org-wide email addresses for the Sales Reps).  The sales assistant almost always creates the opportunities for the sales reps.  What makes the workflows so cumbersome is that each sales assistant has multiple sales people assigned to them so I have to ake multiple workflow rules for each sales assistant.

 

I would like to create a trigger that will simply send out an email as the sales rep who is specified in the Sales Representative lookup field.  Is this possible?  If so, please expound on how to go about it.  I've been working on it with a developer here, but we have not been able to figure out how to send email AS someone else if that someone else will be different every time.

 

Please help!  Thanks!

Hi,

I have a XML file that should post to a URL from sfdc.

For these, can any one help with the process. 

 

Thanks

  • May 26, 2011
  • Like
  • 0

i am just a beginner on salesforce....

i have created a sample custom object which has fields of name and contact...

i have created the visual force page for the same...

i want to create an apex page to save the data using SOQL queires.

All the examples that i am getting is for standard objects...

Can i get some data for custom objects also.....

I want to compose an email body in Apex code and include a link in it.  The link can be "/" plus the ID of the object but the URL needs to be construction relative to the current instance.  I can't code "http://na2.salesforce.com/..." as it might not work.  Also, it should work with the proper URL for each sandbox.

 

Anyone know a way in Apex to get the root URL for the current environment?

 

I don't think VF email templates will work in my case.

Hi All,

 

I have a requirement where I have to hide a custom field (comments) on a custom object when an owner manually shares his record with others. Though this field will be visible when user is creating/editing a new record. Is it possible to do this without using VF or apex?

 

Thanks.

For you experts out there who have done a bunch with the webservices, I am curious. Is it possible for users to create their own, custom web service API methods in the Force.com platform utilizing Apex? For example, a webservices call is sent to the server, such as GetDate, which is an apex defined function (or perhaps a class) that returns, for example, a date? If so, where have I missed the information regarding it in the documentation (or perhaps on the forums)? I've looked around to no avail thus far.

 

Thanks!

  • March 03, 2011
  • Like
  • 0

I'm trying to do something I think is relatively simple. I am basically monitoring the insersts on a Task object. If one of the subjects of those inserts meets a certain criteria, I want to update the Comments field (Description) and have the new comments area inserted along with the rest of the Task information.

 

Been racking my brain on this, searched across the board and all but still haven't had much luck. If you have any insight, it's much appreciated!

 

The code below is runs without issue, I have a unit test and that's fine. Even when I throw in debugs in there, everything executes as it should. But still, the field never shows up updated.

 

 

trigger task_StoreMassEmailBody_upd on Task (before insert) {
	if(Trigger.isBefore) {
		for(Task t : Trigger.new) {
		    Boolean LogBody = Trigger.new[0].Subject.contains('special subject');
			if(LogBody) { t.Description = 'Win'; }
		}
	}
}

 What am I missing here? I've also tried it with an after update, and create a set of all the trigger.new ID's related to the task, and then iterate through those and do an update after (since, iirc, after insert the fields are ready only) but still no luck.

 

 

Thanks in advance!

  • February 16, 2011
  • Like
  • 0