• Balaji Chowdary Garapati
  • PRO
  • 2059 Points
  • Member since 2014
  • Sr. Salesforce Developer


  • Chatter
    Feed
  • 70
    Best Answers
  • 0
    Likes Received
  • 8
    Likes Given
  • 2
    Questions
  • 336
    Replies
Hi,
I have a class that is grabs Opportunities, places them into a csv file, and then sends an email to a particular email address. 

There is a Opportunity.CustomField1 which is a text field that can is populated as such:
  • Test, Test, Test,
  • Test; Test; Test;
Because I am creating csv file the string cannot have a comma in it other it throws off the csv file.

I tried doing this but failed

String x = Op.CustomField1;
x.replaceAll(',', ';');

Essentially when the CustomField1 has semicolon (;) character everything works fine, but when there is a comma (,) to separate the values, then the CSV file is messed up because the columns are not aligned properly.

How can I use x.replaceAll() to replace all commas with a semicolon in the customField1?
  • March 27, 2015
  • Like
  • 0

Hey guys, 

I have to work on the following project: 

An external button calls a REST Webservice and sends an ID. This ID is the trail to the user which called the button. Now I need to generate a .pdf with the user information. This .pdf then needs to be send to three different e-mail addresses, of which one has a different body. All of this needs to be done programmatically, so that the user only presses a button, and the rest is done automatically.

 

I found a huge documentation about REST Webservice, so I don't need a start here. But I can't find a documentation on how to generate a .pdf all by code and send this via email. All I could find is .pdf in combination with a visualforce page. Does someone have a nice tutorial on generating a .pdf by code only and sending it via mail? 

Thanks in advance!

I am going to schedule a job in our production env.
What it does is to assign opportunity owner to current owner's manager if the Opportunity has no activities for the past 5 days.

Since it is production env, our product manager will change my profile to a admin to run the job. After I set the shedule job, my profile will become devopler which does not have much access and basically not able to change Opportunity Owner.

My question is, when scheduled job runs everyday, does it still based on my current profile? Or it does not matter what my profile is.
 

This is my code:-

public class DispatcherContactNewController {

    public DispatcherContactNewController(ApexPages.StandardController controller) {
        this.controller = controller;
    }
   
    public PageReference Redir() {

        PageReference newPage;
        PageReference standardpage = New PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=012900000011wvV&ent=Lead&nooverride=1');
        
        RecordType r;
        r = [Select developerName from RecordType Where SobjectType='Lead' And id = :ApexPages.currentPage().getParameters().get('RecordType')];
        
        if ( r.developerName == 'LeadVisualforcePage') {
        
        System.debug('----------------------------------------------------------------------');
        
            newPage = Page.leadtask;
            
            return newPage;
        } else {
        
         System.debug('**********************************************************************');
         
         return standardpage;
        }

    }

    private final ApexPages.StandardController controller;
}

Hi Guys,

Forgive me if I'm missing the blatantly obvious here, I'm still relatively new. I would like to have the validation rule below apply only when the field is not blank, I've been having trouble constructing the right syntax to achieve this.

NOT(BEGINS(Phone,"00")) || NOT(ISNUMBER(Phone)) || CONTAINS(Phone,".")

Any help is much appreciated

Thanks

Hi All,

I am looking to implement a custom button which will be visible on the detail page of an object - let's say the Contacts object. When this button is pressed, I want to have data go from the Contacts record through a RESTful web service call and have a unique value returned. The user would not be redirected to a new page and the returned value would be used in setting a custom field on the Contacts screen.

Is something like this possible or do I have to create a middle VisualForce layer which will take information from a referenced Contact ID, pass data along through the web service, set and save the returned value, and then redirect the user back to the referenced Contact ID?

Ideally I would like this process to work no matter the Salesforce object if at all possible.

Thanks,
-Michael
I have a custom object with a lookup field (to another custom object) called Listing and a formula field that returns text.  

I thought that both of these were searchable fields, but they do not appear to be.  Is that correct?
Hello,

I would like to write an Apex Trigger on the Task Object that will populate a date field on the Account Object with the Created Date of the Last Activity With a Status of Completed and a Subject of Completed Call.

Anyone have any ideas on how to approach this.
Hello,

