• Venkat Polisetti
  • NEWBIE
  • 345 Points
  • Member since 2010
  • Atlanta Salesforce User Group Co-Leader
  • Fiserv, Inc


  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 78
    Replies
How would I validate the following

User enters a credit agency from a picklist and enters a numerical score. Validate that the score entered is within the range associated with the credit agency.
For example, range for equifax is 300-850, experian is 330-830. User selects experian and enters 310 which is outside the range for experian.

In total I have 5 credit agencies . Only one credit score value is entered.
 
New to Validation Rules! Need some help....  I want to create a conditional requirement on a field using Validation.  When Account "Type" Contains "Customer", the "Parent Account" field becomes required.  I'm struggling with the CONTAINS function.  Can anyone help?
Hey everyone,

I've been running into "CPU Time Limit" errors recently, and I believe it has something to do with my sloppy use of loops within loops. So with that said, here's an example of how I normally handle loops within loops. For example, this could be a trigger where I want to simply count the number of Opportunities present under each Account:
 
Set<String> accountsInTrigger = new Set<String>();
        
        FOR(Opportunity o : opps){
            
            IF(o.AccountId != NULL){
                
                accountsInTrigger.add(o.AccountId);
                
            }
            
        }
        
        List<Opportunity> relatedOpps = [SELECT
                                            Id,AccountId
                                         FROM
                                            Opportunity
                                         WHERE
                                            AccountId In :accountsInTrigger];
        
        FOR(String account : accountsInTrigger){
            
            FOR(Opportunity opp : oppsInTrigger){
                
                IF(opp.AccountId == account){
                    
                    /* Insert code here */ 
                    
                }
                
            }
            
        }

I'm assuming that this isn't efficient since this code will loop through every Opp when looping through each Account, regardless if the Opp is attached to that Account or not. Then the IF statement filters down the Opps within each loop, but I'm assuming the code is still looping through every single Opp.

Is there a more efficient way to handle this loop within a loop? Or should I try to avoid loops within loops all together?

Thanks!
-Greg

 
Hi

I have created the output link for Edit/Remove

Can anyone please send me code ...how to delete the record  using Output link ?

 <apex:outputLink title="" value="/{!row.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;
       <a href="javascript:if (window.confirm('Are you sure?')) DeleteCampaign('{!row.Id}');" style="font-weight:bold">Del</a>
Hi All,

we want to know how many days it takes from visiting the customer until the opportunity is closed.

We use events only for these visits, so every account only has one event. What I need to do is to copy the date of this event either to an opportunity or account to add another custom field to calculate the days between start date (I already cloned this field in the event to use it in formulas) and close date.
Another problem is, that CloseDate is only Date and not DateTime like my cloned StartDate. Any chance to calculate it anyway?

Thanks very much for your help!

Lukas
I have a function that uses a sosl query:

private List<Product2> runSoslToExecute() {
    List<List<Product2>> searchResults = [FIND :query IN ALL FIELDS RETURNING Product2 (Id, Name)];
    List<Product2> results = new List<Product2>();
    for(Product2 p : searchResults[0]) {
        results.add(p);
    }
    return results;
}

If I search for "AB*" then I also get results that include "1AB...". I thought the "*" wildcard only searches in the middle and end of the search and not at the beginning? Is there a way to run the sosl search so it only searches "AB" at the beginning?

Thanks for any help.
Hey there,

What might have gone wrong, I jsut deployed a visualforce page with an extension, a test, all the object fields and a static resource to production. Upon opening my VF page within production, even though I have double checked and it is exactly the same code as that i have in sandbox. it is missing fields. What might be the problem?
Hi,

I need to send out time triggered email alerts on cases that haven't received an email response.  Does anyone know how I would code that - I would base it on createdDate but I don't know how to create a formula for email received equals zero.

thanks.

Hello,

 

I need some help.

 

I am trying to automatically populate a date fieId (Expiration_Date__c) by a workflow field update based on multiple values of the Term field (Term__c)

 

So for example,

 

If Term__c  = 1 then the Expiration_Date__c = Start_Date__c + 1 month

If Term__c  = 6 then the Expiration_Date__c = Start_Date__c + 6 months

If Term__c  = 12 then the Expiration_Date__c = Start_Date__c + 12 months

If Term__c  = 24 then the Expiration_Date__c = Start_Date__c + 24 months

 

Please help me create this formula for the workflow field update.

 

Thanks,

Hi All, 

Maybe I am missing something but I am going around in cirlces with the Contacts without Hobbies report. I have: 

1. Created a custom report type to get Contacts without hobbies 
2. Created an Account Value bucket field
3. Create a % Open Opps Formula 
4. Added First Name, Last Name, Total Opp Value, Open Opp Value, Phone, Email, %Open Opps to the report 
5. Summarised by Account Value then Account 

And im still getting an error: 

Challenge Not yet complete... here's what's wrong: The 'Contacts Without Hobbies' report is not configured correctly.

I have added screenshots of all the pieces - hoping someone else has hit this issue 

User-added image

User-added image

User-added image

User-added image
Error during taking the challenge

Even though my developer org has the Lightning App "My Data" its saying app is not available.
  • October 19, 2015
  • Like
  • 0
How would I validate the following

User enters a credit agency from a picklist and enters a numerical score. Validate that the score entered is within the range associated with the credit agency.
For example, range for equifax is 300-850, experian is 330-830. User selects experian and enters 310 which is outside the range for experian.

In total I have 5 credit agencies . Only one credit score value is entered.
 
