• Always Thinkin
  • NEWBIE
  • 445 Points
  • Member since 2006
  • Sr. Salesforce Developer
  • 2U.com


  • Chatter
    Feed
  • 14
    Best Answers
  • 5
    Likes Received
  • 1
    Likes Given
  • 37
    Questions
  • 205
    Replies
Hi all!

I need some help to automate account owner transfer from "salesman" user to "coldcaller" user for leads that stay in 'Attempted Contact' status for over 20 days. "Coldcaller" user must be notified by email of account owner transfer.

I talked to salesforce support but they said this can only be done by Apex Trigger. Is there anyone who already have something like this in place?

Thanks!!!
Sarah
How does Trailhead verify the completion of the Challenge?
I've created a trigger on a Task to update a custom Opportunity field (Last_Contact_Date__c). The field gets updated based on the most recent task Activity Date. The trigger is seen below and works as desired: 
trigger UpdateOppLastContactDate on Task (after insert, after update) {
  
  Set<String> whatIDs = new Set<String>();
  
    for (Task t : Trigger.new) {
      whatIDs.add(t.whatID);
  }
  
     List<Opportunity> opps = [SELECT Id, Last_Contact_Date__c FROM Opportunity WHERE Id =: whatIDs];
    
     Map<String, Task> taskMap = new Map<String, Task>();
  
    for (Task t : Trigger.new){
      if (!(t.Type.equals('Eloqua Activity'))) {
        if (t.Status.equals('Completed')) {
          taskMap.put(t.whatID, t);
        }
      }
      
  }
         
    for (Opportunity o : opps) {
      if (taskMap.containsKey(o.Id)) {
        o.Last_Contact_Date__c = taskMap.get(o.Id).ActivityDate;
      }
  }
  update opps;
}

However, then I tried to modify this trigger to also update a custom Accounts variable (In_Touch_Date__c) but I cannot get it to function properly. 

Here is the modified code: 

trigger UpdateOppLastContactDate on Task (after insert, after update) {
	
	Set<String> whatIDs = new Set<String>();
	
    for (Task t : Trigger.new) {
  		whatIDs.add(t.whatID);
	}
	
   	List<Opportunity> opps = [SELECT Id, Last_Contact_Date__c FROM Opportunity WHERE Id =: whatIDs];
   	
   	Map<Id, Account> accts = new Map<Id, Account>();
   	   
   	Map<String, Task> taskMap = new Map<String, Task>();

    for (Task t : Trigger.new){
    	if (!(t.Type.equals('Eloqua Activity'))) {
    		if (t.Status.equals('Completed')) {
    			taskMap.put(t.whatID, t);
    		}
    	}
  		
	}
    
    for (Opportunity o : opps) {
  		if (taskMap.containsKey(o.Id)) {
    		o.Last_Contact_Date__c = taskMap.get(o.Id).ActivityDate;
    		Account a = accts.get(o.AccountId);
    		if (a.In_Touch_Date__c != null) {
    			if (taskMap.get(o.Id).ActivityDate.daysBetween(a.In_Touch_Date__c) < 0) {
    				a.In_Touch_Date__c = taskMap.get(o.Id).ActivityDate;
    			}
    		}
  		}
	}
	update opps;
}
I've bolded the updated code, any advice on why this doesn't work is much apprecaited. 
  • July 28, 2014
  • Like
  • 0
We have been having trouble downloading and opening apps from the Salesforce AppExchange on our system. For example, we go to the AppExchange, click Get It Now, go through the steps for installing an app, receive an email saying it has been installed but needs to go through some more steps to be successfully deployed, and when we go to the Deployment tab in Setup see that each app is failing to deploy successfully by failing on the Run APEX tests step. The error messages are pointing to problems between APEX coding and our Opportunity triggers. It says that there is Code Coverage Failure, and that our Opportunity trigger has 0% code coverage when it needs at least 1%. Example of a specific error message:

