• LVS
  • NEWBIE
  • 110 Points
  • Member since 2011

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

Using 'Mass Email Lead' option for sending Email to particular Lead

 

Need help to track the click on the link (inside the email) by the Email receiver (only the count of Click on the link to be tracked)

 

 

Please Help

 

Warm Regards

 

Hi I have very critical issue anyone here to help me Pl..

 

How to check whether the email id  entered by user is containing Org's Domain or not ..?

 

hi

i have inserted a record like,

 

ApexPages.StandardController order;
    
    public next_order(ApexPages.StandardController controller)
    {
    order=controller;
    }
    public pagereference next_order()
    {
       
        order.save();

}
}

 

"now i want to get that newly inserted record id"

Since Winter 14, Service Providers can no longer be added via the Identity Provider page. We need to add them under Connected Apps.

 

However, till Summer 13, we could get the Idp Initiated URL from the Service Provider setting (http://login.salesforce.com/help/doc/en/identity_provider_examples.htm#sf_2_sf_example_testing). However, this is not visible after the move to using Connected Apps.

 

Where do I get it? The help document above has not been updated either.

 

~LVS

  • October 08, 2013
  • Like
  • 0

Hello all,

 

I'm using Eclipse Kepler (4.3) and have successfully installed the Force.com plugin. I could even create a project and see all the components. However, everytime I try to access a piece of code or the schema browser, I get an error saying my password is wrong.

 

I check on my org, and my login lists multiple failed logins for 'Invalid Password'. In my project properties on Eclipse, the password and sec token fields are empty - no matter how many times I enter it, it forgets.

 

If it can't remember, I expect it to atleast prompt me each time. Can something be done?

 

Thanks,

LVS

  • July 24, 2013
  • Like
  • 0

We have some Account records which are private. Users are creating Opportunity records via a VF page where the association with Account records happen automatically. This is our requirement and I don't want to go into detail here.

However, in certain cases, a private Account can get associated to the Opportunity record. This makes SF grant access to everyone/group having atleast read on the opportunity to have read on the private account.

The Sharing detail page shows 'Associated Record Owner or Sharing' as the reason which in API terms means ImplicitParent.

Is there a way to avoid this? I do not want people with access to the opportunity to have access to the private account as well

 

~LVS

  • February 08, 2013
  • Like
  • 0

We're getting an email notification to a set of users from the Case default user when there is a new email message reply from the customer for a case. The email carries a link to the email message.

 

We're not sure if this happens every time but we've had atleast one such case. Some other team was working on this so we don't know how this is happening. We've checked workflow email alerts, triggers, email templates but couldn't find anything.

 

What we do know is, that the email is being sent to a public group - from the list of users who received the email. Where else should we be looking to find the origin?

 

Edit: The email was sent to the public group because the queue owner was at that time a queue and the public group was added as a member of the queue.

 

~LVS

  • February 05, 2013
  • Like
  • 0

According to http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm :

Selective SOQL Query Criteria

  • A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. The performance of the SOQL query improves when two or more filters used in the WHERE clause meet the mentioned conditions.
  • The selectivity threshold is 10% of the records for the first million records and less than 5% of the records after the first million records, up to a maximum of 333,000 records. In some circumstances, for example with a query filter that is an indexed standard field, the threshold may be higher. Also, the selectivity threshold is subject to change.

 

In this, does the 'number of records' returned from the query respect the LIMIT statement? What I mean is, if I have a filter condition that matches 2,00,000 records but I have a LIMIT 50000 on the statement, is the number of records considered as 50,000 or 2,00,000?

 

Why question is born from the fact that the above statements mention query filter reducing the results and not LIMIT statements explicitly

  • October 16, 2012
  • Like
  • 0

I seem to be having an unique problem. For our development, we have a sandbox called Dev and another sandbox Model for UAT before we go on to Production.

 

I just moved a bunch of pages, controllers, classes, triggers + test class for all functionality covered in these from Dev to Model. The test class was successful when run individually in Dev. The deployment to Model was successful. The test class is in ver 25.0 in Dev and Model and has @SeeAllData explicitly set to false

 

However, when I run the test class individually in Model, it fails. It seems a few User records were not returned which is why the test failed. When I ran the piece of code querying and using a bunch of users through Developer Console, it returned the expected rows. Baffling!

 

I've double checked the usually overlooked items like checking against a wrong Org or missing a WHERE claus etc. Any ideas why I might be facing this issue? My Dev Org is in Summer 12 and Model in Winter 13. But I fail to see why that might be a problem!


Thanks in advance.

 

~LVS

  • October 10, 2012
  • Like
  • 0

For all users of a particular profile, when they login they should be taken to a visualforce page instead of the standard home page. I can differentiate the user based on profile in the controller if I'm able to redirect ALL users to the visualforce page.

 

Any ideas?

 

Thanks in advance.

 

~LVS

  • August 03, 2012
  • Like
  • 0

We have a before insert/update trigger on the Standard Account object which populates a custom field External_ID__c. This field has the Unique (case in-sensitive) and External ID options enabled

The trigger takes the Account LastName (Standard), SSID__c (custom text field), Producer__c (custom text) fields and concatenates them into External_ID__c as follows:

acc.External_ID__c = acc.Producer_ID__c + acc.LastName + acc.SSID__c;

The LastName field will almost always have Korean characters.

We have a record with following values:

Producer__c = SC0022999
SSIC__c = 1752110
LastName = 교촌에프앤비㈜

While trying to insert the below record, Salesforce.com threw an error saying the External_ID__c calculated is not unique:

Producer__c = SC0022999
SSIC__c = 1752110
LastName = 교촌에프앤비(주)

Notice the last character in the existing record: is different from the one we're trying to insert: () ==> Korean character within parentheses. Arguably, the combination represent the same meaning (or whatever) in Korean. However, they are essentially different characters and hence should not be treated as unique. Or should it? We looked at the Debug logs for that particular field and found nothing bizarre.

While we're glad that Salesforce.com thought they are the same characters, we're kind of confused if this kind of comparison is correct - where there seems to be some translation involved? Another confusing aspect is that, all of the below returned false

String a = 'SC0022999교촌에프앤비㈜1752110';
String b = 'SC0022999교촌에프앤비(주)1752110';
System.debug(a==b);
System.debug(a.equals(b));
System.debug(a.equalsIgnoreCase(b));
  • May 11, 2012
  • Like
  • 0
According to (www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_upsert.htm, see Rules and Guidelines section), the upsert operation supports use of External IDs in reference fields. That is,

I'm inserting an Opportunity and I need to specify the related Account. However, I have only the External Id value of Account. Usually, I would query the Accout's Id, the use it to insert a new Opportunity but the Salesforce API lets you skip this step - (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert.htm)

However, I'm curious to know how this can be done via Apex code - the URL above talks about the Web Services API which is in Java or other environment code.

Has anyone been able to do that?

 

  • May 10, 2012
  • Like
  • 0

Below is Salesforce's documentation on the order of execution on save of a record : validations, triggers and so on.

 

Order of Execution


The note under pt.11 says, "The before and after triggers fire one more time only if something needs to be updated. If the fields have already been set to a value, the triggers are not fired again".

I find the second statement "If the fields have already been set to a value, the triggers are not fired again" confusing. How does the system know that a field has already been set to a value? If they mean "no field updates on that object", doesn't it make the sentence redundant?

Am I missing something here?

  • February 03, 2012
  • Like
  • 0

I have a workflow outbound message on a Case which is sending out some fields to a configured end point.

I do not have access to the configured end point and cannot check what goes on behind it (atleast its a very slow process to find out)

 

At this point, I have an unmanaged package which includes among other things, the above described outbound message and the remote site settings. Also, I have different instances of the 3rd party end point - lets call them A, B and C.

 

A is being used with an EE sandbox

B is being used with a DE which has every component of the package replicated (I moved it over Eclipse+some manually). This org also has a namespace prefix

 

The outbound message works as expected (thirdparty yes, but I can see verifyable results easily) with A but with B, am getting the following error: "org.xml.sax.SAXParseException: Premature end of file."

 

Do you think the Namespace prefix could be the reason? I also tried out the unmanaged package on another DE and with instance C, but still couldn't get it to work. So am not too sure if its the namespace prefix.

 

Thanks in advance.

 

~LVS

  • September 16, 2011
  • Like
  • 0

I'm new to Apex; though not to programming as such.

 

I have run into a situation where 2 AJAX requests to a controller method (action function) are running simulataneously and their flow of control depends on a shared variable (class level instance variable). Am facing a classic Race Condition - value set by one is not read by another.

 

Is there a way I can put a lock or mutex on a variable to make sure this doesn't happen?

 

Thanks in advance!

  • July 26, 2011
  • Like
  • 0

Since Winter 14, Service Providers can no longer be added via the Identity Provider page. We need to add them under Connected Apps.

 

However, till Summer 13, we could get the Idp Initiated URL from the Service Provider setting (http://login.salesforce.com/help/doc/en/identity_provider_examples.htm#sf_2_sf_example_testing). However, this is not visible after the move to using Connected Apps.

 

Where do I get it? The help document above has not been updated either.

 

~LVS

  • October 08, 2013
  • Like
  • 0

A customer would like to expose a single custom Visualforce page built on a Site in an iframe on their own website. To access the data they wish to expose requires the end User to be an authenticated Portal user.

 

They would like to have the log in component be a part of the parent frame which is supported by ASP.NET and C#. They do NOT want to log in inside the iframe.

 

I understand how the SOAP call goes out to the SFDC login server and gets the endpoint and sessionId with the Portal Users credentials.

 

My question is in two parts:

 

1. How to construct the src attribute of the iframe tag in the parent frame. My guess is something like this:

 

http://companyName.na#.force.com/apex/pageName?sid=mySessionVar

 

2. Is using the SessionID exposing my customer to any uneccessary security risks?

I am querying a list of attachmens and displaying the list below the file upload section of the page. 

In the list I want a URL to view the file in a new window. (The built in RelatedList does not perform the same).

On the controller I attempt to get the URL with :

@RemoteAction
global static String getFileURL(String id){
try {
                   fileURL = URL.getFileFieldURL( id ,'AttachmentBody');
                   return fileURL;
}catch(Exception ex){
                   fileURL = ex.getMessage();
                   return fileURL;
}

}

The call to URL.getFileFieldURL fails with an Invalid Parameter value for the fieldName - this is exactly as per the documentation code

Any ideas would be helpful

thanks

Joe

 

  • August 12, 2013
  • Like
  • 0

Hello all,

 

I'm using Eclipse Kepler (4.3) and have successfully installed the Force.com plugin. I could even create a project and see all the components. However, everytime I try to access a piece of code or the schema browser, I get an error saying my password is wrong.

 

I check on my org, and my login lists multiple failed logins for 'Invalid Password'. In my project properties on Eclipse, the password and sec token fields are empty - no matter how many times I enter it, it forgets.

 

If it can't remember, I expect it to atleast prompt me each time. Can something be done?

 

Thanks,

LVS

  • July 24, 2013
  • Like
  • 0

We have some Account records which are private. Users are creating Opportunity records via a VF page where the association with Account records happen automatically. This is our requirement and I don't want to go into detail here.

However, in certain cases, a private Account can get associated to the Opportunity record. This makes SF grant access to everyone/group having atleast read on the opportunity to have read on the private account.

The Sharing detail page shows 'Associated Record Owner or Sharing' as the reason which in API terms means ImplicitParent.

Is there a way to avoid this? I do not want people with access to the opportunity to have access to the private account as well

 

~LVS

  • February 08, 2013
  • Like
  • 0

Hello,


I have created one web-to-lead form in salesforce account.Now i am integrating that form with my website.As user get registered, its data will also be inserted in Salesfoece Lead form and in my website database..now can I pass a variable or an array with the salesfoce action url "https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" in web-to-lead form salesfoece,and can I get that variable or array back when at the time of returning to my website means when it redirect from salesforce to my website using returnurl ??..

 

Thanks..

We're getting an email notification to a set of users from the Case default user when there is a new email message reply from the customer for a case. The email carries a link to the email message.

 

We're not sure if this happens every time but we've had atleast one such case. Some other team was working on this so we don't know how this is happening. We've checked workflow email alerts, triggers, email templates but couldn't find anything.

 

What we do know is, that the email is being sent to a public group - from the list of users who received the email. Where else should we be looking to find the origin?

 

Edit: The email was sent to the public group because the queue owner was at that time a queue and the public group was added as a member of the queue.

 

~LVS

  • February 05, 2013
  • Like
  • 0

We are using the Databasedotcom Ruby gem (essentially a REST wrapper) to authenticate to salesforce. The OAuth dance is randomly failing (1 out of 25 attempts) with the following message: 

 

client identifier invalid

 

The code is almost boilerplace code for authentication:

 

def self.authenticate(username, password)
  config = YAML.load_file(File.join(::Rails.root, 'config', 'databasedotcom.yml'))
  client = Databasedotcom::Client.new(config)
  begin
    access_token = client.authenticate :username => username, :password => password
    {:success => 'true', :message => 'Successful sfdc login.', :access_token => access_token}
  rescue Exception => exc
    {:success => 'false', :message => exc.message}
  end
end

 

Any ideas what could be causing it to fail randomly?

 

Thanks

 

Jeff Douglas

Appirio & CloudSpokes

http://blog.jeffdouglas.com

 

 

Using 'Mass Email Lead' option for sending Email to particular Lead

 

Need help to track the click on the link (inside the email) by the Email receiver (only the count of Click on the link to be tracked)

 

 

Please Help

 

Warm Regards

 

We have a need to capture all emails into comments so that when a customer logs in to their portal, all the information is in the same section.  We are trying not to purchase email2case premium, which I know will do the trick.  We have coded our own trigger to do this, but the problem is it captures the whole email.  I'm not quite sure how to code it to capture only the new text from the email and not all the subsequent replies.

trigger AfterEmailMessage on EmailMessage bulk (after insert) {
  List <CaseComment> commentsToInsert = new List <CaseComment>();
  Map <String,Case> cases = new Map<String,Case>();
  List<String> casesIds = new List<String>();
  
  public final Id recordTypeId = [Select id from RecordType where name =: 'Internal'].id;
  
  for (EmailMessage em : Trigger.new){
    casesIds.add(em.parentId);
  }
  
  for(Case c : [Select id,RecordTypeId from Case where id in :casesIds]){
    cases.put(c.id,c);
  }
  
  for (EmailMessage em : Trigger.new){
    if (cases.get(em.parentId).recordTypeId == recordTypeId){
      CaseComment cc = new CaseComment();
      cc.CommentBody = em.TextBody;
      cc.IsPublished = true;
      cc.ParentId = em.parentId;
      commentsToInsert.add(cc);
    }
  }
  
  insert commentsToInsert;
  
}

 Any suggestions would be greatly appreciated.  Thanks.

  • August 30, 2012
  • Like
  • 0
According to (www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_upsert.htm, see Rules and Guidelines section), the upsert operation supports use of External IDs in reference fields. That is,

I'm inserting an Opportunity and I need to specify the related Account. However, I have only the External Id value of Account. Usually, I would query the Accout's Id, the use it to insert a new Opportunity but the Salesforce API lets you skip this step - (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert.htm)

However, I'm curious to know how this can be done via Apex code - the URL above talks about the Web Services API which is in Java or other environment code.

Has anyone been able to do that?

 

  • May 10, 2012
  • Like
  • 0

How can I generate a report involving similar fields of two independent custom objects in salesforce?

 

Can anyone tell me the solution of this please?

  • March 18, 2010
  • Like
  • 0

 

I have a Web Service that is expecting it as a part of SOAP header. How do I send it?

 

 


<soapenv:Header>

<wsse:Security

xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-

secext-1.0.xsd">

<wsse:UsernameToken>

<wsse:Username>username</wsse:Username>

<wsse:Password>password</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soapenv:Header>
<soapenv:Body>
<actual callout method here>
</soapenv:Body>

 

 

The only documentation I see is for inputHttpHeaders_x which can send http header and can send username password as part of 'Authorization' Header.

 

 

 

 

 

Message Edited by GoForceGo on 07-14-2009 05:03 PM
Message Edited by GoForceGo on 07-14-2009 05:03 PM
Message Edited by GoForceGo on 07-14-2009 05:05 PM

Some quick background on merges and Apex triggers:

When a User merges Leads or Contacts, the merge losers are deleted and the
merge winners are updated with the fields chosen by the User in the merge UI.

The only way to detect a merge in Apex triggers is to trigger "after delete" on
the loser records and check them for the "MasterRecordId" field.  If present,
the record being deleted is a merge loser, and the "MasterRecordId" points to
the merge winner.

(this is all covered in the docs )

As stated in the docs, the losers are deleted before the merge winner is
updated with the fields chosen by the User in the UI.

So, let's say that I merge two Leads: Lead A ("a@test.com") and Lead B
("b@test.com").  In the UI I choose Lead A as the master record (winner), but
in the "decide between conflicting fields" UI I choose "b@test.com" as the
Email address to use for the winner.

Two DML ops happen:

 

DELETE loser (via merge)
Trigger.old = { LastName = "B", Email = "b@test.com" }

UPDATE winner (via merge)
Trigger.old = { LastName = "A", Email = "a@test.com" }
Trigger.new = { LastName = "A", Email = "b@test.com" }


However, if we update the winner during the loser delete trigger (the only time
we can detect a merge, remember) ... then something buggy happens.

Our application does exactly this, by detecting merges and copying the loser's

Email address into a custom "OtherEmails" field of the winner.  (this isn't just
arbitrary, there's a good reason for it).


So, during the "DELETE loser" trigger, we update the winner like so:

DELETE loser (via merge)
Trigger.old = { LastName = "B", Email = "b@test.com" }
{
// our custom trigger code
Lead winner = [select Id, Email, OtherEmails from Lead where Id = '<winnerId>']
winner.OtherEmails += loser.Email
update winner;
// this update of course fires triggers too, which would look like this:
UPDATE winner (via standard update)
Trigger.old = { LastName = "A", Email = "a@test.com", OtherEmails = null }
Trigger.new = { LastName = "A", Email = "a@test.com", OtherEmails = "b@test.com" }
}

 

The bug happens in the merge-driven winner update, where SFDC should be
applying the fields chosen by the User during conflict resolution.

The fields chosen by the User are simply gone.  They never get updated into the
winner.  Instead, an update fires that looks like this:

UPDATE winner (via merge)
Trigger.old = { LastName = "A", Email = "a@test.com", OtherEmails = null }
Trigger.new = { LastName = "A", Email = "a@test.com", OtherEmails = "b@test.com" }

 
The User's choice of "Email = b@test.com" is simply gone ... instead this
merge-driven update is a duplicate of the update that happen in the loser's
delete trigger.


What do I expect to happen?

This is a tricky situation, hence the title of this post.  With the present
order of operations - with the loser delete happening before the winner update,
and with the merge only being detectable in the loser delete, I can't think of
any good way to resolve conflicts between trigger-driven winner updates and the
user-selected winner updates.  A couple other changes may fix the issue:

1.  Update the winner before deleting the loser.

This way, custom merge logic (in loser-delete triggers) would be working with a
Winner that's already been updated with the User-selected fields.

Of course, this is a breaking change for implementations that rely on the
current behavior (though I don't see how they could), and there are probably
good reasons for the current order of operations that I can't think of but
which are obvious to SFDC's devs.

2.  Provide an actual "after merge" trigger that provides the losers & winners at the same time.

This "after merge" trigger would be just like an "after update" trigger (ie,
Trigger.old/new contain the pre- and post-update state of the Winners), plus a
new contact variable Trigger.mergeLosers that contains what you would expect.

 

 

 

Salesforce support - i have created case 05650893 to track this issue.

  • June 21, 2011
  • Like
  • 1