• Iqrar Ahmed
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Saleforce developer
  • Beyond Vision

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 5
    Questions
  • 38
    Replies
We've created Visualforce site through which users donate donations. This VF site is open up using another wordpress site by clicking donate button which is https://www.abc.com/. Our SEO required to both site run on same domain because Google policy does not allow us to run ads directly on the first URL as the display URL (https://abc.secure.force.com) and the landing page URL (https://www.abc.com) are both different, therefore we've already created custom domain http://donate.abc.com/ in SF by creating a CName record in abc.com Cpanel and set it on donate button link but by clicking button, It always redirecting fromhttp://donate.abc.com/ to https://abc.secure.force.com/ which is salesforce default web address.

Now we've created another CNAME record 'www.abc.com.00d23430430340doigdfaw.live.siteforce.com' but when we're trying to create custom domain with name www.abc.com, then it's showing following error. 

Error: Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name www.abc.com uses www.abc.com.00d23430430340doigdfaw.live.siteforce.com as its CNAME target and try again later. 

FYI: We're following this documentationhttps://help.salesforce.com/HTViewSolution?id=000205653&language=en_US
Hi to All,

I am experienced salesforce developer and consultant having lots of experience using Visualforce, Apex, Workflows, Data migration,Integrations, Soql, Sosl, Jquery, angularjs, Bootstrap, Visualforce remoting, Chatter Api, JitterBit Dataloader, Apex Dataloader and also core knowledge of administration task in salesforce plus i have also lots of expertise in .Net platform.

I'll do this for you in short quotes. For more information contact me on iqrarhingora@gmail.com

Regards
IQRAR AHMED
Senior Salesforce Developer and Consultant
Hi to all,

I am currenlty printing a number PDF recipts at a time for our donation managment system by rendering visualforce page as pdf, now i have requirment that i want to print these bulk recipts using mail merge in word document and also I have diffrent types of reciepts i want to change mail merge templates on vriety of conditions. I want to know can i access mail merge functionality in Apex, if yes then please give me authentic documentation.

Please help me regarding this.  
Hi to all 
I have idea in my mind to create app that show red and hot spot  (traffic problems,Bad Law and order situation) Basically this app will be based on internet of things that will prcieved information from social media or information manually by each running user and then when user is own is way the app will detect user location and according to infromation contain in salesforce cloud it direct  user to what to do.

Regards
IQRAR AHMED
Senior Salesforce/.Net Developer 
This shown what actually i wantHi, I want to embed 3 custom object with standard chatter ui and want to perform same operation as other item like group and files do e.g when we click on group the group related to user is shown in middle in the same way i want that when user will click on document item the document related to user should be shown in middle and when click app the app assign to user in custom object tab should be shown in middle.please can anyone can guid me how to do this.If standard ui is not editable in any way so can anyone tell me that how to create visualforce page same like chatter and also contain same functionality like chatter.or give me anyother solution to achive this task.

Thanks.
We've created Visualforce site through which users donate donations. This VF site is open up using another wordpress site by clicking donate button which is https://www.abc.com/. Our SEO required to both site run on same domain because Google policy does not allow us to run ads directly on the first URL as the display URL (https://abc.secure.force.com) and the landing page URL (https://www.abc.com) are both different, therefore we've already created custom domain http://donate.abc.com/ in SF by creating a CName record in abc.com Cpanel and set it on donate button link but by clicking button, It always redirecting fromhttp://donate.abc.com/ to https://abc.secure.force.com/ which is salesforce default web address.

Now we've created another CNAME record 'www.abc.com.00d23430430340doigdfaw.live.siteforce.com' but when we're trying to create custom domain with name www.abc.com, then it's showing following error. 

Error: Salesforce.com can't validate the domain. The CNAME record may still be processing (which can take up to 24 hours), or the domain may not belong to you. Make sure the domain name www.abc.com uses www.abc.com.00d23430430340doigdfaw.live.siteforce.com as its CNAME target and try again later. 

FYI: We're following this documentationhttps://help.salesforce.com/HTViewSolution?id=000205653&language=en_US
International company looking for experienced Admin or Developer for multiple projects. Must have experience with Visual Force pages, the ability to build custom applications and experience with Community. 

Projects include
-Custom buttons
-Custom Objects
   - Time Tracking
   - Task Management/Checklists
   - Automated Proposals/Invoicing