I'm trying to get test coverage for the below code.  Can anyone help?  I don't know where to start.  Thanks!
public class referralpage {
public String getReferer()
{
    return ApexPages.currentPage().getHeaders().get('referer');
}
}

 
Hi guys can you please help me to write a Trigger to Auto create child Record when new parent record is created 
I have custom Object as Order__c and I have it's child Object asTax Details__c. I have a lookup field of Account and Country__c Picklist Custom Field on Tax Details Object . So I want whenever a new Order is created then a new Tax Details record should be created with Order Number, Account Name and Country. Order Number will be Parent Account (Order_c) number, Account Name will be same as Account Name on Order__c (Lookup of Account on Order__c Object) and Country should be same as we have Country on Order__c Object.
Thanks in advance 
  • February 13, 2015
  • Like
  • 0
I have an Apex Trigger listed below, I need to change where it says Subject = 'Email Sent' or Subject = 'Email Received' to be Subject Contains Email, but I can seem to get it to work properly.
 
trigger SumEmailActivitesOnAccount on Task (after insert, after update, after delete) {

    set<Id> set_Id = new set<Id>();
   
    List<Account>acc_list = new List<Account>();
    
    if(Trigger.isInsert || Trigger.isUpdate) {
        for(Task T:Trigger.new){
            set_Id.add(T.WhatId);
        }

     }
    else if(Trigger.isDelete){
        for(Task T:Trigger.old){
            set_Id.add(T.WhatId);
        }

     }
     
    if(Trigger.isAfter && (Trigger.isUpdate || Trigger.isInsert || Trigger.isDelete)){
        acc_list=[SELECT Id, Sum_Email_Activities__c, (SELECT Id FROM Tasks WHERE Status = 'Completed' AND (Subject = 'Email Sent' or Subject = 'Email Received')) FROM Account WHERE Id IN :set_Id];

     for(Account acc: acc_list){
        if(acc.Tasks.size()>0)
            acc.Sum_Email_Activities__c = acc.Tasks.size();
        else
            acc.Sum_Email_Activities__c = 0;
     }
        if(!acc_list.isEmpty())
            update acc_list;
        }

}

 
Okay so I have a Trigger that fires after insert of Task. The Trigger works perfectly, I wrote the following Test Class and I'm only getting 75% code Coverage and I need more than that because my org average is only at 57%. Any help would be greatly appreciated.
 
@isTest

public class TestTaskCreationAccount {

    static testMethod void insertNewTask() {
    
        Task taskToCreate = new Task();
        
        taskToCreate.OwnerId = '005i0000004N77x';
        taskToCreate.Subject = 'Attempted Call';
        taskToCreate.Status = 'Completed';
        
        insert taskToCreate;
        
        taskToCreate = [SELECT Status From Task WHERE Id =:taskToCreate.Id];
        System.debug('Status after trigger fired: ' + taskToCreate.Status);
        
        System.assertEquals('Completed', taskToCreate.Status);
        
        delete taskToCreate;
        
    }
    
    
}

 
Hi, 

Could enybody tell me how to change this for loop to put the SOQL outside the for loop to efficiently query records?
for (Opportunity Opp :Trigger.new){

    	Boolean flag = false;

    	Account a = [Select id, name from Account where Id = :Opp.AccountId][0];

    	if (a.Name == 'XB Sample') {
    		flag = true;
    	}
}

 I will be apreciate for help

Thanks
Hello,

I wrote a Class to use in my test Classes.  The purpose of this class is to create varius records that I can reference in test classes.  However, when I try to deploy it to production, it shows as 0% coverage and will not let me deploy.  Is there a way I can exclude this class from the code coverage calculation?

Class:
public class TestCreateRecords {

// create and insert a new Account record.
    public static Account createAcct(Integer i){
        Profile ProSys = [SELECT Id
                          FROM Profile
                          WHERE Name='Client Services (Admin)'];
        User U1 = new User(Alias = 'User1',Country='United States',Email='User1@testing.com',EmailEncodingKey='ISO-8859-1', LastName='User1', 
                            LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProSys.Id,TimeZoneSidKey='America/New_York', UserName='User1@testing.com');
        insert U1;

      Account acct = new Account();
        acct.Name = 'Test';
        acct.Region__c = 'USA';
        acct.BillingCountry = 'USA';
        acct.Industry = 'Consumer Goods';
        acct.Status__c = 'Customer';
        acct.Website = 'www.test.com';
        acct.OwnerId = U1.Id;
            
      return acct;
    }
}

 
Hi ,

