• Suraj Gharat
  • SMARTIE
  • 510 Points
  • Member since 2014
  • Developer
  • Apttus Softwares Pvt. Ltd.


  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 7
    Likes Given
  • 13
    Questions
  • 121
    Replies
Hi,

Need inputs on how to parse below string and extract all the relevant information such as Source, Name etc.

Source: Web Visitor 
Name: Ravi Sharma 
Age of primary applicant: 9 


Email: test@yahoo.com 
Phone: 1234567 
Address: 10th Street 
City: Woodstock 
State: GA 
Comments: Test Comments 
When I created my account on Trailhead, I clicked the Google sign in OAuth button to create my account. I'm going through a lot of modules. I got to a module where I need to learn how to install AppExchange apps in my Sandbox. When I attemp to install any apps, it asks me to authenticate and requires me to provide my login/password for my sandbox.

According to my sandbox my username is <myname>@<sandbox-name>.com

But I do not have a password. Since I signed up for an account using Google login, I was never asked to enter a password anywhere. So therefore I cannot login to authenticate to install any AppExchange apps.

I tried going into the sandbox into my user settings to change my password, but it requires me to type in my old password in order to change my password to something new. But since I never had a password to begin with, I can't do it!

I also tried creating a Salesforce login (complete with username and password). Then I went into the Trailhead settings and merged my two accounts together. This worked. However when I get to the sandbox authentication screen it doesn't appear to accept my Salesforce login for the sandbox. It only appears to want to accept my sandbox username and again, since I don't have a password and can't set one, I can't login.

Help. What do I do here?
Hi,
I want to trace view state in developer console,
but view state show nothing even I click preview of vf page.
view state vf preview

I already activate view state in user profile as below.
view state setting

Is there any wrong?

Regards,
LinThaw.
 
Hi All

I have a JS button on a custom object that copies fields from the record an makes a new record in a different object. One of the fields im trying to copy is a long text area but it often has illegal char's and a lot of weird stuff in it.
 
ito.incidentDescription__c = "{!ncident__c.incidentDescription__c }";
Always results in an Illegal error

So im trying to clean it up an put it into an error box so i can confirm that it works but i still get illegal errors. The code im trying that still errors is:
 
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}