System.AssertException: Assertion Failed: Pre deploy test failed, This may be because of custom validation rules in your Org. You can check ignore apex errors or temporarily deactivate your validation rules for Opportunitys and try again.
Stack Trace: Class.ActionPlansTestUtilities.createNewOpportunity: line 260, column 1 Class.ActionPlanCreationController.checkReferedObject: line 918, column 1

Can anyone help us with this issue?

I am more or less happy with the Account page layout I created through the page layout editor (Setup >> Customize >> Accounts >> Page Layout) - however, I'd like to either insert a Visualforce page inline with that layout, or Clone that page layout into a fresh Visualforce page I can edit. Is there any way to do this without writing the entire visualforce markup for that page layout from scratch?

  • November 16, 2010
  • Like
  • 0

Hi Guys i have a validation rule on Account

AND(
ISCHANGED( Name ),
 $Profile.Name  <>  "system administrator"
)

 

Iam a system Admin and i created a new account, and when i tried to edit the Name, it's throwing up the error,actually according to this validation rule, ISCHANGED( Name ) is true and $Profile.Name  <>  "system administrator is false, so result would be false since there is AND operation, so the validation rule should not be fired, but i don't knw why it's getting fired for me being as system Admin.

 

Any help guyss.....................................

Hello all,

 

Beginner Apex developer here again. Nearly complete with a project and now I need to write a class that I can run monthly with new apex  scheduler.

 

All it needs to do is take data from records in a custom object (all records) and create new records in a second custom object with all that data.

 

Custom Object 1 = Updates of MTD live data from our phone system for each sales rep.

Custom Object 2 = Month end snapshots for historical tracking puposes.

 

I'm sure there is an easy way to do this, but with my limited knowledge I'm not sure where to start. If some kindly developer could point me in the right direction, I'm sure I can put the pieces together.

Hey Guys,

 

Trying  to get my head around apex triggers, would appreciate some help:

 

To create a specific product after opportunity is created, but I can't get the id.

 

My Code:

 

 

trigger AddProduct on Opportunity (after insert) { OpportunityLineItem bLineItem = new OpportunityLineItem(); bLineItem.quantity = 1; bLineItem.UnitPrice = 100.00; bLineItem.Opportunityid = ???????????; bLineItem.pricebookentryid = '01uT0000000vtvnIAA'; Insert bLineItem;}

 

I want to insert the ID from a newly created opportunity.

 

Thanks 

 

 

I am creating a custom object for projects and would like to attach several accounts to the object in a similar structure to Contact Roles for Opportunities. So far I've only been able to attach accounts by creating separate relationshp fields. This then creates a ton of related lists on my accounts page and most of them will never have values. Is there a way that I can add a related list to my custom object that will show accounts in different "Roles" and then also connect this back to the accounts page so I can see which projects a certain company is attached to and what their role is?

 

Help is greatly appreciated!

  • March 26, 2009
  • Like
  • 0
Hello all I'll explain the case that I have.
 
let's take for example the contacts...
 
Someone is updating a contact on salesforce..(change a certain field and saves)
There is a trigger on contact object which calls
an asp.net WebService (with @future) when a certian field is changed.
 
The asp.net web service do some work and at the end, it logins to salesforce and update another field on the same record.
 
until now all seems ok and working...
 
when the salesforce user continues to change the same record it get the error message above
The record you were editing was modified by XXXXXX
 
How to overcome this behaviour ??
 
another question regarding this case ,
is there any option that after the webservice finishes to do its work, to refresh the
salesforce contact page ?
 
TIA
 
  • December 11, 2008
  • Like
  • 0
As of Oct. 12, any unit tests we have in a Winter '18 org that create Tasks are failing with a message of:
REQUIRED_FIELD_MISSING, Required fields are missing: [Status, Priority]: [Status, Priority]

This seems to be getting enforced at the data level not just the interface level now.

Anyone know what changed to make these fields required now?
I'm getting an error on loading the AccountLocatorApp app from the Build an Account Geolocation App

Uncaught TypeError: Cannot read property 'fire' of undefined throws at /resource/leaflet/leaflet.js:9:7645