New to Validation Rules! Need some help....  I want to create a conditional requirement on a field using Validation.  When Account "Type" Contains "Customer", the "Parent Account" field becomes required.  I'm struggling with the CONTAINS function.  Can anyone help?
Hello Everyone

We have contact and custom object on the custom object we have a picklist field state.
whenever the pick list value on custom object is CT i need to check the box to true on contact detail page 
I wrote the formula but is not working.

The formala has been written on Contact object
If( 

ISPICKVAL(State_Registration__r.State__c,'CT'),true,false 
)

Can any one help me out where i am going wrong.

Regards,
Jyo
Hi,
is it possible to set up a directory structure in salesforce, which I can sync to my laptop and keep the directory structure?

I cannot find this possibility.

Gert-Jan
Hey everyone,

I've been running into "CPU Time Limit" errors recently, and I believe it has something to do with my sloppy use of loops within loops. So with that said, here's an example of how I normally handle loops within loops. For example, this could be a trigger where I want to simply count the number of Opportunities present under each Account:
 
Set<String> accountsInTrigger = new Set<String>();
        
        FOR(Opportunity o : opps){
            
            IF(o.AccountId != NULL){
                
                accountsInTrigger.add(o.AccountId);
                
            }
            
        }
        
        List<Opportunity> relatedOpps = [SELECT
                                            Id,AccountId
                                         FROM
                                            Opportunity
                                         WHERE
                                            AccountId In :accountsInTrigger];
        
        FOR(String account : accountsInTrigger){
            
            FOR(Opportunity opp : oppsInTrigger){
                
                IF(opp.AccountId == account){
                    
                    /* Insert code here */ 
                    
                }
                
            }
            
        }

I'm assuming that this isn't efficient since this code will loop through every Opp when looping through each Account, regardless if the Opp is attached to that Account or not. Then the IF statement filters down the Opps within each loop, but I'm assuming the code is still looping through every single Opp.

Is there a more efficient way to handle this loop within a loop? Or should I try to avoid loops within loops all together?

Thanks!
-Greg

 
How can i do this with any object?  VFPage?  Triggers?   ApexClass?
Please, it's a critical problem for my partners!!!

User-added image

User-added image
Hi

I have created the output link for Edit/Remove

Can anyone please send me code ...how to delete the record  using Output link ?

 <apex:outputLink title="" value="/{!row.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;
       <a href="javascript:if (window.confirm('Are you sure?')) DeleteCampaign('{!row.Id}');" style="font-weight:bold">Del</a>

Hi all,

came up with a doubt,can i combine two different standard objects into single LIST

ie

List<contact> listname =  List<contact>;
List<campaignmember> listname =  List<campaignmember>;

i need to combine above two List into single one may be like (contact.campaignmember.date,contact.campaignmember.name)

i wrote a wrapper where i have access to those two list of data.now just need to combine  and return them as list ,is that possible ??.

please post possible ideas to do that.

 

Thanks
D Naveen Rahul.

1.criteria-based sharing rules can be created on wich objecta
A.oppotunities
B.Users
C.Contacts
D.Accounts
E.Campaign Members
can i extend rollup summary upto 20
<tr>
           
           <td height="20" width="30%">Responce to Enquiry</td>
           
           <td width="7%" align="center"><input type="radio"  value ="Poor" name="{!ResponcetoEnquiryT}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Average" name="{!ResponcetoEnquiryT}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Above Average" name="{!ResponcetoEnquiryT}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Good" name="{!ResponcetoEnquiryT}" ></input></td>  
           <td width="7%" align="center"><input type="radio" value="Excellent" name="{!ResponcetoEnquiryT}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Poor" name="{!ResponcetoEnquiryC}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Average" name="{!ResponcetoEnquiryC}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Above Average" name="{!ResponcetoEnquiryC}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Good" name="{!ResponcetoEnquiryC}" ></input></td>
           <td width="7%" align="center"><input type="radio" value="Excellent" name="{!ResponcetoEnquiryC}" ></input></td>
           
          </tr>
Is this syntax correct i am not getting selected radio value to controller name

Hi All,

 

Using the below query we are able to get TimeZone:

 

SELECT ID, TimeZoneSidKey FROM User WHERE ID = :UserInfo.getUserId()

 

For example, on edit user detail, if we pick the Time zone as (GMT-08:00) Pacific Standard Time (America/Los_Angeles) from the pick list then the TimeZoneSidKey will be America/Los_Angeles.

 

Is there any method to get the TimeZoneSidKey's value i.e,  (GMT-08:00) Pacific Standard Time (America/Los_Angeles) ?


Thanks.



if I call

 

var.setPageNumber(integer.valueOf(ApexPages.CurrentPage().getParameters().get('pgNum')));

 

IT ALWAYS sets the pagenumber to 1 regardless of what the apexPages parameter

 

If I However do:

 

Public Integer tstPg = integer.valueOf(ApexPages.CurrentPage().getParameters().get('pgNum')));

var.setPageNumber(txtPg);

 

it sets the page just fine no matter what the ApexPage Parameter is. If it is 2, the page is set to 2

 

Any one have any ideas?

 

Hi All,

we want to know how many days it takes from visiting the customer until the opportunity is closed.

We use events only for these visits, so every account only has one event. What I need to do is to copy the date of this event either to an opportunity or account to add another custom field to calculate the days between start date (I already cloned this field in the event to use it in formulas) and close date.
Another problem is, that CloseDate is only Date and not DateTime like my cloned StartDate. Any chance to calculate it anyway?

Thanks very much for your help!

Lukas