var incidentdesc = "{!Incident__c.incidentDescription__c}"
clean = incidentdesc.replace(/[|&;$%@"<>()+,]/g, "");

alert( 
clean
);

Can anyone offer up any possiable solutions to this?

Cheers
Dale
Hi All,
I have a List<ART_Case__c> where ART_Case is a custom Object which has a field First_Response_Time__c having data type Number which Stores Average Response Time for Cases.Now I am Encountrig problem in a piece of code.
a=[Select First_Response_Time__c from ART_Case__c where Queue_Name__c=:ownerMap.get(c.OwnerId) and Created_Date__c=: date.Today() ];
       
       Float j=0.00;
       for(Integer i=0;i<z;i++)
       {
           j=j+a[i];
       }

The problem is with the data typeof variable j.Error: Compile Error: Invalid type: Float at line 77 column 8.Please Suggest me which Data Type I Should Use
Thanks in Advance
I'm trying to display an image that is stored as a Document. Starting with the most basic example, I am using the following:
 
<apex:page standardcontroller="Document">

  <apex:outputField value="{!Document.name}"/>
  <apex:image id="theImage" value="!Document.Logo.jpg" width="100" height="100"/>

</apex:page>

passing the ID of the document in through the URL. It's Name displays OK, but the image does not, just showing as a 'dummy' 100x100 blank square. What syntax do I need to use? Or do I need a different approach some how?
Note, I do not want to use a Static Resource.
Thanks

hi... i have seven sets of string and i need to extract values which are same in all seven sets. i tried using for loop but its giving me cpu time limit exceed.Any help would be appreciated.
Thanks

I need to insert ContactRole record for an opportunity while creating an opprtunity from some custom object.I have written a trigger i.e after insert on opportunity.

if (trigger.isinsert)
    {   
        oppty = trigger.new;

        for(opportunity Opt:oppty)
        {
    system.debug('Dealer'+Opt.Installed_Product__r.Dealer_1__c);
           if(Opt.Installed_Product__c !=null){
                system.debug('Method Entry');         OpportunityContactRole OCR1 = new OpportunityContactRole(ContactId=Opt.Installed_Product__r.Dealer_1__c, OpportunityId=Opt.Id,IsPrimary=TRUE);
                NewOppCRole.add(OCR1);
            }

But every time I get ContactId = null.So insertion failed since it is a mandatory field.
Is there any way to solve this issue?

Thanks in advance.
Hello,

How can you checkin Salesforce the rows created for all the objects.
Hi,
     I have a scheduled class which calls almost 15 batch jobs. I have manually invoked these batch jobs and flex queue is taking care of the 5 concurrent jobs limit. But when the scheduled class is invoked in a test class it throws an error showing that more than 5 jobs cannot be queued. Do I have to specify jobs in flex queue in test classes? I cannot find any such thing in documentation 
Hi All,

Developed below trigger on Lead...initially I forgot to add Record type under LIst..But even after that correction , I am getting the following error..

Error: Compile Error: Initial term of field expression must be a concrete SObject: List<RecordType> at line 31 column 30 

trigger AH_Lead_Address_Campaign on Lead(before insert, before update){   
    List<RecordType> rt = [SELECT id, name, developername FROM recordtype WHERE developername = 'MAH'];    
    Campaign c = [SELECT id FROM Campaign WHERE name = 'LS2' limit 1]; 
     for(Lead l: Trigger.New) 
    {     
        if(l.address__c == null || l.address__c == '')        
        l.Address__c = l.street;    
        if(l.city__c == null || l.city__c == '')        
        l.City__c = l.city;   
        if(l.state__c == null || l.state__c == '')        
        l.State__c = l.state;            
        if(l.Zip__c == null || l.Zip__c == '')        
        l.Zip__c = l.postalcode;       
        if(l.RecordTypeId == rt.Id)      ......Error Line
        l.Campaign__c = c.Id;    
    }
}        
        
can some one please point what am I doing wrong??
Any help is appreciated.
Thanks!

Ashish
Hi

I have the following trigger that appears to be ok in the sandbox and in production it all validates. I tried to insert some contacts today using Apex Data Loader and got the error relating to too many SOQL queries.

I thought I had bulkified it but evidently this isn't the case. Can some one assist in pointing me in the right direction as to where I have gone wrong please.

Thanks
 
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
//
//  Name:
//      CI_Trigger_Contact
//
//  Purpose:
//      This will process changes that need to be made based on fields that may change when 
//      contacts are inserted, edited, deleted and undeleted
//  
//  Created by:
//      Andrew Telford
//
//  Date: 
//      2015-07-31
//
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------

trigger CI_Trigger_Contact on Contact ( after insert, after update, after delete, after undelete) 
{

//	Let us prepare some common variables
//----------------------------------------------------------------------------------------------
	system.debug('Set the variables');

	// Common items
	STRING thisContactID;
	STRING thisContactOwnerID;
	STRING userID;
	STRING userProfileID;
	STRING errMsg = '';


//--	Let us get the details relating to this contact change
//----------------------------------------------------------------------------------------------
	system.debug('Contact[]');

//--	Set the details of the trigger to a variable for use through the trigger
//----------------------------------------------------------------------------------------------
	Contact[] strContact;

	if (Trigger.isDelete) 
	{	strContact = Trigger.old;	}
	else
	{	strContact = Trigger.new;	}

	Set<ID> contactID = new Set<ID>();
	FOR(Contact objCont: strContact)
	{
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
//
//  Owner Change Approved
//
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------

		system.debug('Set the variable values');

	//--	Define any variables required
	//----------------------------------------------------------------------------------------------
		BOOLEAN approvedOwnerChange;
		STRING newContactID = '';

	//--	Assign Values to Variables
	//----------------------------------------------------------------------------------------------
		contactID.add(objCont.Id);
		thisContactID = objCont.Id;
		thisContactOwnerID = objCont.OwnerId;
		userID = userinfo.getUserId();
		userProfileID = userinfo.getProfileId();
		approvedOwnerChange = objCont.Approved_Owner_Change__c;

		system.debug('Determine if owner is to change');

	//--	Check for change forced by workflow
	//----------------------------------------------------------------------------------------------
		if( !objCont.Approved_Owner_Change__c && ( TRIGGER.newMap.get( objCont.Id ).OwnerId != '00520000000noZtAAI' || TRIGGER.newMap.get( objCont.Id ).OwnerId != '00520000000noZtAAI' ) )
		{

	//--	Check to see if we are updating the owner
	//----------------------------------------------------------------------------------------------
			if( TRIGGER.isupdate && objCont.Approved_Owner_Change__c )
			{
				system.debug('Owner is to change');
				LIST<Contact> contsToUpdate = [SELECT Id, OwnerId, Approved_Owner_Change__c, Approved_Owner_Name__c FROM Contact WHERE Id IN :contactID AND Approved_Owner_Change__c = TRUE];

	//--	Set the update list
	//----------------------------------------------------------------------------------------------
				List<Contact> updateOwner = new List<Contact>();

				FOR (Contact cont: contsToUpdate)
				{
					Boolean alterOwner = FALSE;

					IF ( cont.Approved_Owner_Change__c = TRUE )
					{	alterOwner  = TRUE;	}

					if (alterOwner) 
					{
						cont.OwnerID = cont.Approved_Owner_Name__c;
						cont.Approved_Owner_Change__c = FALSE;
						newContactID = cont.Approved_Owner_Name__c;
						updateOwner.add(cont);
					}
				}


	//--	Execute the update
	//----------------------------------------------------------------------------------------------
				if (!updateOwner.isEmpty()) 
				{
					try{ update updateOwner; }
					catch (Exception ex)
					{ System.debug('Could not update New Contact Owner [' + newContactID + '] cause: ' + ex.getCause() + 'APEX TRIGGER: CI_Trigger_Contact');}
				}
			}
		}	//--	End Check for automated change after insert



//
//  End Approve Owner Change
//
//--------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------
//
//  Magic Movers
//
//	This works in conjunction with:
//		Validations
//			Magic Mover Addition (03dc00000009014)
//			Magic Mover REmoval (03dc00000009080)
//
//		Workflow Field Update
//			New Contact (01Q20000000Es9Z)
//			Set Magic Mover to False (04Yc000000090G1)
//
//--------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------

	//--	Magic Movers 
		BOOLEAN magicMover;
		DECIMAL userMagicCount;

	//--	Select the Owner Information
		LIST<User> thisOwner = [Select Magic_Movers_Count__c FROM User WHERE ID = :objCont.OwnerID];
		LIST<User> updateUser = new LIST<User>();
		system.debug( 'Size of thisUser: ' + thisOwner.size());

		for ( User o1: thisOwner )
		{
			if( o1.Magic_Movers_Count__C == NULL )
			{ userMagicCount = 0; }
			else
			{ userMagicCount = o1.Magic_Movers_Count__C; }
            system.debug('No. of Magic Movers = ' + userMagicCount);

            if( !TRIGGER.isinsert && !TRIGGER.isUnDelete )
            {
                
	//--	Has Magic Mover been altered?
	//------------------------------------------------------------------------------------------------------------------------------
                if( objCont.CCC_Adviser__c != TRIGGER.oldMap.get( objCont.Id ).CCC_Adviser__c 
                    && TRIGGER.isupdate && thisContactOwnerID == userID )
                {
	//--	Check to see if the owner has the magic count limit and the change is an addition
	//------------------------------------------------------------------------------------------------------------------------------
                    if( userMagicCount < 21 && objCont.CCC_Adviser__c )
                    {
                        o1.Magic_Movers_Count__c = userMagicCount + 1;
                        updateUser.add(o1);
                        system.debug('size of: ' + updateuser.size());
                    }
                    else if ( !objCont.CCC_Adviser__c )
                    {
                        o1.Magic_Movers_Count__c = userMagicCount - 1;
                        updateUser.add(o1);
                        system.debug('size of: ' + updateuser.size());
                    }
                }
			//--	End check for change in Magic Mover

	//--	Reduce the count when the owner is changed
	//------------------------------------------------------------------------------------------------------------------------------
                else if ( TRIGGER.isUpdate && TRIGGER.isBefore && objCont.OwnerId != TRIGGER.oldMap.get( objCont.Id ).OwnerId )
                { objCont.CCC_Adviser__c = FALSE; }

	//--	When the contact is deleted, reduce the count
	//------------------------------------------------------------------------------------------------------------------------------
                else if ( TRIGGER.isDelete )
                {
                    o1.Magic_Movers_Count__c = userMagicCount - 1;
                    updateUser.add(o1);
                    system.debug('size of: ' + updateuser.size());
                }
                //--	End check for delete
            }

	//--	Process the updates
	//------------------------------------------------------------------------------------------------------------------------------
            system.debug('size of: ' + updateuser.size());
			if (!updateUser.isEmpty()) 
			{
				try{ update updateUser; }
				catch (Exception ex)
				{ objCont.addError(' Error Updating ' + ex.getCause()); System.debug('Could not update User [' + thisContactOwnerID + '] cause: ' + ex.getCause() + 'APEX TRIGGER: CI_Trigger_Contact'); }
			}
		}	//--	For Owner Loop

//
//  End Magic Movers
//
//--------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------

	}
//
//  End Contact Loop
//
//--------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------
}

 
please tell me how to call sayYou method in bellow class?

public class HelloWorld{
    
    public static void sayYou(){
        system.debug('You');
    }
    
    public void sayMe(){
        system.debug('Me');
    }
}
It is urgent requiremnet,
count the number of accounts at account owner level.
 I mean the accounts they are the ownerof. the requiremnet is only count of accouts not a name.
for example: account, contain 100 records on same account owner. then this count of 100 sholud be display on that Users custom field.

Here is the code,

global class NumberOfBPsClass implements Database.Batchable<sObject> {
   
    List<Account> acc= new List<Account>();
   //String query;
    Set<Id> userIds =new Set<Id>();
   User currentUser=new User();
     //currentUserId = UserInfo.getUserId();
    //List<User> currentUser=[SELECT Number_of_Business_Partners__c,Number_of_BPs_in_Team__c FROM User WHERE Id=:currentUserId];
    
    
    global Database.QueryLocator start(Database.BatchableContext BC) {
        
        return Database.getQueryLocator([SELECT Number_of_Business_Partners__c,Number_of_BPs_in_Team__c FROM User]);
    }
   
    global void execute(Database.BatchableContext BC, List<sObject> scope)
      {
          List<Account> accns = new List<Account>();
       List<user> lstcon= new List<user>();
         for(sObject s : scope)
         {
                 Account a = (Account)s;
                 user c = new user();
        c.Number_of_Business_Partners__c=accns.size();
                  lstcon.add(c);
                  }
          
      insert lstcon;
      }
    global void finish(Database.BatchableContext BC) {
    }
}


thnaks in advance
Hey,

I'm checking out the Lightning Login feature, which I expect to allow me to use finger swipe to authenticate instead of entering password and/or tapping "Approve" on the push notification. But it does not do so, it just does the same thing as it does for "Two factor authentication feature". Below are the things I did here :
  1. Created a permission set with "Lightning Login User" permission checked
  2. Assigned the above permission set to my user
  3. Added this account into my Salesforce Authenticator app (Version 4.1, Android)
  4. Enrolled for Lightning Login feature on user page
Am I missing something here ?
Hi everyone,

I need to demonstartes how a non-sfdc aplication consumes sfdc data using odata. I believe every odata consumer needs to have an odata producer, I mean we cant just use odata client to call Rest or SOAP web services, the protocol has to be followed at both the ends, right ?

Does sfdc provide odata api or any way to build it ?
What is the purpose of instrumentation console ? 
Summer 16 has added this new deature into Lightning Experience, and I couldnt find the use of it yet. Does anybody know anything about it?
May be because I havent worked on Communities yet, I dont understand where these roles getting used ? What is thier purpose ?

Any pointers/links/help with which I could start ?
Hi Everyone,

I want to develop MS Excel download feature for some of my data, thus I created a VF page with following attribute on the apex:page tag.
contentType="application/vnd.ms-excel#somefile.xls"
With this I get the file downloaded but when I try to open it, the Excel application (I use 2013 version) shows a warning message before showing the data.

"Excel cannnot open the file 'somefile.xlsx' because the file format or file extension is not valid. Verify that file has not been corrupted and that the file extension matches the format of the file."

I think issue is with its given MIME type or file extension since i can see data, its not corrupted. Could anybody help me make this download without that warning message ?
 
Hi All,

What are the different ways for Lightning component deployment ?

Appreciate you help.
Hi All,

I need to know what are different tools/IDEs available for Lightning Component development.

Appreciate your help on this.
How does Salesforce handle multiple API versions? Does it maintain separate tables/classes for each available API version and at the run-time loads the specific required version copy of the table/class ?

Similarly, if an org upgrades its installed package to higher version, how does Salesforce make both the version available to the subscribers org? Does it maintain two copies of tables/classes that come into the package, one for each version ?
Hi everyone,

I've a VF page with standard controller and an extension. In an action invoked by a postback request, I add one new field into the standard controller (Using reset() & addField() methods ) and then refer that new field dynamically onto the page as it rerenders. When the page rerenders after this postback, I get follwoing error:

SObject row was retrieved via SOQL without querying the requested field: Account.Name 

Here "Name" is the new field that I add into the action method. The error suggest that I didnt understand the concept of reset() and addFields() correctly and may be using in wrong manner.

Please help me resolve this error and explain the use/purpose & right sequence of these two methods.
 
Greetings,

I want to upload a file using Data Loader as Salesforce Content (I'm inserting ContentVersion object). I also want the uploaded file should be displyed in "Notes & Attachments" related list of one particular account. Hence I use the field "FirstPublishLocationId" of the "ContentVersion" and set it to the account id to which I want it to be linked. But as I try to do it, it gives me following error:

Content cannot be inserted as a child of record 0019000000PjQVk

Can be anybody help me here ?
Hello Everyone,

Can anybody tell me how to access/process the content returned by "response.getReturnValue()" in action callback. In my case if the returned response is of type String or any specific sobject it works correctly; However for user defined types, it returns a JS object instance with no values in it. I checked my Apex part and it's returning the right expecting data.

Your help is greatly appreciated.
 
Hi All,
 
I've situation where I need to get the name of the Apex class from its instance.
The declared instance variable is of very generic type (Object) and using this variable, I need the name of the specific class from which the object was instantiated.

Because of my requirements I cant use instanceof here, and I dont want to resort to "String.valueOf(obj)" as this is not the reliable way.

Please assist.
Hi All,
I have a custom object with four lookup fields to User.
All records of this object should be readable to all org users. (This could be done by setting OWD to public readonly)
And each record of this object should be editable to only those four users who are linked via four lookup fields.
These four users could be any users and vary one record to another.
How can I implement this without asking my users to manually share their records.

Can anybody help me?
Hi ,

I am trying to ad a Table in Visualforce Email Template which will pull up all child records.
My code is working fine with pulling data However , Its adding mutiple rows for every new record instead of adding up Columns.

Can anybody help me identifying whats wrong? Below is my Table  :-
 
<table border="0"  align="center" width="300">
        <caption>Parts Requested</caption>
        <apex:repeat var="cx" value="{!relatedTo.Product_Request_Line_Items__r}"> 
       
             <tr>
    <th> Model Number</th>
    <td>{!cx.Model_Number__c}</td>
             </tr>
             
             <tr>
    <th> Serial Number</th>
    <td> {!cx.Serial_Number__c}</td>
             </tr>
             
             <tr>
    <th> Part Number</th>
    <td> {!cx.Part_Number__c}</td>
             </tr>
             
             <tr>
    <th> Part Description</th>
    <td> {!cx.Part_Description__c}</td>
             </tr>
             
             <tr>
    <th> Quantity</th>
    <td> {!cx.Quantity__c}</td>
             </tr>
             
             <tr>
    <th>Reason </th>
    <td> {!cx.Reason__c}</td>
             </tr>
    
           </apex:repeat>                
        </table>

 
I just logged into developer edition and I was looking for Workflows & Approvals and I can't find it. searched by keyword and it is not there!!!
How can I make it visible ?my side menue
Hey guys,

I have two lookup fields on Person Accounts (Contact).
  • Account (Lookup)
    • Filter: Account Record Type equals Dealer
  • Contact (Lookup)
    • Filter: Contact:Account:AccountID equals "SFID"

I tried everything:
  • Name
  • 15 or 18 SF ID
  • with "" and without
  • Also tried RecordTypeID for Dealer, also with "" and without and 15 or 18 digit SF ID
But nothing worked, It shows all contacts or accounts all the time.

Do you have any idea? I can provide more information if required. 

OWD´s are public

BR
Hi,

is it possible to write an if formula in a report for when the field From_Opportunity_Stage_Name is a specific value. So when the specific value is true, it counts 1 or something else.

Best regards
  • October 19, 2018
  • Like
  • 0
I tried to upload a package including this Apex Class, a message shows up "Upload Failed No test methods found in the Apex code included in the package. At least 75% test coverage is required." Can anyone please help me how to write the test method?
 
Public Class EmailHandler{


Public String newappId;
public static Boolean testmode { get; set; }
static {
            testmode = false;
}

public pagereference sendemail() {
        
        newappId = Apexpages.currentPage().getParameters().get('id');
        List<Tax_Receipt__c> lst_emailfund;
        lst_emailfund = [SELECT id,AccountEmail__c,name,Contact_First_Name__c,CreatedById, Contact_Email__c,Account__c,Account__r.name,Contact__c FROM Tax_Receipt__c WHERE id=:Apexpages.currentPage().getParameters().get('id')  Limit 1];
        
        sendALLemail(lst_emailfund);
        PageReference pageRef = new PageReference('/'+newappId);
        pageRef.setRedirect(true);
        return pageRef;       

}


public static void sendALLemail(List<Tax_Receipt__c> lst_TaxRcpt) {
        
        system.debug('***EMAIL2***');
        Boolean SendEmail = True;
        Task addEmail;
        
        Date todaydate = system.today();
        
   for(Tax_Receipt__c emailfund:lst_TaxRcpt ){     
        
        addEmail = new Task();
        SendEmail=true; 
        if(emailfund.Contact_Email__c == Null && emailfund.AccountEmail__c==Null){           
            SendEmail=false;           
            addEmail.subject = 'Missing Email Address';
            addEmail.Description = 'Tx certificate was not sent because there is no email address No: '+ emailfund.name;        
        }
        if(SendEmail==false){
        
        }
        else{
            
            addEmail.OwnerId = emailfund.createdbyId;
            addEmail.subject = 'Tax Email';
            addEmail.status = 'closed';
            addEmail.Priority = 'Normal';
            addEmail.ActivityDate = System.Today();
            addEmail.Description = 'Emailed tax certificate with attachment PSFATaxCertificate.pdf see Tx certificate No: '+ emailfund.name;
            
             
            String addresses,donor,subject,body;
            
            EmailTemplate templateId; 
            
            Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
            
            
            if(emailfund.Contact_Email__c != null){
                
                addresses = emailfund.Contact_Email__c;                                     
                donor = emailfund.Contact_First_Name__c;
                templateId = [select id, name from EmailTemplate where name =: 'TaxCertificateContact'];    
                        
                addEmail.WhoId = emailfund.Contact__c;
                addEmail.WhatId = emailfund.id;
                
                
                email.setTemplateId(templateId.id);
                email.setTargetObjectId(emailfund.Contact__c);
                
            }
            else{
                
                donor = emailfund.Account__r.name;
                addresses = emailfund.AccountEmail__c;
                addEmail.WhatId = emailfund.Account__c;
                
                 Batch_Email__c BatchEmail = new Batch_Email__c();
                 BatchEmail = [SELECT Date__c,Image_Url__c,Email_Subject__c,Email_Body__c FROM Batch_Email__c limit 1];
                
                subject = 'PSFA TaxCertificate';
                body = '<html><body>Dear'+ ' ' + donor +' '+
                
                
                '<p>'+BatchEmail.Email_Body__c+
               // Attached please find a copy of your Section 18A Tax Certificate for donation/s made to the Peninsula School Feeding Association during the 2014/15 financial year.</p><p>Your generous financial support has ensured that the hungry children on our feeding programme continue to receive healthy cooked meals while at school.</p><br><br>Kind regards<br><br>CHARLES GREY<br><br>FUNDRAISING MANAGER<br>Cell: 0824548808<br>
                '<br><img width = "160" height = "120" src="'+ BatchEmail.Image_Url__c + '"/><br><table><tr><td><a href = "http://www.facebook.com/PSFA.org" >Facebook </a></td><td><a href = "https://twitter.com/SchoolFeeding" >Twitter </a></td></table></body></html>';
        system.debug('****'+body);
        //        https://c.cs17.content.force.com/servlet/servlet.ImageServer?id=015g0000000verY&oid=00Dg0000006SaLh&lastMod=1465468508000" />
                
                 email.setHtmlBody(body );
                //email.setPlainTextBody( body );
                email.setSubject(BatchEmail.Email_Subject__c );
                      
            }  
            
            
        
             
        
        //Attachment get the data
        
          PageReference pdf;
          //  system.debug('***InvestmentType***'+InvestmentType);
          if(emailfund != null){                  
                pdf =  Page.TaxIndEmail;
          }
                   
            pdf.getParameters().put('id',(String)emailfund.id); 
            pdf.setRedirect(true); 
        
            // Take the PDF content
            Blob b; 
           if (testmode)
           {
                b = Blob.valueOf(body);

           }
           else
           {
                 
                b = pdf.getContent();
           }

        // Create the email attachment and the email
            
            
            Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
            efa.setFileName('PSFATaxCertificate.pdf');
           efa.setBody(b);        
            
            
            system.debug('**addresses**'+addresses);
            String[] toAddresses = addresses.split(':', 0);
            OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'chantal@psfa.org.za'];  
            // Sets the paramaters of the email
            
            if ( owea.size() > 0 ) {
                email.setOrgWideEmailAddressId(owea.get(0).Id);
            }
             
            
            
            email.setSaveAsActivity(true);
            email.setReplyTo('chantal@psfa.org.za');
            email.setToAddresses( toAddresses);
           

            email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

            // Sends the email    
            Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
            
        
            emailfund.Isclosed__c = true;
          //  update emailfund;
           Insert addEmail;
      }      
   }     
  update lst_TaxRcpt;     
        
        
}    




}
Hi,

Need inputs on how to parse below string and extract all the relevant information such as Source, Name etc.

Source: Web Visitor 
Name: Ravi Sharma 
Age of primary applicant: 9 


Email: test@yahoo.com 
Phone: 1234567 
Address: 10th Street 
City: Woodstock 
State: GA 
Comments: Test Comments 
I am still new to salesforce and I am getting the following error on my education hours object.  I don't know where to start looking for the problem.  Can somebody give me guidance on how to solve this issue.  Here is the error message: 

dlrs_c4g_Education_HoursTrigger: execution of AfterUpdate caused by: System.SObjectException: Invalid field c4g_Class_Hours__c for c4g_Education_Hours__c Class.dlrs.RollupService.handleRollups: line 817, column 1 Class.dlrs.RollupService.triggerHandler: line 311, column 1 Trigger.dlrs_c4g_Education_HoursTrigger: line 7, column 1
When I created my account on Trailhead, I clicked the Google sign in OAuth button to create my account. I'm going through a lot of modules. I got to a module where I need to learn how to install AppExchange apps in my Sandbox. When I attemp to install any apps, it asks me to authenticate and requires me to provide my login/password for my sandbox.

According to my sandbox my username is <myname>@<sandbox-name>.com

But I do not have a password. Since I signed up for an account using Google login, I was never asked to enter a password anywhere. So therefore I cannot login to authenticate to install any AppExchange apps.

I tried going into the sandbox into my user settings to change my password, but it requires me to type in my old password in order to change my password to something new. But since I never had a password to begin with, I can't do it!

I also tried creating a Salesforce login (complete with username and password). Then I went into the Trailhead settings and merged my two accounts together. This worked. However when I get to the sandbox authentication screen it doesn't appear to accept my Salesforce login for the sandbox. It only appears to want to accept my sandbox username and again, since I don't have a password and can't set one, I can't login.

Help. What do I do here?
Hi All, Please help!

I have the following scenario of at least four email address field on one object called Students
  1. Email1
  2. Email2
  3. Email3
  4. Email4
All with a LastModified date that captures the date on update of that particular email address. Please note the fields are named after the parent email address.On the following fields:
  1. Email1Date
  2. Email2Date
  3. Email3Date
  4. Email4Date
Formula fields to caculate the number of days the email was modified or created from today.Please note days are name after the parent date
  1. Email1Days
  2. Email2Days
  3. Email3Days
  4. Email4Days
A primary email address field:
  1. PrimaryEmail

The objective is to create a trigger that will loop through the number of days and find the lowest and then populate the Primary email address with a corresponding address. This  lowest number of days will mean the email is current therefore populate the primary address. However  the logic  should  also be able to  take into consideration when one or more number of days fields are blank. Please note they is always one or more addresses all the time. The logic should also exempt users who manually update the Primary email address field.

Many Thanks 


 
Hi,

I need to make the {!Opportunity.Name} a hyperlink to the record. How to accomplish this?


User-added image
i wan to fetch content from a zip file[json data] and dispaly it in lightning component. Json formatted zip file os uploaded standard files. that zip file content json data have to display it in lightning component. Any sample code for this.
Hi Salesforce Support and Forum Members,

I opened this link (https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_variables_global_action_valid_values.htm) and found that there are lots of interesting features which we can implement using the $Action global variable in VF pages but unfortunately there is no documentation on its usage and how we can leverage them in Visualforce.Since the actions specified in the above link seem quite useful , I would like to get some examples on how to use them or if there is any detailed documentation (with examples).

PLEASE BE ADVISED THAT I AM NOT LOOKING FOR SIMPLE ACTIONS SUCH AS EDIT or NEW BUT COMPLEX ONES SUCH AS GOOGLEMAPS,YAHOOWEATHER.

If you have implemented any of those then I would really appreciate your guidance.

Thanks,
Jitender
I don't recall receiving an email alert for the certification maintenance exams for Winter '16 on either Admin or Dev certs.  Googling for the training resources only revealed that others had noted the same.

To save others the time of hunting for the training material, it's here:
Winter ‘16 Developer Release Exam (http://certification.force.com/pkb/articles/Public_KB/Winter-16-Developer-Release-Exam/?q=winter+16&l=en_US&fs=RelatedArticle)
Winter ‘16 Administrator Release Exam (http://certification.force.com/pkb/articles/Public_KB/Winter-16-Administrator-Release-Exam/?q=winter+16&l=en_US&fs=RelatedArticle)

The modules are listed here:
Winter '16 Release Training for Certified Professionals (https://help.salesforce.com/HTTrainingModulesDetail?courseId=a1S300000032xGB)
(same for admin and dev)
Hi All,
          I want to send an email notification when account owner is changed. And also i want to send email notification to both old account owner and new account owner which has been changed. How to achieve this. Can anyone send me the code?
I have been reading "Understanding Testing in Apex".  In the section entitled Understanding Test Data, there is a sentence that reads "If a test makes a Visualforce request, the executing test stays in the test context but runs in a different thread, so test data isolation is no longer enforced."  This is interesting and I would like to write a test class that illustrates this concept to share with my coworkers, but I am perplexed by the very first clause of the sentence:  "If a test makes a Visualforce request...".  How does one do this?
I'm trying to find a plain english example of when to use double vs decimal as a data type. I understand that by default all currencies are decimal and I've looked at a bunch of the online documentation (and the apex workbook which has pretty good definitions), but it's still not clear to me. 

Can anyone give me some examples?  Thanks! Kieren
How to build "Yes and No" Buttons in Email template?Here My requrement was iam sending email template through Url.It was working fine.But now i nedd to change in that one.That is i want to add "yes and  No " buttons in that email template.when the reciepient click on "yes" button then the Case should be automatically close & status feild should be updated? Can any one help me plz?

Is there a way to query the names of all test classes that exist in my Org using the  Tooling REST API?