I've made sure I've got the latest version of Leaflet (0.7.7) and reviewed much of the code (which all was verified, so I did at least get the badge...)

User-added image

This may be related to another issue with this Badge which I'm also getting and is referenced here:
https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F0000000kHVhIAM
I am attempting to extract metadata from one org and deploy to another and I receive the message 
profiles/Standard.profile -- Error: Unknown user permission: EditReports
for .profile XML files that contain
<userPermissions>
        <enabled>true</enabled>
        <name>EditReports</name>
    </userPermissions>
I've searched through the Release notes for Summer '13, Winter '14, Spring '14 and Summer '14 and cannot find any reference for a change to this user permission, although I can see that there are new User Permissions like ManageReportsInPubFolders although this looks more like the old EditPublicReports.

Can anyone point me towards documentation or references that describe the current User Permissions by their API names in the metadata API? Or the release in which this was changed?

Does a record get locked when you are in the edit page thus allowing your edits to be saved even if another user (including API user) edits and saves the record at the same time? And does inline editing also grant that or not?

 

Marketo Suppport is claiming that if we only use the inline edit, we will not receive the error "The record you were editing was modified by Marketo during your edit session" but I'm very skeptical of that claim. 

I need help finding a good way to compare Profiles to each other. I want to be able to see and extract the diff between two Profiles to determine what Object-level, Field-level and Permissions exist in one but not in the other. The goal is to build Permissions Sets that contain the differences, and then to reduce the number of Profiles we have. We will add the Permissions Sets to Users who need access to more fields or permissions (e.g. Send Mass Email).

 

I have done text comparisons between the .profile XML files generated by the IDE, but there's not an easy way to copy just the differences that I know of. Additionally, the XML would have to be converted to spreadsheet (or other user friendly format) that I can give to Premier Support & Admin so that they can build the Permissions Sets.
A difficulty with the .profile XML files is that they do not contain the App & System Permissions (userPermissions tags such as Send Mass Email), although the new Permissions Sets XML files do! This leads me to believe that the userPermissions metadata is somehow accessible for the .profiles and that the IDE has not been updated to include it yet.
I've queried the Profiles through Apex and all you get is the Permissions but not the Field-level or Object-level security. I recognize that a query would have to join so many objects to derive the complete list of all permissions that the .profile XML files shows that it's unlikely to be possible.
Because we have to do this for 4 orgs with 20-30 profiles in each, I'm trying to find the most efficient way to generate the diffs (we don't have to do every possible combination but possibly as many as 100).
So, to summarize:
Is there a way to build a custom .profile XML?
What's an efficient way to extract a diff to a friendly format?

I'm seeking a design pattern for performing cross-object field updates on multiple, independent and potentially cumulative fields. If either of two (or more) fields on a child object are changed, the corresponding fields on the parent need to be updated. I've tried this a couple ways without finding an efficient design.

 

My first approach fails because the same record is added to a list twice and causes an exception for duplicate IDs. (psuedo code follows)

 