-Client facing Community
   - Task Management/Checklists
   - Account Hierarchy 
 
 
Looking for a change? Be a part of our Client's unique work environment and utilize and build on your skills as a Salesforce Developer/Admin!

This person will be the main point of contact for Salesforce and support sales and finance departments.  Work on everything from setting up new users and training to workflows, analytics and third party tool integration. Position is in San Francisco, CA
If interested, email: nancy@tech2resources.com
More info: http://jobs.tech2resources.com/Salesforce-Developer-Admin-Jobs-in-San-Francisco-CA/3226736
 
Hone your Salesforce Admin skills during this 6-12 Month on-site contract with one of our best clients in downtown DC!  You'll need excellent organizational skills and a desire to solve problems with a can-do attitude.  This position will involve data cleanup and basic Salesforce admin duties - profiles, workflows, security, etc. 
- See more at: http://jobs.tech2resources.com/index.smpl?arg=jb_details&POST_ID=3225635#sthash.t3TJMRa5.dpuf
Hi,

How to write a test class for trigger which calls @future method

for eg.
trigger AccountCallout on Account (after insert) {
for (Account a : Trigger.new) {
WebServiceCallout.sendNotification(a.Id);
}
}
 
  • January 21, 2015
  • Like
  • 0
Hi,

Can any one help me on REQUEST_RUNNING_TOO_LONG error? Why we get this error and how we can resolve this error?

Thank you,
Amit

Note: I have received following error when i tried to run validation against production:
Running test: DemoTestClass, time spent on that test: 21750ms, total time spent running tests: 1764079ms. Error: REQUEST_RUNNING_TOO_LONG: Your request was running for too long, and has been stopped.
Hi,
Can any one help me in modifying the following statment. I want a hyperlink under Team_Member__r.Name but i am not getting that. Please guide me. Thanks in advance!

mail.setPlainTextBody('This Message is to alert you that the Event Team Member named' + <a href ="https://cs8.salesforce.com/a0CL000000AnoUk" > eTMMap.get(eTM.Id).Team_Member__r.Name </a> + 'has been created/updated.');
Hi,

I currently have an SOQL query that gets a list of users who are of a specific profile and are active, which looks like this:
[SELECT Id, Name FROM User WHERE Profile.Name = 'Pollinators' AND IsActive = TRUE ORDER BY Name ASC]

This list is used to populate a dynamic picklist that managers user to access filtered reports. However, my business is expanding into new cities and so I want to also filter this list by showing only users who are in the same city as the manager.

I figured the best way to do this is to match the City field value on the User's record page. Upon doing some reading, I found a list of UserInfo Methods, and I can't see anything in there for City.

Can anyone help with how I might acheive this?
Thanks
 
  • January 21, 2015
  • Like
  • 0
Hi,
My Trigger is to update the Oppty 'Next_Activity__c' Field with the Task Subject based on First Open Activity(ActivityDate). Now the below trigger is updating the field when the task is inserted but not when the task was updated or deleted.

Ex : If I created a task1 with subject ='xyz' and  due date 20/1/2015
                          task2 with subject ='abc' and  due date 21/1/2015
then the Next_Activity__c = 'xyz' but when I am deleting task1 it has to update the Next_Activity__c with 'abc' but it is not doing so. Can any one help me in finding the problem.

trigger UpdateOppNextActivtyTrigger on Task (after insert,after update) {
  List<Id> idSet = new List<Id>();
   
  for (Task att: Trigger.new) {
     if ((att.WhatId + '').startsWith('006')) {
       idSet.add(att.WhatId);
      }
   }
   List<Opportunity> updateList = new List<Opportunity> (); 
   List<RecordType> rtList = [Select Id,Name from RecordType where SObjectType = 'Opportunity'and Name = 'van Wagenen' Limit 1];
   for (opportunity o: [Select RecordTypeId,Next_Activity__c, (select id,RecordType.Name, subject from Tasks where RecordType.Name='van Wagenen' order by ActivityDate asc limit 1) from Opportunity where id in : idSet ]){ 
       if (o.recordTypeId ==rtList[0].Id&&o.Next_Activity__c != o.tasks[0].subject&&o.tasks.size()>0) {         
           System.debug('Next Activity:'+o.Next_Activity__c);
           System.debug('Task Subject Before Update:'+o.tasks[0].subject);
           o.Next_Activity__c = o.tasks[0].subject;
           System.debug('Next Activity:'+o.Next_Activity__c);
           System.debug('Task Subject Before Update:'+o.tasks[0].subject);
           
           updateList.add(o);
           System.debug('Next Activity:'+o.Next_Activity__c);
           System.debug('Task Subject Before Update:'+o.tasks[0].subject);
       }
      
  }   
    update updateList;  
 }