I am trying to have a VF page for the Contracts . Org wide everyone has view all Permissions and every one can create contracts but everyone cannot edit it . so i am trying to limit the view of Notes and attchmnets for 3 profiles and the owner of the record. I am succesful with the first part however i am not able to do the second part.So my question is 
1. How can i use th render tag to check if the logged in user is the Owne rof the record. 
2. Can i use rerender or If statement for the Edit button to check if the same conditions as above.
 
<apex:page standardController="Contract" extensions="ContractDetailExtensionController" id="thePage">

<apex:form >
<apex:sectionHeader title="Contract" subtitle="{!Contract.name}"/>
<apex:pageBlock title="Contract">
<apex:pageBlockButtons >
                    <apex:commandButton value="{!$Label.conDetail_Edit}" action="{!edit}" />
                    <apex:commandButton value="{!$Label.conDetail_Delete}" action="{!delete}" />
                    
            </apex:pageBlockButtons>

<apex:pageBlockSection title="Contract Information" columns="2">
<apex:outputField title="Contract Owner" value="{!Contract.OwnerId}"/>
<apex:outputField title="Status" value="{!Contract.Status}"/>
<apex:outputField title="Contract Number" value="{!Contract.ContractNumber}"/>
<apex:outputField title="Contract Start Date" value="{!Contract.StartDate}"/>
<apex:outputField title="Account Name" value="{!Contract.AccountId}"/>
<apex:outputField title="Contract Term (months)" value="{!Contract.ContractTerm}"/>
<apex:outputField title="Customer Signed By" value="{!Contract.CustomerSignedId}"/>
<apex:outputField title="Owner Expiration Notice" value="{!Contract.OwnerExpirationNotice}"/>
<apex:outputField title="Customer Signed Title" value="{!Contract.CustomerSignedTitle}"/>
<apex:outputField title="Company Signed By" value="{!Contract.CompanySignedId}"/>
<apex:outputField title="Customer Signed Date" value="{!Contract.CustomerSignedDate}"/>
<apex:outputField title="Company Signed Date" value="{!Contract.CompanySignedDate}"/>
</apex:pageBlockSection>

<apex:pageBlockSection title="Address Information" columns="2">
<apex:outputField title="Billing Street" value="{!Contract.BillingStreet}"/>
<apex:outputField title="Billing City" value="{!Contract.BillingCity}"/>
<apex:outputField title="Billing State/Province" value="{!Contract.BillingState}"/>
<apex:outputField title="Billing Zip/Postal Code" value="{!Contract.BillingPostalCode}"/>
<apex:outputField title="Billing Country" value="{!Contract.BillingCountry}"/>
</apex:pageBlockSection>


</apex:pageBlock>
</apex:form>

<apex:relatedList list="CombinedAttachments" rendered="{!Checkprofiles}"/>

<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories" />


</apex:page>
 
public with sharing class ContractDetailExtensionController {
private final Contract contract;
    
   
    
    public ContractDetailExtensionController(ApexPages.StandardController stdController) {
        this.contract = (Contract)stdController.getRecord();
    }
    public Boolean getCheckprofiles()
    {
     List<Profile> Prof;
      Prof = [Select id from Profile where Name = 'System Administrator' or Name = 'L2 Support' or Name='Sales Manager - RM'];
      
        for(Profile p :Prof)
        {
            if (UserInfo.getProfileId()== p.Id)
                return true;
        }
        
        return false;
}
}

Thanks
Akhil
  • January 29, 2015
  • Like
  • 0
We have a simple trigger that updates a checkbox on all child records when parent opp is edited.  I'm trying to switch the behavior to updating a date/time field.

Its quite easy to update the code, but I'm having a hard time figuring out how to pass Now() to the system.assert in the test class.