List<object> myList
if (nw.field1 != old.field1){
myList.add (new object(id = nw.ParentId,
field1 = nw.field1));

if (nw.field2 != old.field2){
myList.add (new object(id = nw.ParentId,
field2 = nw.field2));

update myList;

I've tried this with Sets and Maps but the record you get from the Set or Map for the second field value change overwrites the first field value change. The only way I've succeeded is to update all the fields every time even one of them changes which is not desirable and nor particularly scalable. 

I run multiple orgs and am centralized support in one org for the users of all the other orgs. Rather than burden them with signing into the Self-Service Portal to view their Cases, I'm considering how best to link them to it seamelessly after they have already signed into their home org. SSO is out, we have no network. oAuth might work if the SSP could sign them in using their User credentials, however I'm most inclined to pass their credentials via POST from within Salesforce.

 

Any better ideas? Any stringent objections?

How can you prevent the Full Sandbox from sending emails to Contacts and other non-User email addresses since these email addresses do not get altered?

 

Editing all emails is impractical, slow (even Bulk API takes several minutes on 100k+ records) and not necessarily effective: Scheduled Jobs can fire immediately upon activation of new sandbox, and thus can kick off workflow.

 

I've added org ID validation to many of my workflow email alerts but that gets in the way of workflow that you might want triggered for testing.

 

I'm seeking input on how other Admins and Developers handle this problem.

 

If like me, you haven't got a great solution, please vote for this idea: 

Is there a way to tell whether a field is tracked? I'm using the Metadata Objects application, which is wonderful, and I want to enhance it to show me which of my fields are tracked in Field History Tracking. I had hoped that like isDeleted, there might be an isTracked boolean that can easily be identified.

 

Thanks,

Luke C

I have found the standalone IDE Installer very difficulty to install. I downloaded the Windows 64-bit installer from http://wiki.developerforce.com/index.php/Force.com_IDE_Installation It was first claiming there was no java virtual machine installed. I reinstalled my Java, being sure to get the 64-bit for IE version and that seemed to help move further along, however when it asked to install to a location other than C:\Program Files (x86), I changed the target directory. This failed (Windows 7 is a bit overprotective of installing there) but worse, I could not change the install target back and now the installer will not execute at all. I copied the error message below.

 

I have installed every version of the Force.com IDE into Eclipse 3.2, 3.3 and 3.4 over the last 3-4 years; I thought I would see how this new application functions since I'm always eager to explore what SFDC is up to. Sadly, the installer is too much of a nuisance to bother with. If it doesn't clear away all obstacles presented by an OS, then you really ought to include a readme.

 

 

!SESSION 2010-08-26 21:41:24.317 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2010-08-26 21:41:26.845
!MESSAGE Application error
!STACK 1
java.io.IOException: Couldn't get lock for C:\Program Files (x86)\Common\logs/installer-%g.log
at java.util.logging.FileHandler.openFiles(Unknown Source)
at java.util.logging.FileHandler.<init>(Unknown Source)
at com.genuitec.pulse2.client.installer.ui.application.InstallerApplication.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

!SESSION 2010-08-26 21:41:24.317 -----------------------------------------------eclipse.buildId=unknownjava.version=1.6.0_21java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_USCommand-line arguments:  -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2010-08-26 21:41:26.845!MESSAGE Application error!STACK 1java.io.IOException: Couldn't get lock for C:\Program Files (x86)\Common\logs/installer-%g.log at java.util.logging.FileHandler.openFiles(Unknown Source) at java.util.logging.FileHandler.<init>(Unknown Source) at com.genuitec.pulse2.client.installer.ui.application.InstallerApplication.start(Unknown Source) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

 

We had our daily WebToLead limit increased above the default limit of 500. Immediately after that change was put into effect I started received error messages every time a new web lead came in. The error message implicates the WebToLead servlet and is a warning that we're approaching the 1000 query row limit.

 

My diagnosis is that the count is referring to a rolling 24-hour count of web leads; that there is some Apex in effect for the WebToLead Servlet and that that Apex is querying our Lead table for web leads.  Salesforce support has not confirmed any of these assumptions.

 

It has not yet hit the 1000 mark, so I don't know what will happen when it does, but I'm guessing that like any Apex code, it will not execute. Which means we won't get the web lead.

 

Has anyone else ever encountered this behavior? I'm guessing there's not much I can do since I have no access to the WebToLead servlet.

 

Error Message:

 

Operation: /servlet/servlet.WebToLead

By user/organization: 0058000000ICHCB/00D80000000oHai

Caused the following Apex resource warnings:

Number of query rows: 609 out of 1000

 

 

I have a query against a table of 100,000+ records that I have been optimizing. Yesterday, Salesforce added custom indexing on the Contacted__c field, and since then, the query fails even when the table is reduced to less than 100,000 records (I had to permanently delete 20,000 Leads to Marketing's disgust).

 

The query is: 

List<Lead> leadsNotContacted = [SELECT Id, OwnerId, FirstName FROM   Lead WHERE Contacted__c = FALSE AND LastModifiedDate > 2010-04-30T00:00:00.000Z AND IsConverted = FALSE AND IsDeleted = FALSE AND OwnerId IN :idScheduledStaff];

For optimization, there is a custom indexed field (Contacted__c) which returns about 7500 records, an audit field (LastModDate) which returns about 45,000 records.The bind pulls in about 20-25 User IDs. Ultimately, the query should result in about 400-500 records.

 

The code worked fine up to 100,000 records prior to indexing it. After indexing it, once we passed 100,000 records, I could not restore its functionality even by dropping the table down to 80,000 records. 

 

Why would the query continue to throw errors when the table is well below 100,000 and the indexed field is below 10,000?

 

I received the error message below and I think I fixed it but I have no way to test it (I only have a developer sandbox and I can't add 100,000 records to it).

 

System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

 

Originally, my query was:

SELECT Id, OwnerId FROM Lead WHERE IsConverted = FALSE AND            Lead_Temperature__c = NULL AND OwnerId IN :idScheduledStaff];

 

I adjusted it to remove the NULL value reference by listing all the possible picklist values:

 

SELECT Id, OwnerId FROM Lead WHERE IsConverted = FALSE AND
Lead_Temperature__c NOT IN ('Cold', 'Warm', 'Hot', 'Dead') AND OwnerId IN :idScheduledStaff];

 

I had already deleted enough records in production to get below 100,000 so that our Lead Generation would resume while I puzzled this out. I deployed the changed code to production and now I'm waiting to see what happens when we go above 100,000 again.

 

 

Can anyone confirm whether inverting the NULL condition is sufficient to avoid the exception?

Does anyone know of an easy way (i.e. without setting up my own SOAP server) to view the content of outbound messages from workflow?

 

The admins at a third-party endpoint claim that the message is coming through but without one of the selected fields. I need to be able to test that without having to email them every time and ask "did it work this time?"

 

Is there a way I can send it to my sandbox's endpoint an see the content? Any free endpoints out on the WWW (I looked with no luck)?

 

Thanks for any help,

Hi,

I am trying to bulkify a trigger that merges incoming Leads based on a matched email so that the merge DML operation does not have to be executed in a for loop.

 

 

trigger LeadMerge on Lead (after insert) {
for (lead l: trigger.new){
try{
Lead mId = [select id from Lead where email = :l.email limit 1];
merge mId l.id;

 

 I can't figure out how to build a collection that can be used in the merge statement to return the pair of Lead IDs to be merged. If I build a map that holds the master ID and the matched record, how do I get the key-value pair to be returned in a way that the merge statement can process it?

 

Thanks for any help

 

Message Edited by Always Thinkin on 01-09-2010 05:08 PM

When you change the API name of a field I recall that some metadata components are not updated. Has anyone seen a comprehensive list? I figure I can always use the IDE to search against all files and replace the old name but I want to make sure I'm hitting all the possible locations that an API field might not be automatically updated.

 

The places I can think to check are:

Apex Classes and Triggers

Visualforce Pages

Templates

Formula Fields

Validation Rules

Workflow Rules

Reports

S-Controls

 

Can anyone think of other places an API name might not get automatically updated?

 

Thanks!

Luke C

Visualforce is adding some Javascript to my email templates that gets displayed in the Activity History and also in at least one email client out on the 'net. The content of the script doesn't even look like it is essential to the template.

 

First, the code as it appears in my .email file:

 

<apex:repeat var="cx" value="{!relatedTo.OpportunityLineItems}">
<tr>
<td>{!cx.PricebookEntry.product2.description}</td>
<td><div align="right"><apex:outputField value="{!cx.UnitPrice}"/></div></td>
<td><div align="right"><apex:outputField value="{!cx.Quantity}"/></div></td>
<td>&nbsp;</td>
</tr>
</apex:repeat>

 

 Pretty straightforward usage, just building a dynamic table of Opportunity Products.

The HTML and Javascript that appears for that exact same portion, when repeated twice for two records, is:

 

<tr>
<td>mCLASS&reg;:DIBELS&reg; Software Annual Student Subscription</td>
<td><div align="right"><script type="text/javascript"> if(!window.sfdcPage){window.sfdcPage = new ApexPage();}
UserContext.initialize({'locale':'en_US','timeFormat':'h:mm a','today':'5\/19\/2009 6:09 PM','userPreferences':[{'value':true,'index':112,'name':'HideInlineEditSplash'}
,{'value':true,'index':114,'name':'OverrideTaskSendNotification'}
,{'value':false,'index':115,'name':'DefaultTaskSendNotification'}
,{'value':false,'index':119,'name':'HideUserLayoutStdFieldInfo'}
,{'value':false,'index':116,'name':'HideRPPWarning'}
,{'value':false,'index':87,'name':'HideInlineSchedulingSplash'}
,{'value':false,'index':88,'name':'HideCRUCNotification'}
,{'value':true,'index':89,'name':'HideNewPLESplash'}
,{'value':false,'index':90,'name':'HideNewPLEWarnIE6'}
,{'value':false,'index':122,'name':'HideOverrideSharingMessage'}
],'startOfWeek':'1','isAccessibleMode':false,'ampm':['AM','PM'],'userId':'00530000000pvUP','dateTimeFormat':'M\/d\/yyyy h:mm a','dateFormat':'M\/d\/yyyy','language':'en_US','siteUrlPrefix':''}
);
</script><span id="j_id0:emailTemplate:j_id3:j_id4:j_id16:0:j_id20">$6.00</span></div></td>
<td><div align="right"><span id="j_id0:emailTemplate:j_id3:j_id4:j_id16:0:j_id22">100.00</span></div></td>
<td>&#160;</td>
</tr>

<tr>
<td>mCLASS&reg; Platform Annual Student Subscription</td>
<td><div align="right"><span id="j_id0:emailTemplate:j_id3:j_id4:j_id16:1:j_id20">$8.00</span></div></td>
<td><div align="right"><span id="j_id0:emailTemplate:j_id3:j_id4:j_id16:1:j_id22">100.00</span></div></td>
<td>&#160;</td>
</tr>

 

I know that Visualforce processes the code and converts it to HTML, but I just cannot figure out what purpose this <script> has:

<script type="text/javascript"> if(!window.sfdcPage){window.sfdcPage = new ApexPage();}
UserContext.initialize({'locale':'en_US','timeFormat':'h:mm a','today':'5\/19\/2009 6:09 PM','userPreferences':[{'value':true,'index':112,'name':'HideInlineEditSplash'}
,{'value':true,'index':114,'name':'OverrideTaskSendNotification'}
,{'value':false,'index':115,'name':'DefaultTaskSendNotification'}
,{'value':false,'index':119,'name':'HideUserLayoutStdFieldInfo'}
,{'value':false,'index':116,'name':'HideRPPWarning'}
,{'value':false,'index':87,'name':'HideInlineSchedulingSplash'}
,{'value':false,'index':88,'name':'HideCRUCNotification'}
,{'value':true,'index':89,'name':'HideNewPLESplash'}
,{'value':false,'index':90,'name':'HideNewPLEWarnIE6'}
,{'value':false,'index':122,'name':'HideOverrideSharingMessage'}
],'startOfWeek':'1','isAccessibleMode':false,'ampm':['AM','PM'],'userId':'00530000000pvUP','dateTimeFormat':'M\/d\/yyyy h:mm a','dateFormat':'M\/d\/yyyy','language':'en_US','siteUrlPrefix':''}
);
</script>

 


Anyone else seen this in their Visualforce templates? Is it normal and I just have to accept that crappier email clients can't deal with JS in the <body>? I find it suspicious that it shows up in Task rendition of the Activity History.

 

Thanks for shedding any light you can,

Luke C

 

 

Message Edited by Always Thinkin on 05-22-2009 03:04 PM
Message Edited by Always Thinkin on 09-23-2009 11:05 AM

Hi Everyone,

I'm trying to find some reference to how Salesforce secures the web-to-lead forms (and other web-to-X) forms against SQL injections. I'm confident that Sf does some server-side validation on the data but my faith isn't enough for my company's security exec. 

 

I dread posing this question to Sf support (although the answer would probably be an amusing non-sequitor), anyone ever spot a white paper that covers such topics?

 

Thanks,

Luke C

Since Workflow Email Alerts don't allow you to specify a sender, I'm looking for a workaround to achieve that end.

 

I'm thinking of adding a criteria (Last Modified By = User.ID) that only a specific user can trigger the workflow but that's full of problems, especially with regards to time-based and the queue: subsequent changes invalidate the rule and delete the queued actions.

 

Any brilliant suggestions out there? I'm feeling a little dull-witted today...

 

Thanks,

Luke C

I've been developing some Apex code to automatically clone closed opps. It expands on code that creates cases for implementing services purchased. The only signficant change I've made from the original version of the code is to run it asynchronously (using @future) which causes the following strange behavior:

 

After the code executes, my recent items list contains all the records for the cases created as well as the account related to the opportunity even though I have not actually accessed these records through the UI.

 

If I remove the @future annotation the UI behaves as expected so it seems to be directly related to async.

 

Anyone seen behavior like this or have a good guess why it would happen?

 

 

 

I am attempting to extract metadata from one org and deploy to another and I receive the message 
profiles/Standard.profile -- Error: Unknown user permission: EditReports
for .profile XML files that contain
<userPermissions>
        <enabled>true</enabled>
        <name>EditReports</name>
    </userPermissions>
I've searched through the Release notes for Summer '13, Winter '14, Spring '14 and Summer '14 and cannot find any reference for a change to this user permission, although I can see that there are new User Permissions like ManageReportsInPubFolders although this looks more like the old EditPublicReports.

Can anyone point me towards documentation or references that describe the current User Permissions by their API names in the metadata API? Or the release in which this was changed?

Does a record get locked when you are in the edit page thus allowing your edits to be saved even if another user (including API user) edits and saves the record at the same time? And does inline editing also grant that or not?

 

Marketo Suppport is claiming that if we only use the inline edit, we will not receive the error "The record you were editing was modified by Marketo during your edit session" but I'm very skeptical of that claim. 

Anyone know of a way to create a lookup field that targets Opportunity Products? It's not possible through the Sf Interface and attempting to create it in the Eclipse IDE also fails.

 I'm assuming that it's blocked system wide although it is possible to create custom objects that can lookup another custom object that, like Opp Prods, is a Detail record in a Master-Detail relationship.

If you don't know the answer, but think it's a good idea anyway, please vote for my Idea: Allow Lookup fields to target Opportunity Products
Hi all,
i want to create a record dynamically in 1 org (dont hard code the values in controller) using visualforce page and that record automatically creted in 2nd org  how it is plz help me , using trigger its working bt i want to insert a record from visualforce page , please send me any sample code , 
As of Oct. 12, any unit tests we have in a Winter '18 org that create Tasks are failing with a message of:
REQUIRED_FIELD_MISSING, Required fields are missing: [Status, Priority]: [Status, Priority]

This seems to be getting enforced at the data level not just the interface level now.

Anyone know what changed to make these fields required now?
I'm passing this challenge, however when I actually test it out by clicking on an account in the account list item, I get this exception: 

"Something has gone wrong. Action failed: c$AccountMap$controller$accountSelected [TypeError: Cannot read property 'reuseTiles' of undefined] Failing descriptor: {c$AccountMap$controller$accountSelected}."

I did some debugging and found that the location and latitude of the account are indeed being capture by my event, so it looks like this might be a problem with the leaflet function map.panTo(). Does anyone know the solution to this issue? Here's my code, although it's exactly the same as the tutorial's.
 
({
    jsLoaded: function(component, event, helper) {

        setTimeout(function() {
            var map = L.map('map', {zoomControl: false}).setView([37.784173, -122.401557], 14);
            L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
                {
                    attribution: 'Tiles © Esri'
                }).addTo(map);
            component.set("v.map", map);
        });
    },

    accountsLoaded: function(component, event, helper) {

        // Add markers
        var map = component.get('v.map');
        var accounts = event.getParam('accounts');
        for (var i=0; i<accounts.length; i++) {
            var account = accounts[i];
            var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
            L.marker(latLng, {account: account}).addTo(map);
        }  
    },

    accountSelected: function(component, event, helper) {
        // Center the map on the account selected in the list
        var map = component.get('v.map');
        var account = event.getParam("account");
        alert(account.Location__Latitude__s + ', ' + account.Location__Longitude__s);
        map.panTo([account.Location__Latitude__s, account.Location__Longitude__s]);
    }
})

 
HI I am trying to copy the field values from one custom object to Opportunity standard object

I have 6 fields on Custom Object
Address, City, State, Zip Code, County and Country
I created these fields on opportunities as well
How do I copy the values?  (My requirement is when users create new opportunity the system should give them option if you want to create this duplicate opportunity as the address is same (These 6 fiekds are same) and ask them if they want to create and if yes create a record
Hi,
I would like to get the Administrator certification, can be Salesforce Trailhead the correct way to pass the exam?
Thanks

Marzia
HI 

Can any one help me out in testing the same scenario for delete statement.
Really appreciate your quick responses.

Thanks
trigger userdeactive on User (before insert,before update) {
List<GroupMember> group = new List<GroupMember>([select Id, UserOrGroupId, groupid From GroupMember where groupId IN 
                                                 (SELECT id FROM group WHERE Type = 'Queue') 
                                                  AND UserOrGroupId IN (SELECT id from user WHERE isactive=FALSE)]);

   delete group;            
}
 
@isTest 
private class deActiveUserTest {
    static testMethod void validateremoveInActiveUser() {
       {
 User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
      System.runAs (thisUser) 
      {        // Insert user
        Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator']; 
        User u = new User(Alias = 'standt', Email='test@test.com', 
        EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
        LocaleSidKey='en_US', ProfileId = p.Id, 
        TimeZoneSidKey='America/Los_Angeles', UserName='sdss123@test.com');
        insert u;
        
        // Insert group
        Group grp = new Group();
        grp.Name = 'Technology Partner Content';
        insert grp;
        
        test.starttest();
         system.assertequals(u,[select id from user WHERE isactive=FALSE]);
         delete grp;
         test.stoptest();
 
        
        // Insert contact with your required field.
        Contact cnt = new Contact();
        cnt.LastName = 'Test contact';
        cnt.Email = 'test@test.com';
        //cnt.Public_Group_Technology_Partner_Content__c = true;
        insert cnt;
        }
    }
}
}
Hi All,

when stage  is closed in case object and recordtype is'com' then user can editable these fileds (product__c and prdouctfamily__c), how to we can ac hive this.

Regards,
Viswa
Please help me  to create a validation rule for this task. Does this task can be done without tiggers , or the only way is to write tigger for this task."
When a new lead is created, check if there is an Account record that already exists (based on the company name)
if the account exists, then check the box for the field called "active lead" in the Accounts object"

Thanks
Hello,

Im experiencing this problem when try to import leads through the Launch Wizard:

Your import failed: Import for object Lead did not succeed. Error received - sObject type 'CampaignMember' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Anyone can help me to figure it out?
  • October 15, 2015
  • Like
  • 0
Hello,

We are creating a app that needs to be link to salesforce.

In order to access the Salesforce.com APIs we will need the following:

· A Salesforce Connected App with OAuth enabled and full access scope.

o App Consumer Key

o App Consumer Secret

· A user account with API enabled and enough access privileges

o Username

o Password

o Security Token


Can you please let me know how to get all this and how to give to the developper?

Thank you very much

Olivier
All leads received in SFDC from Digitas and sent to Siebel and updates for all leads received from Siebel, if they have been successfully loaded or rejected in SFDC. Creation of error log providing the details as in the generic template. This error log can be of the format CSV. can any one help me on this scenario.

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.