HI,
My logic is like if(userprofile=="systemadminstrator") then do something....

But one of my clients is having french language settings, so my logic is getting failed can anyone help me in getting out of it....
 
I have a large VF email. As part of it I have put in some different fonts, also the table has some visibility rules.

When sending the test, it is ignoring the font I have chosen, when forwarding the email on the visibility rules seem to be completely ignored.

Here is the code, apologies for the length. As you can see, just clumps of tables. The Apex Repeat ones have visibility rules in there, the body is meant to make everything send in Calibri. As it stands, it comes through as Times New Roman, plus reply/forward causes a whole host of stuff to be displayed - essentially everything in the Apex Repeat I have asked to be invisible.

Can I get around this? Have I coded this poorly? I needed to do something quickly and without Apex Controllers/VF Components, as such, the solution has to be the same too - I don't have the skills to do that.

Thanks!
 
<messaging:emailTemplate recipientType="User"
  relatedToType="Account"
  subject="Onboarding Email: {!relatedTo.name}"
  replyTo="simonwhight@citation.co.uk">
  <messaging:htmlEmailBody >
    <html>
      <body>
        <STYLE type="text/css">
          CAPTION {font-size: 24px; font-face: CALIBRI }
          TH {font-size: 14px; font-face: CALIBRI; color: #FFFFFF ; font-weight: bold; background: #86878C;
               border-width: 1;  text-align: center }
          TD  {font-size: 12px; font-face: CALIBRI }
          TABLE {border: solid #CCCCCC; border-width: 1}
          TR {border: solid #CCCCCC; border-width: 1}
          P {margin: 0em;}
        </STYLE>
        <font face="CALIBRI" size="2">

<!--Table 1 **************************************************************************************-->
         
   
         <table border="1" width="1200px" >
           <col width="400"/>
           <col width="400"/>
           <col width="400"/>           
           <caption>Client onboarding email for: {!relatedTo.Name}</caption>
          <tr>
           <th>Business Type</th>
           <th>Renewal Type</th>
           <th>Affinity</th>
          </tr>
          <tr>
           <td width="400"/>
           <td width="400"/>
           <td width="400"/>          
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">
            <td align="center">{!ctrtx.Business_Type__c}</td>
            <td align="center">{!ctrtx.Renewal_Type__c}</td>
            <td align="center">{!ctrtx.Affinity__c}</td>
           </tr>
           </apex:repeat> 
        </table>  

        
<!--Table 2 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>      
           <tr>
            <th>Account Name</th>
            <th>Trading As Name</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>              
          <tr>      
            <td align="center">{!relatedTo.name}</td>
            <td align="center">{!relatedTo.Trading_As_Name__c}</td>
          </tr>
        </table>           
          
<!--Table 3 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="1200"/>  
           <tr>
            <th>Address</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>  
          <tr>      
            <td align="center">{!relatedTo.BillingStreet}</td>
          </tr>
          <tr>      
            <td align="center">{!relatedTo.BillingCity}</td>
          </tr>
          <tr>      
            <td align="center">{!relatedTo.BillingState}</td>
          </tr>
          <tr>      
            <td align="center">{!relatedTo.BillingPostalCode}</td>
          </tr>
        </table>           

<!--Table 4 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>      
           <tr>
            <th>Telephone Number</th>
            <th>Website</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <tr>      
            <td align="center">{!relatedTo.phone}</td>
            <td align="center">{!relatedTo.website}</td>
          </tr>
        </table> 
        
<!--Table 5 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>      
           <tr>
            <th>Industry</th>
            <th>Sector</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <tr>      
            <td align="center">{!relatedTo.Industry}</td>
            <td align="center">{!relatedTo.Sector__c}</td>
          </tr>
        </table>         
      
<!--Table 6 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>      
           <tr>
            <th>Total Number Of Employees</th>
            <th>Total Number Of Sites</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <tr>      
            <td align="center">{!FLOOR(relatedTo.Total_Employees__c)}</td>
            <td align="center">{!FLOOR(relatedTo.Sites__c)}</td>
          </tr>
        </table>
        
<!--Table 7 **************************************************************************************-->  
        
         <table border="1" width="1200px" >
           <col width="400"/>
           <col width="400"/>
           <col width="400"/>        
           <tr>
            <th>FT Employees</th>
            <th>PT Employees</th>
            <th>Subcontractors</th>
          </tr>
          <tr>
           <td width="400"/>
           <td width="400"/>
           <td width="400"/>
          </tr>              
          <tr>      
            <td align="center">{!FLOOR(relatedTo.FT_Employees__c)}</td>
            <td align="center">{!FLOOR(relatedTo.PT_Employees__c)}</td>
            <td align="center">{!FLOOR(relatedTo.Subcontractors__c)}</td>
          </tr>
        </table>                 
      
<!--Table 8 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>
           <caption>Deal Overview</caption>
           <tr>
            <th>Contract Term (months)</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
           <td align="center">{!ctrtx.ContractTerm}</td>
           </tr>
          </apex:repeat> 
        </table>
        
<!--Table 9 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>
           <tr>
            <th>BDM</th>
            <th>Date Signed</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center">{!ctrtx.CompanySigned.Name}</td>
            <td align="center">  <apex:outputText value="{0,date,dd/MM/yyyy}">
                  <apex:param value="{!ctrtx.CompanySignedDate}" /> 
                  </apex:outputText>  </td>
          </tr>
          </apex:repeat> 
        </table>                     
      
<!--Table 10 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>
           <tr>
            <th>Customer Signed By</th>
            <th>Position</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center">{!ctrtx.CustomerSigned.Name}</td>
            <td align="center">{!ctrtx.CustomerSignedTitle}</td>
          </tr>
            </apex:repeat> 
        </table>         
      
<!--Table 11 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>
           <tr>
            <th>Contract Start Date</th>
            <th>Contract End Date</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center">  <apex:outputText value="{0,date,dd/MM/yyyy}">
                  <apex:param value="{!ctrtx.StartDate}" /> 
                  </apex:outputText>  </td>
            <td align="center">  <apex:outputText value="{0,date,dd/MM/yyyy}">
                  <apex:param value="{!ctrtx.EndDate}" /> 
                  </apex:outputText>  </td>
          </tr>
            </apex:repeat> 
        </table> 
        
<!--Table 12 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>
           <caption>Services Purchased</caption>           
           <tr>
            <th>EL&amp;HR</th>
            <th>H&amp;S</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center">{!IF(ctrtx.Services_Taken_EL__c=TRUE,"Yes","No")}</td>            
            <td align="center">{!IF(ctrtx.Services_Taken_HS__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table>                 
      
<!--Table 13 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>       
           <tr>
            <th>A&amp;I only EL&amp;HR</th>
            <th>A&amp;I only H&amp;S</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">        
            <td align="center">{!IF(ctrtx.Services_Taken_AI_Only__c=TRUE,"Yes","No")}</td>            
            <td align="center">{!IF(ctrtx.Services_Taken_AI_Only_HS__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table>       

<!--Table 14 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>       
           <tr>
            <th>Advice Only EL&amp;HR</th>
            <th>Advice Only H&amp;S</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center">{!IF(ctrtx.Services_Taken_Advice_Only__c=TRUE,"Yes","No")}</td>            
            <td align="center">{!IF(ctrtx.Services_Taken_Advice_Only_HS__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat>           
        </table>      
      
<!--Table 15 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>       
           <tr>
            <th>Small Business Package</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center">{!IF(ctrtx.Services_Taken_SBP__c=TRUE,"Yes","No")}</td>            
          </tr>
            </apex:repeat> 
        </table> 
        
<!--Table 16 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/> 
           <caption>Other Service</caption>        
           <tr>
            <th>JIT Tribunal</th>
            <th>Fire Risk Assessments</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>            
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">     
            <td align="center">{!IF(ctrtx.Services_Taken_JIT__c=TRUE,"Yes","No")}</td>            
            <td align="center">{!IF(ctrtx.Services_Taken_FRA__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table> 

<!--Table 17 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>      
           <tr>
            <th>Training</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center">{!IF(ctrtx.Services_Taken_Training__c=TRUE,"Yes","No")}</td>            
          </tr>
            </apex:repeat> 
        </table> 
        
<!--Table 18 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>      
           <tr>
            <th>Consultancy</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center">{!IF(ctrtx.Services_Taken_Consultancy__c=TRUE,"Yes","No")}</td>            
          </tr>
            </apex:repeat> 
        </table>         
      
<!--Table 19 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>       
           <tr>
            <th></th>
            <th>Business Defence</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>            
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center"></td>            
            <td align="center">{!IF(ctrtx.Business_Defence__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table> 
      
<!--Table 20 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>       
           <tr>
            <th></th>
            <th>Environmental</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center"></td>            
            <td align="center">{!IF(ctrtx.Services_Taken_Env__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table> 

<!--Table 21 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="600"/>
           <col width="600"/>       
           <tr>
            <th></th>
            <th>eRAMS</th>
          </tr>
          <tr>
           <td width="600"/>
           <td width="600"/>
          </tr>  
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center"></td>            
            <td align="center">{!IF(ctrtx.Services_Taken_eRAMS__c=TRUE,"Yes","No")}</td>
          </tr>
            </apex:repeat> 
        </table> 
        
<!--Table 22 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>
           <caption>Terms &amp; Sales Notes</caption>        
           <tr>
            <th>Finance Notes</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">        
            <td align="center">{!ctrtx.Finance_Notes__c}</td>            
          </tr>
            </apex:repeat> 
        </table> 

<!--Table 23 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>     
           <tr>
            <th>Special Terms</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">         
            <td align="center">{!ctrtx.SpecialTerms}</td>            
          </tr>
            </apex:repeat> 
        </table> 
        
<!--Table 24 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>     
           <tr>
            <th>EL&amp;HR Notes</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">      
            <td align="center">{!ctrtx.PEL_Notes__c}</td>            
          </tr>
            </apex:repeat> 
        </table>    
        
<!--Table 25 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="1200"/>     
           <tr>
            <th>H&amp;S Notes</th>
          </tr>
          <tr>
           <td width="1200"/>
          </tr>
          <apex:repeat var="ctrtx" value="{!relatedTo.Contracts}">                    
          <tr style="display:{!IF(ctrtx.LatestContract__c=false, 'None', '')}">       
            <td align="center">{!ctrtx.H_S_Notes__c}</td>            
          </tr>
            </apex:repeat> 
        </table>  
        
<!--Table 26 **************************************************************************************-->
         
          <table border="1" width="1200px" >
           <col width="65"/>
           <col width="240"/>
           <col width="240"/>           
           <col width="240"/>
           <col width="220"/>
           <col width="65"/>           
           <col width="65"/>   
           <col width="65"/>  
           <caption>Contacts and Users</caption>
           <tr>
            <th>Salutation</th>
            <th>Name</th>
            <th>Job Title</th>
            <th>Email Address</th>
            <th>Telephone No</th>
            <th>Super?</th>
            <th>EL&amp;HR?</th>
            <th>H&amp;S?</th>
          </tr>
          <tr>
           <td width="65"/>
           <td width="240"/>
           <td width="240"/>           
           <td width="240"/>
           <td width="220"/>
           <td width="65"/>           
           <td width="65"/>   
           <td width="65"/> 
          </tr>
        <apex:repeat var="conx" value="{!relatedTo.Contacts}">  
          <tr>
            <td align="center">{!conx.Salutation}</td>
            <td align="center">{!conx.Name}</td>
            <td align="center">{!conx.Title}</td>
            <td align="center">{!conx.email}</td>
            <td align="center">{!conx.phone}</td>
            <td align="center">{!conx.Online_Super_User__c}</td>
            <td align="center">{!conx.Helpline_PEL__c}</td>
            <td align="center">{!conx.Helpline_H_S__c}</td>
          </tr>
        </apex:repeat> 
        </table>               
      
<!--Table 27 **************************************************************************************-->
         
         <table border="1" width="1200px" >
           <col width="200"/>
           <col width="200"/>
           <col width="200"/>  
           <col width="200"/>
           <col width="200"/>
           <col width="200"/>
           <caption>Sites</caption>
           <tr>
            <th>Street</th>
            <th>City</th>
            <th>County</th>
            <th>Postcode</th>
            <th>Telephone No</th>
            <th>Site Type</th>
          </tr>
          <tr>
           <td width="200"/>
           <td width="200"/>
           <td width="200"/>  
           <td width="200"/>
           <td width="200"/>
           <td width="200"/>
          </tr>
        <apex:repeat var="sitex" value="{!relatedTo.Sites__r}">  
          <tr>
            <td align="center">{!sitex.Street__c}</td>
            <td align="center">{!sitex.City__c}</td>
            <td align="center">{!sitex.County__c}</td>
            <td align="center">{!sitex.Postcode__c}</td>
            <td align="center">{!sitex.Phone__c}</td>
            <td align="center">{!sitex.Site_Type__c}</td>
          </tr>
        </apex:repeat> 
        </table> 
      
        </font>
      </body>
    </html>
  </messaging:htmlEmailBody>
 </messaging:emailTemplate>

 
I need Some Dumps for Dev401 certification. Give some ideas to achieve it.

THanks


 
Hi,
I have created one VF page which allows users to create schedule on Daily, Weekly and Monthly basis, which is working perfectly fine, now I am trying to add option of Start Date and End Date for all schedule i.e. I want to give ability to user that he/she can start schedule on specific day and can end on specific day for e.g. the Schedule is Daily, Start Date is 01/Jan/2015 and End Date is 05/Feb/2015 then the schedule must be executed for 36 times (01 Jan to 05 Feb) and after 05th Feb the schedule must be terminated
If anyone knows how to do this using Apex please help me
Thanks
Nirav
I want to remove a report and dashboard folder sharing access for users  of particaular profile.I don't see any way do that in salesforce and analytics doesn't seem to be too flexible in salesforce.Could anybody suggest how to restrict access to a report folder for users of particular profile. 
Any good  suggestion is appreciable. Thanks.
 
Hi,

I have a log file in my system. I need to upload that file to salesforce and then send an email to client by attaching that file. Please suggest me the approach to do this. Also,the file should be stored in salesforce

Thanks,
Ganesh
Hi folks,
I need a help from you, in my project there is a need to send csv files from salesforce to third  party client(java technology). For this we are using REST PUT service, and to connect and to send csv files from salesforce I coded as specifed below, I am getting the following error which is taken from my debug log file
DEBUG|System.HttpResponse[Status=Unsupported Media Type, StatusCode=415]

and the code is
     RESTInfo__c ri = RESTInfo__c.getInstance('cart');
            HttpRequest req = new HttpRequest();
            string url = ri.endpoint__c; // I mentioned endpoint url in custom settings
            req.setMethod('PUT');
            req.setEndpoint(url);
           // req.setHeader('Content-Type', ri.content_type__c ); //req.setHeader('content-type', 'application/csv');
            req.setHeader('email', ri.email__c);  //I mentioned endpoint email & password in custom settings
            req.setHeader('password', ri.password__c);  
            req.setHeader('carttype', ri.carttype__c);  
            req.setHeader('accountId', accMap.get(i).Account_ID__c); 
            req.setHeader('Content-Type', 'application/json');
            //req.setHeader('input', 'cart,cartcsv');
            req.setBody(cartCsv); 
            Http http = new Http();
            try {
                
                HTTPResponse res = http.send(req);
                System.debug('The response::::'+res);
                System.debug(res.toString());
                System.debug('STATUS:'+res.getStatus());
                System.debug('STATUS_CODE:'+res.getStatusCode());
                if(res.getStatus() != '200'){
                    isError = true;
                }
                
            }catch(System.CalloutException e) {
                system.debug('The exception :::'+e);
                isError = true;
                system.debug('Making error flag as true ::isError-'+isError);

Thanks in Advance

Hello All,

 

I am getting an issue while updating user object from Gold Partner User profile. This issue will come after winter 14 salesforce upgrade. Previously it is working fine. Please let me know if you have workaround for this issue. Tried with without sharing in the class level and other ways to overcome the issue but could't find the fix.

 

Sample Code:

@future  
    public static void disableUser(Set<ID> userIds)
        {     
       
  List<User> lstusers = [Select id from User where id in: userIds];
           
            for(User u : lstusers)
                {
                   u.isActive = false;
                
   }
            update lstusers;//throwing error

 

From Debug log:

04:31:04.056 (56044017)|EXCEPTION_THROWN|[708]|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:31:04.056 (56953655)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

  • November 19, 2013
  • Like
  • 0

I am following the 300: Code Custom App Logic tutorial in the Force.com workbook, but after compiling the Apex Class and running the anonymous code. The result for the Line Item number order whithin an invoice remains the same.

 

The  anonymous code. is:

String s = InvoiceUtilities.renumberLineItems('INV-0004');

 

The apex Class is:

 

public class InvoiceUtilities {

    // class method to renumber Line Items for a given Invoice number
    // returns a string that indicates success or failure
    public static String renumberLineItems(String invoiceName) {

    // create a copy of the target Invoice object and it's Line Items
    Invoice__c invoice = [Select i.Name, (Select Name From Line_Items__r ORDER BY Name) 
                            From Invoice__c i 
                           Where i.Name = :invoiceName LIMIT 1];

    // loop through each Line Item, renumbering as you go
    Integer i = 1;
    for (Line_Item__c item : invoice.Line_Items__r) {
      item.Name = String.valueOf(i);
      System.debug(item.Name);
      i++;
    }

    // update the Line Items in one transaction, rollback if any problems
    // and return error messages to the calling environment
    try {
      database.update(invoice.Line_Items__r);
    }
    catch (DmlException e) {
      return e.getMessage();
    }

    // on success, return a message to the calling program
    return 'Line items renumbered successfully.'; 
  }
}

 

 

Can someone help me on this. Any help would be much appreciated.

I have developed a site. I want to change the domain name of this site to be same as our actual website 

For eg.

My site domain name is : mycompany.force.com

and my website domain name is mycompany.com

So now I would like to change mycompany.force.com to mycompany.com

 

I tried to look into the Site URL rewriter class example, but I dint understand it clearly.

This example shows to rewrite the  path names

 

Please help and it will be great if you can give me some example codes

  • August 17, 2010
  • Like
  • 0
Hi all ,
          I have a requirement that i need to to display all Contacts and Leads of our Organization on Google maps using Single Visualforce page to track All Contacts and Leads from Current Location, Here i displayed all Leads from current location but i need to display All Contacts also for the same Page if any one knows pls help

Here is my code

Class:
--------
global with sharing class LeadsNearbyMe {

public Lead leads{get; set;}

@RemoteAction
   global static List<Lead> getNearby(String lat, String lon) {

        if(lat == null || lon == null || lat.equals('') || lon.equals('')) {
            lat = '51.096214';
            lon = '3.683153';
        }

        String queryString =
            'SELECT Id, Name, Location__Longitude__s, Location__Latitude__s, ' +
                'Street, City,State,Country, PostalCode ' +
            'FROM Lead ' +
            'WHERE DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'km\') < 60 ' +
            'ORDER BY DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'km\') ' +
            'LIMIT 25';
        return(database.Query(queryString));
    }
}

Page:
--------

<apex:page sidebar="false" showheader="false" controller="LeadsNearbyMe">
 
  <apex:includeScript value="{!$Resource.googleMapsAPI}" />
      <script type="text/javascript"
        src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCROH4OR9fzDhmprWPL1wGWfPT4uGUeMWg&sensor=false">
        </script>
        
    <!-- Setup the map to take up the whole window -->
    <style>
        html, body { height: 100%; }
        .page-map, .ui-content, #map-canvas { width: 100%; height:100%; padding: 0; }
        #map-canvas { height: min-height: 100%; }
    </style>
    
    <script>
        function initialize() {
            var lat, lon;
          
             if (navigator.geolocation) {
                 navigator.geolocation.getCurrentPosition(function(position){
                     lat = position.coords.latitude;
                     lon = position.coords.longitude;                    
                     
                     // Use Visualforce JavaScript Remoting to query for nearby conts      
                     Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.LeadsNearbyMe.getNearby}', lat, lon,
                         function(result, event){
                             if (event.status) {
                                 console.log(result);
                                 createMap(lat, lon, result);           
                             } else if (event.type === 'exception') {
                                 //exception case code          
                             } else {
                                            
                             }
                          },
                          {escape: true}
                      );
                  });
              } else {
                  // Set default values for map if the device doesn't have geolocation capabilities
                    /** Eindhoven **/
                    lat = 51.096214;
                    lon = 3.683153;
                    
                    var result = [];
                    createMap(lat, lon, result);
              }
          
         }
    
         function createMap(lat, lon, leads){
            var currentPosition = new google.maps.LatLng(lat,lon);
            var mapDiv = document.getElementById('map-canvas');
            var map = new google.maps.Map(mapDiv, {
                center: currentPosition,
                zoom: 13,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });
            
            // Set a marker for the current location
            var positionMarker = new google.maps.Marker({
                map: map,
                position: currentPosition,
                title: 'You are here',
            });
            
            // Keep track of the map boundary that holds all markers
            var mapBoundary = new google.maps.LatLngBounds();
            mapBoundary.extend(currentPosition);
            
            // Set markers on the map from the @RemoteAction results
            var cont;
            for(var i=0; i<leads.length;i++){
                cont = leads[i];
                console.log(leads[i]);
                setupMarker();
            }
       map.fitBounds(mapBoundary);

           function setupMarker(){
                var contNavUrl;
           
                try{
                    if(sforce.one){
                        contNavUrl =
                            'javascript:sforce.one.navigateToSObject(\'' + cont.Id + '\')';
                    }
                } catch(err) {
                    console.log(err);
                    contNavUrl = '\\' + cont.Id;
                }
                
                var contDetails =
                    
                    cont.Name + ',' +
                    cont.Street + ',' +
                    cont.City + ',' +
                    cont.PostalCode;
           var marker = new google.maps.Marker({
                   map: map,
                   icon : "{!URLFOR($Resource.GoogleMarkers, 'GoogleMark/4-l.png')}",
                   title:contDetails,
                   position: new google.maps.LatLng(
                                   cont.Location__Latitude__s,
                                   cont.Location__Longitude__s)
               });
               mapBoundary.extend(marker.getPosition());
           }
                  
           }
 
        google.maps.event.addDomListener(window, 'load', initialize);
        
    </script>
<body style="font-family: Arial; border: 0 none;">
 
        <div id="map-canvas"></div>
    </body>
 
</apex:page>


Screen shot:
------------------

User-added image


Thanks & Regards,
  • January 07, 2015
  • Like
  • 2
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?
Hi all,
we have reached 64% in Data Storage, Is there any possibilities to Archive records?
There are 2 possibilities to solve this problem.
One way is to puchase additional sapce from salesforce
and anothere one is to backup our records and delete them.
Please tell me is there any other methods avalibale to resolve this issue.
Please send me the link.
Thanks and Regards 
S Mohan
Hi All,

When i click on any row using onrowclick function in apex:pageBlockTable. I am able to select the row using javascript functionality but i am not able to get the selected row data to from vf page to controller/avascript to populate selected row data in alert box.

Can any one help me How to get selected row data in controller? 

Please find the vfpage and controller

Visualforce Page
 
<apex:includeScript value="{!URLFOR($Resource.jquery,'/js/jquery-1.4.2.min.js')}" /> 
<script> $j = jQuery.noConflict(); 
var lastRow; 
var sample = document.getElementById('Name').value; 
var firstname1 = document .getElementById('{!$Component.form.pageBlockContact.Name}').value; 
function highlight(elem)
{ if(lastRow != undefined)
lastRow.style.backgroundColor = 'white';
elem.style.backgroundColor = 'yellow'; lastRow = elem;
alert('DDDD'+firstname1 );
alert('DDDDDDD'+sample); 
} 
</script>
<apex:form id="form"> 
<apex:pageBlock id="pageBlockContact"> 
<apex:pageBlockSection columns="1"> 
<apex:pageBlockTable value="{!list1}" var="item" rules="rows" id="example" onRowClick="clickElem(this);"> 
<apex:column value="{!item.Name}" id="Name" styleclass="name" /> 
</apex:pageBlockTable> 
</apex:pageBlockSection>
<apex:commandButton action="{!ok}" value="ok" /> 
</apex:pageBlock>
</apex:form>
</apex:page>

Controller
 
public class SampleController {

    public PageReference ok() {
        return null;
    
    }
    
    public List<Claims__c> list1 { get; set; }

   
    public SampleController ()
{
   list1 = [select id,name from claims__c];
}

}

Output: Based on above vf page and controller
User-added image
  • January 02, 2015
  • Like
  • 1
Hi,

I want to iterate though the records of Account object inside a trigger of another Object. I tried to do it as follows,

trigger CCTriggerToUpdateAccounts on CC__c (before insert, before update) {
    List<Account> accountList = [SELECT MyField__c FROM Account];
    CC__c[] configs = Trigger.new;
    
    for (Configuration__c c :configs){
        for(Account a: accountList){
            a.Sync_to_AG__c = c.CCID__c;
        }
        update accountList;
    }
}

It works. But The Account iteration goes for several times. I only have 1 Account in my list. 

How can I make it to iterate according to the number of records in the Account object?

Please Help me. Thank you very much in advance.