For the code, I changed

  for (Engagement_Role__c er : engagementRolesToUpdate) {
            er.ER_Updated__c = TRUE;
to:
  for (Engagement_Role__c er : engagementRolesToUpdate) {
            er.ER_Update_DateTime__c = system.Now();

In the test class, what I want is something like: 
System.assertEquals(0, [select count() from Engagement_Role__c where  Opportunity__c in :opps and ER_Update_DateTime = system.Now() ]);

That does not work, gives the following error:
Error: Compile Error: expecting a colon, found 'System.Now' at line 47 column 127    

I tried declaring a variable and using that instead:

DateTime testNow = system.Now();
System.assertEquals(0, [select count() from Engagement_Role__c where  Opportunity__c in :opps and ER_Update_DateTime = testNow ]);

And I get an error:   Compile Error: expecting a colon, found 'testNow' at line 49 column 127    

I am not a developer in any meaningful way, just hacking on our code, being dangerous, and very tired to boot.  
Greatly appreciate any pointers as to what i'm missing here.

Thanks as always.
Hello!

I am trying to set an field on the opportunity line items based when a field on the parent gets updated.  However I am running into some issues, and was wondering if anyone can show me where my fall out is?
 
trigger TaxUpdate on Opportunity(after update) {
        // 1

        List<OpportunityLineItem> childRecords = [Select Id, OpportunityId,Name,LineTax__c FROM OpportunityLineItem WHERE OpportunityId IN: Trigger.newMap.keySet()];
         

        // 2

        for(OpportunityLineItem child :childRecords){

            // 3

            if(trigger.isInsert && Opportunity__r.Tax__c != NULL && !child.Name.contains(eN-PRO,Shipping,Training-Adult,AP-WTY-DTLL2,AP-WTY-FRX2)){

                child.LineTax__c = 'Tax';

            }

            // 4

            else if(trigger.isUpdate && child.LineTax__c == Null && trigger.NewMap.get(child.OpportunityId).Tax__c != trigger.OldMap.get(child.OpportunityId).Tax__c){

                child.LineTax__c = 'Tax';

            }

        }

         

        // 5

        if(childRecords.size() > 0)

            update childRecords;

}

 
Dear all, this may be really simple but I`m not able to figure it out. I have two Number fields "Agents__c" and "stations__c". I want formula field (# of TRE) which will help me to evaluate that if Agent__C is Blank, it will multiply the amount stations__c * 0.55. Similarly, if stations__c is Blank, it will multiply amount Agent__C * 0.55. If both are blank, it should be zero. Can someone please help me with appropriate formula?

I tried below formulas but it does not work. Formula works well on Agent__c but if Agent__c is Blank, and stations__c has value, it does not work

BLANKVALUE(BLANKVALUE(Agent__c, Section__c), 0) * 0.55


IF( NOT(ISBLANK(Agent__c)), Agent__c, IF( NOT(ISBLANK(Station__c)), Station__c, 0 ) ) * 0.55

 
I'm trying to create a test class that is going to create a new "Assigned_BDM__c" and I keep getting this error: Compile Error: Illegal assignment from String to Date at line 12 column 5.

Here is my test class:
 
@isTest

public class TestActiveBDMsTriggerOnInsert {

    static testMethod void insertNewBDM() {
    
    Assigned_BDM__c bdmToCreate = new Assigned_BDM__c();
    
    bdmToCreate.BDM_Assigned1__c = 'a0Ki0000009XKgM';
    bdmToCreate.CampaignX__c = 'a0Ei000000Y24Jh';
    bdmToCreate.Account_Name__c = '001i000000box1d';
    bdmToCreate.Start_Date__c = '1/28/2015';
    
    insert bdmToCreate;
    
    }
    
}

Any help would be greatly appreciated.
Hello,

I am trying to write an apex trigger that updates the Probability field of my Opportunity object whenever I change the probability field of a custom object 'QQ'. My Opportunity and QQ have a master-detail relationship.
  
I am new to apex triggers, though intuitively I would write something like this:

trigger TestUpdateProbability on Opportunity (before insert, before update) {
        for(Opportunity p : Trigger.new) {
                p.Probability = p.QQ__r.Total__c;
        }
}

This doesn't seem to be working.
I can't use a workflow either, because the Probability field in an Opportunity object is set according to the Stage field. 
I would like to change the Opportunity probability based on my custom QQ's probability, though that is difficult since each stage is associated with only one preset Probability percentage.

Does anyone know how to get around this? Thanks.
  • January 28, 2015
  • Like
  • 0
Hi,

Im trying to complete the Rest Callout Challenge, for which i created a class called AnimalLocator which has exactly the method requested for "getAnimalNameById" as if in the below screen shot

Screen Shot of summary of class


But still I receive below error
Challenge Not yet complete... here's what's wrong: 
Executing the 'getAnimalNameById' method on 'AnimalLocator' failed. Make sure the method exists with the name 'getAnimalNameById', is public and static, accepts an Integer and returns a String.


 
Dear Devs.,

   Have any one tried to alter/change the style of a bottom side bar in a service console?  

Right now, the borders of side bars were not bright enough to distinguish where detail of record end and sidebar begin particularly in case of bottom sidebar. So, just checking if anyone felt the same and tried to change/apply new style.

 I cant find any method in integration.js for service console to accomplish this as we do for a  tab style !

Please suggest if there is a way to overcome this!

Regards,
Balaji C Garapati
 I would like to know if there's a way to send a POST (or GET) HTTP request to a certain URL while a customer is created or updated in the Salesforce CRM.
I need to get the new customer's details, and create an account in a different system with those details, right after the user is created / updated in Salesforce. I want to do that by creating a PHP application that will get a POST request from Salesforce, and send an API request with the customer's details to the API of a different systemi.e. on every trigger of update / creation of a customer, Salesforce will send a POST request to a predefined URL
I saw that there's an option to use streaming API in Salesforce, but I couldn't find an option to send a POST / GET request with the customer's details right after creating / updating a customer in the Salesforce CRM.
It's also possible for us to only get the customer's ID, and our application will retrieve the rest of the customer's details by an API call to Salesforce.
Your help is appreciated.
 
 
Our Contact object New button is overridden to display a custom VF page with added functionality. However, some profiles do not have access to this functionality and should see the standard page. The VF page has functionality on it that we have to pay to use, so we do not want all users having access. 

Can someone please advise if I can remove access to the override classes/VF pages for all users and then assigned to specific users via a Permission Set? If not, what would be the best way to accomplish what we are trying to do? Thanks!
We have a series of email services that need to run specific logic that cannot be supplied in email to case. 
The process looks up the toAddresses and/or ccAddresses and runs specific logic depending on the outside party and the inbound email address. 
The system works great with one exception.

If an outside party BCC's the email the inbound email handler does not appear to have available similar to toAddresses or ccAddresses. 

This is a low % of inbound emails but I'd rather have 100% than 99.9x%. 

Since BCC are "B" my thought was to look to look for the inbound email service being used rather than actual values in the toAddress or ccAddress. Unfortunately I don't see an ability to get that from the InboundEmail class either. 

Anybody done something similar? 
Any ideas are welcome... 







 
Hello Devs! 
 
I am trying to install the SF Labs Action Plans app but I am unsuccessful. 
I am seeing this error (attached).
Installation Failed Error Msg


Looks like it's related to one of the Events Trigger named (EventTrigger) and another trigger under apex triggers named (AppointmentTrigger). 

Event Trigger:
User-added image

Appointment Trigger: 

User-added image

 
I can not seem to interpret what the error means. Can someone give me insight on what to do? and how to workaround this error? 
 
Thank you!!
 
Bassem
Hi,

Im trying to complete the Rest Callout Challenge, for which i created a class called AnimalLocator which has exactly the method requested for "getAnimalNameById" as if in the below screen shot

Screen Shot of summary of class


But still I receive below error
Challenge Not yet complete... here's what's wrong: 
Executing the 'getAnimalNameById' method on 'AnimalLocator' failed. Make sure the method exists with the name 'getAnimalNameById', is public and static, accepts an Integer and returns a String.


 
I am calling a batch through a system.scheduleBatch(BatchableClass(query), 'Job Name', MinutesToExecute) method. How can I check if the batch job Job Name is already scheduled?

Thanks in advance.
Hi,
I have a class that is grabs Opportunities, places them into a csv file, and then sends an email to a particular email address. 

There is a Opportunity.CustomField1 which is a text field that can is populated as such:
  • Test, Test, Test,
  • Test; Test; Test;
Because I am creating csv file the string cannot have a comma in it other it throws off the csv file.

I tried doing this but failed

String x = Op.CustomField1;
x.replaceAll(',', ';');

Essentially when the CustomField1 has semicolon (;) character everything works fine, but when there is a comma (,) to separate the values, then the CSV file is messed up because the columns are not aligned properly.

How can I use x.replaceAll() to replace all commas with a semicolon in the customField1?
  • March 27, 2015
  • Like
  • 0
Hi,
We added a custom object called Analytics Group under Account.  It is a list and I created one object manually under one account

When I run this query:
"SELECT id, name, Sage_ID__c,FCA_Number__c, Owner.Name,(SELECT Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c FROM Analytics_Groups__r) FROM Account where id=xxxx"

I can see that the account does have one Analytics_Groups__r returned. But it is returned as a QueryResult, with two Fields "FieldsToNull" and "ID", and both fields are null. I asked those fields: Group_ID__c,Account_Limit__c,Concurrent_Limit__c,Display_Name__c,Expiry_Date__c,Notes__c,Version_Name__c,Version_ID__c
but none of them seem to be returned (or maybe I just don't know where to retrieve them)?

Can someone help?

Hey guys, 

I have to work on the following project: 

An external button calls a REST Webservice and sends an ID. This ID is the trail to the user which called the button. Now I need to generate a .pdf with the user information. This .pdf then needs to be send to three different e-mail addresses, of which one has a different body. All of this needs to be done programmatically, so that the user only presses a button, and the rest is done automatically.

 

I found a huge documentation about REST Webservice, so I don't need a start here. But I can't find a documentation on how to generate a .pdf all by code and send this via email. All I could find is .pdf in combination with a visualforce page. Does someone have a nice tutorial on generating a .pdf by code only and sending it via mail? 

Thanks in advance!

Hi,

I am really new to Salesforce and seeking your help to develop the bewlo idea. In my org, we are using Document to store the files. Document has a folder "Sales Tools". I want whenever users click on the "View" or "the document link" a custom message should pop- up and when user click Ok he should be able to see the document . Below is the screenshot to give more idea of what i am referring to.
User-added image

Please let me know how can i create a custom popu- message whenever i click on "View" or "Document Link"

Thanks a lot.
 
Hi there,
We at UNICEF require a little help with the creation of a Trigger and related TestClass for the following scenario:

We have a custom object called Due Diligence (Due_Diligence__c).
This is an object that has a MasterDetail relation to Account.
 
Due Diligence records are managed by researchers and the process ends with a DD Outcome assigned to the Due Diligence Record (PickList field called: DD_Phase_1_Outcome__c) at the DD record level.
The record is then put through a standard Approval Process.
 
We would like that at the Approval, when DD record is approved the approval process updates a field on the Due Diligence record called DD Record Status (Approval_status__c) with a status of “Phase 1 Review Completed”, the DD record then updates the Account in the relevant field in the Account record (DD_Outcome_Phase_1__c) with the outcome coming from the DD Records.
 
We would also want to pass the Approval Date also from the DD Record to the Account record.

Currently we are handling that via a series of Workflow but we only have the ability to update the Account record after 1 hour (we are using Time Based Field Updates) 
Thanks,
L
I am going to schedule a job in our production env.
What it does is to assign opportunity owner to current owner's manager if the Opportunity has no activities for the past 5 days.

Since it is production env, our product manager will change my profile to a admin to run the job. After I set the shedule job, my profile will become devopler which does not have much access and basically not able to change Opportunity Owner.

My question is, when scheduled job runs everyday, does it still based on my current profile? Or it does not matter what my profile is.
 

This is my code:-

public class DispatcherContactNewController {

    public DispatcherContactNewController(ApexPages.StandardController controller) {
        this.controller = controller;
    }
   
    public PageReference Redir() {

        PageReference newPage;
        PageReference standardpage = New PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=012900000011wvV&ent=Lead&nooverride=1');
        
        RecordType r;
        r = [Select developerName from RecordType Where SobjectType='Lead' And id = :ApexPages.currentPage().getParameters().get('RecordType')];
        
        if ( r.developerName == 'LeadVisualforcePage') {
        
        System.debug('----------------------------------------------------------------------');
        
            newPage = Page.leadtask;
            
            return newPage;
        } else {
        
         System.debug('**********************************************************************');
         
         return standardpage;
        }

    }

    private final ApexPages.StandardController controller;
}

Our Client in the Dallas/Fort Worth area is looking for a Salesforce Developer to manage all technical aspects of Salesforce.com, including development, data migrations, systems integrations, AppExchange products, and custom code.

Minimum 2 yrs experience developing with at least 1 major Salesforce integration. Ideal person will have 401, 501 certification.

Please feel free to contact me directly - nancy@tech2resources.com
Hi guys,
i want to share with you a solution I come up with, to wrap long url when rendering a VF page.
Basically the problem was this:
A customer pasted a very long URL (more than 400 chars) in a Rich Text Area. When rendering the page as PDF, to print it, the URL overflow the page margin, so it wasn't visible at all.

This is the code i come up with
private String addWhiteSpaceInUrlTooLong(String text) {
        // Step 1 - Search anchor links
        Pattern ptn = Pattern.compile('<a[^>]*(>.*?)</a>'); // WATCH OUT! This regex doesn't match nested anchor
        Matcher mch = ptn.matcher(text);
        Integer charPerLine = 50; // A whitespace is inserted each charPerLine chars
        while (mch.find()) {
            String toReplace = mch.group(1);
            String substitute = '';
            Integer len = toReplace.length();

            if (len < charPerLine) //No need to replace
                continue;

            Integer elems; // White space to insert

            if (len / charPerLine == 0)
                elems = len / charPerLine;
            else
                elems = len / charPerLine + 1;

            // Insert white spaces
            for (Integer i = 1; i <= elems; i++) {
                if ((charPerLine * i) < len)
                    substitute += toReplace.substring(charPerLine * (i - 1), charPerLine * i) + ' ';
                else
                    substitute += toReplace.substring(charPerLine * (i - 1), len) + ' ';
            }

            text = text.replace(toReplace, substitute);            
        }

        // Step 2 - Search pasted links
        ptn = Pattern.compile('\\b\\s(https?://\\S.*?)(\\s|$)');
        mch = ptn.matcher(text);
        charPerLine = 60;

        while(mch.find()) {
            String toReplace = mch.group();
            String substitute = '';
            Integer len = toReplace.length();

            if (len < charPerLine)
                continue;

            Integer elems;

            if (len / charPerLine == 0)
                elems = len / charPerLine;
            else
                elems = len / charPerLine + 1;

            // Insert white spaces
            for (Integer i = 1; i <= elems; i++) {
                if ((charPerLine * i) < len)
                    substitute += toReplace.substring(charPerLine * (i - 1), charPerLine * i) + ' ';
                else
                    substitute += toReplace.substring(charPerLine * (i - 1), len) + ' ';
            }

            text = text.replace(toReplace, substitute);
        }

        return text;
    }

You could use like this:
MyCustomObject.richText = addWhiteSpaceInUrlTooLOng(MyCustomObject.richText);
Hope it will be useful ;)
 
Since WI15, SFDC allow deploying changes to batch jobs while they are running
We found out today a potential problem this raises:
We added a new field to a batch process. Post deployment, SFDC threw an 'SObject row was retrieved via SOQL without querying the requested field' error.

It seems that as the batch job was running at the same time as the code was deployed, a data subset has been queried using the old code, while the processing batch used the new code

luckily for us we reprocess failed records automatically, so no real issue , but it's something worth considering when releasing batch job changes
As a certified Salesforce consulting partner, PDO, and ISV, ForceBrain.com builds cloud & mobile apps. We've been a salesforce partner for over 6 years and you'll be joining a super fun team of true rockstars. We're seeking a Technical Architect who will work-from-home as a full-time employee, assisting Project Leads in designing and building solutions for multiple projects (zero travel required).

RESPONSIBILITIES
• Lead the design, architecture, and development for salesforce CRM solutions for multiple projects in a deadline-focused and fast-paced environment
• Perform detailed evaluation of business requirements and produce clear technical & design specifications, defining customer's business objectives and needs
• Mentor team members on the overall implementation strategy and solutions
• Deliver excellent presentation, technical design, and architecture documentation
• Assist sales engineers in building and demonstrating prototypes in Salesforce
• Participate in scoping development projects and estimate resource requirements
• Oversee onshore and offshore teams in executing technical solutions on complex development projects

REQUIREMENTS
• You have a minimum of 3 years of Force.com Development experience.
• You have architected, designed, and developed over 5 Force.com projects, including ui design, functional design, data modeling, security, etc…
• Proficient with the Force.com Developer Toolkit including: Apex, Visualforce, Force.com IDE, Force.com Migration Tool, Web Services/SOA, & Metadata APIs.
• Expert knowledge of how to work within the the limitations of the Salesforce.com platform, including governor limits, code coverage, etc...
• Experience integrating the Salesforce platform with other systems, whether it is using the web services API, restful API, or http post.
• You are comfortable giving direction to more junior consultants and mentoring.
• You have expertise in understanding the business processes, and systems involved in
running organizations.
• You thrive in a startup organization / entrepreneurial environment.

PREFERRED SKILLS
• XML, CSS, HTML, Javascript, J-Query, etc... 
• Understanding of the entire SDLC and various methodologies.
• You have a good sense of humor, tough-skinned, and handle stress well.

INTERESTED?
• Send your resume to jobs(at)forcebrain.com
• Answer the questions on this form: http://goo.gl/forms/QtaEm7aeQJ

GENERAL STATS
• Full Time Employee
• Location: Remote, Work & Live Anywhere
• Salary with bonus and generous benefit package
• Applicant must be willing to work 8am PST - 5pm PST shift
• Principals only. No recruiters please.

ABOUT FORCEBRAIN.COM
• Established in 2008, ForceBrain.com manages an all-star team of Salesforce Consultants, Force.com Developers, and Technical Architects to design, develop, deploy, and support cloud & mobile solutions . 
• We offer a competitive salary and benefits package, opportunity for continuous education & salesforce certifications, flexible working hours, tools for working remotely, casual dress at the office, quarterly company outings, and subsidized beverage and snack center.
• In 2010, ForceBrain.com became certified as a B-Corporation, recognizing the transparency in which we run our organization and our accountability in giving back.
Hi 
  • I converted the metadata wsdl to apex class through wsdl to apex button and it created a class soapSforceCom200604Metadata in the system. But when i try to open it it gives me below error.
  • An internal server error has occurred
    An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

    Thank you again for your patience and assistance. And thanks for using salesforce.com! 
  •  
  • Thanks
  • Anupam

    Error ID: 1281456891-49957 (-1437854107)
  • January 14, 2015
  • Like
  • 1
We are developing a mobile app using Community Designer (not templates).  This will need to be made easily available to the community members.  I believe that the way that this has to be done is by the member downloading salesforce1 from the apple or google store and then changing the settings on salesforce1 to point to the community.  The changing the settings is the issue as we just want it to be easy for someone to either self register from a mobile device or use their given credentials and login.  Any ideas on how to overcome this issue?  
As a certified Salesforce consulting partner, PDO, and ISV, ForceBrain.com builds cloud & mobile apps. We've been a salesforce partner for over 6 years and you'll be joining a super fun team of true rockstars. We're seeking a Tech Lead / Project Lead who will work-from-home as a full-time employee, managing 3 to 5 projects (zero travel required). This position requires managing the entire project life cycle from kickoff to go-live. You must have deep salesforce expertise, the ability to lead the requirements gathering, produce design documents, and manage a few offshore developers.

RESPONSIBILITIES
• Manage complex development projects on-time, on-budget, and to-spec.
• Develop comprehensive technical specification documents, configuration designs, use cases, test conditions, test scripts, and training documentation to support the successful implementation of initiatives and processes.
• Oversee developers to make sure requirements are being met and timeline is adhered to
• Identify detailed business requirements to support Salesforce.com implementation within the scope of prioritized initiatives.
• Develop comprehensive training materials and other change management collateral as appropriate for each initiative, deliver training to super users and end users as appropriate.
• Proactively audit Salesforce.com and improve configuration settings and keep current with the latest capabilities of each release.

REQUIREMENTS
• 3+ years of Salesforce platform experience (Sales Cloud, Service Cloud, General Configuration, etc...)
• 1+ years of Force.com development experience (APEX, Visualforce, Portals / Communities)
• Deep understanding with technical capabilities of Visual Force, APEX APIs, APEX Triggers, and APEX Web services.
• Take complex client and vendor concepts and articulate them to audiences of varying perception levels.
• Experience in designing and building cloud apps
• Ability to lead enterprise engagements, facilitate meetings, and lead customer support projects.
• Ability to create solution design documentation that supports the clients business requirements and business processes, which may include: Data Model, Object & Field Definition, Wireframes, and more.
• Excellent written, verbal presentation and organizational skills, ability to interface with all levels and business units.
• Must work independently in complex fast paced environment to ensure quality and timeliness of system information.

PREFERRED SKILLS
• Salesforce.com Certifications (Admin, Consultant, Developer).
• Experience with enterprise integration, extract, transformation and load (ETL) tools.
• Current or past Project Management Certification (PMP or equivalent).
• Experience work with or managing an offshore team
• Bachelor's degree

INTERESTED?
• Send your resume to jobs(at)forcebrain.com
• Answer the questions on this form: http://goo.gl/forms/QtaEm7aeQJ

GENERAL STATS
• Full Time Employee
• Location: Remote, Work & Live Anywhere
• Salary with bonus and generous benefit package
• Applicant must be willing to work 8am PST - 5pm PST shift
1. Launch Developer Edition from Trailhead sample
2. Create a new Visualforce Page (Setup, Develop, Pages, New)
3. Add a Label that contains spaces: "My New Page" and tab to the Name field
4. The Name field auto populates a value based on the Label - "My New Page" - Note that the auto-populate is not converting spaces to underscores.
5. Click Save - a Warning is presented that the Name field is invalid.

Expected the Name value to auto-populate with a valid value (as in other parts of the salesforce UI)

User-added image