• salesforce@14
  • NEWBIE
  • 55 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 34
    Questions
  • 73
    Replies
When the value is selected in the Input text lookup, based on the value selection i need to hide the one value in picklist field.

Thanks.
Hi All,

Can anyone send me the source code for this requirement.

Thanks in advance
Hi,

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Permissionset caused an unexpected exception, contact your administrator: Permissionset: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.Premissionset: line 6, column 1

trigger Permissionset on Permissionset__c (Before Update) 
{
   User usr = [SELECT Id,Profile.Name FROM User WHERE Id =:UserInfo.getUserId()];
   if(trigger.isUpdate && trigger.isBefore)
   {
       List<PermissionSetAssignment> lstcurrentUserPerSet = [SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSet.Label LIKE '%Super%'];      
       for(Permissionset__c tt:Trigger.new)
       {       
           if(trigger.oldMap.get(tt.id).CTMax__Global_Usage__c == true  && lstcurrentUserPerSet[0].AssigneeId != usr.id && usr.Profile.Name != 'System Administrator')
           {
              tt.adderror('Only Super User has access to update the Master Template. Please Contact Super User');
           }
       }
   }
}

Thanks in Advance
Hi

I have fields like S.No and Email. My Requirement is when i try to insert or update the bulk records using data loader, trigger has to check the S.No is already exists when S.No and Email is poulated and display the error message and in same way trigger has to check the S.No is already exists when s.no is populated  and Email is not poulated and display the error message.

Thanks in Advance.
 
I have a scenario: There are two groups of users in the same profile, User 1 and User 2 I have two Record Types on a custom object, say R1 and R2. The Master record Type is assigned to this profile.

The requirement is as: User 1 must have only R1 record type and User 2 must have only R2 record type assigned to it. It means that while creating a new record, User1 should get R1 Record Type and User2 should get R2 Record Type.

But how i am getting is for both users, the page is redirecting to the Master Record Type.

How to Overcome this?

Thanks in advance
Hi Everyone,

                  I created the custom javascript button. The issue is when i click on that button it is redirecting to the some other page which is not i am expecting, I mentioned the URLs for your reference,
for eg:
https://test--ctm--ctm.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> This URL coming default
https://test--ctm--c.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> I need to redirect to this URL

I am expecting to do this functionality only in javascript without using the apex class.

Thanks in Advance.
Hi,

How to check the new record values with all old records in same object using query in before insert operation.

Thanks.
Hi Guys,

                I am trying display my group name ( My Group)  in Group drop down list.(marked in red box) . somebody help me to how to display My Group in that drop down to all users in my org.
User-added image
Thanks.
Hi,

   I have to check the file is csv or not while uploading it, if not then i want to display the error message, otherwise it gets upload without showing the error "Error:BLOB is not a valid UTF-8 string"

Thanks in Advance

 
Hi,

  I try to insert csv file with column last name and email and my last name column contains the value as ABC, Inc. .When i try to insert that csv file it showing an error as Insert failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Email: invalid email address: Inc.&quot;: [Email__c].

What is happening here is after the commas(,) it taking as email address thats y this error is coming.
So how to keep the last name as last name even it contains (,).


Thanks in advance.
Hi,

             I have value already in my Email field and i want to delete the value from that field once i click on submit button.

Thanks in advance.
 
Hi All,
  
I create one custom vf page for portal login and i try to login in that login page.
At that time i am getting this error
           
Error:
That operation is only allowed from within an active site.

Thanks in advance.
Hi,

    I need to insert my company logo(which is already designed using site.com) in VF Page. Can anyone tell how to achieve this functionality.

Thanks in Advance.
Hi All,

     I am trying to get owner id of parent object. but i am not able to get it.
I did like this .

[select id,ParentObject__r.OwnerId from Childobject__c];

can any one tell me how to resolve it..

Thanks in advance.
 
Hi All,
 
         I need to add radio button functionality in already implemented dynamic search filter condition. Create 2 radio buttons as AND and OR in VF Page, if i click on AND button , all filter search condition criteria should satisfy and if i click  OR button, any one of the filter search condition should satisfy.

Thanks in advance.
Hi,

 I pasted my code below and darked area is an issue one.

public class AllUserList
{  
    public list<SelectOption> selectedobject { get; set; }
    public String objectName { get; set; }    
    public list<SelectOption> fieldsName {get;set;}
    Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
    Map<string,EmailTemplate> alltemplate;
    Map<string,string> FieldType = new Map<string,string>();
    Map<string,string> fieldTypes=new Map<string,string>();
    public list<SelectOption> open{get;set;}
    public list<selectoption> templates{get;set;}
    public list<wrapperclass> value{get;set;}
    public list<Sobject> rowlist{get;set;}
 // Public list<Wrapper> wrap{get;set;}
    Public List<sobject> val4{get;set;}
    Public List<Contact> conList = new List<Contact>();
    public string templatename{get;set;}
    public Integer totalRecords;
    public Integer sno=0;
    public string templateid{get;set;}
    Public string FieldName{get;set;}
    public string query{get;set;}   
    public string Fname1{get;set;}
    public string Operator1{get;set;}
    public string Value1{get;set;}                      
    public void search()
    {      
        string whereQuery='select id,Name,Email from ObjectName';
        string whereclause ='where';
                    if(Fname1!='' && Fname1!=null && Operator1!='' && Operator1!=null && Value1!='' && Value1!=null)
                    {
                       whereQuery=whereQuery+retwhereQuery(Fname1,Operator1,Value1)+' and ';
                       
                    }                  
            if(objectName=='Contact')
        {
        whereQuery = ' select id,Email,Name'  +  ' from '  +  objectName  +  ' where '  + retwhereQuery(Fname1,Operator1,Value1);
        }
        else
        if(objectName=='Lead')
        {
        whereQuery = ' select id,Email,Name'   +  ' from '  +  objectName  +  ' where ' + retwhereQuery(Fname1,Operator1,Value1);
        }
        else
        if(objectName=='User')
        {
        whereQuery = ' select id,Email,Name'   +  ' from '  +  objectName  +  ' where '  + retwhereQuery(Fname1,Operator1,Value1);
        }
          if(whereQuery.contains('and'))
        whereQuery = whereQuery.subString(0,whereQuery.lastIndexOf('and'));
        system.debug('################################################'+Query);   
        val4 = Database.query(whereQuery);
        value=new list<wrapperclass>();
     //   wrap = new list<Wrapper>();
        for(Sobject s:val4)
        {
            wrapperclass wr = new wrapperclass('s.Email','s.Name',false,s.id,sno);   
            wr.email=string.valueof(s.get('Email'));
            wr.name= string.valueof(s.get('Name'));
            value.add(wr);
            system.debug('^^^^^^^^^^^^^'+value);
        }    
        system.debug('$$$$$$$$$$$$$'+value);
    }   
    public class wrapperclass
    {         
        public string id{get;set;}
        public string name{get;set;}
        public string email{get;set;}
        public Boolean checked{get;set;}
        public string snumber{get;set;}
        public wrapperclass(string email,string name,Boolean checked,string id,Integer sno)
        {      
            this.id=id;  
            this.Name=name;
            this.Email=email;
            this.checked=checked;    
            snumber=String.valueOf(sno);
        }
    }
  /*  public class wrapper
    {
      public Integer sno{get;set;}
      public wrapper(Integer sno)
      {
        this.sno=sno;
      }
    }    */    
    public AllUserList()
    {    
       
        value = new List<wrapperclass>(); 
       // addrow();
      //  wrap = new List<Wrapper>();
        templates = new list<selectoption>(); 
        templates.add(new selectoption('','--None--')); 
        val4 = new List<sobject> ();
        rowlist = new List<Sobject>();
        totalRecords=0;  
        String folderId = [Select Id,Name From Folder where Name = 'Email'].Id;
        system.debug('????????????'+folderId );
        alltemplate = new map<string,EmailTemplate>();
        for(EmailTemplate fd: [Select Body, HtmlValue, Id, Name, Subject from EmailTemplate where FolderId=:folderId])
        {
            templates.add(new selectoption(fd.Name,fd.Name));
            alltemplate.put(fd.Name,fd);
        } 
        system.debug('++++++++++++'+alltemplate);      
    }
    public list<selectoption> getobject()
    {   
        List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();    
        List<SelectOption> options = new List<SelectOption>();  
        options.add(new SelectOption('','--None--'));  
        for(Schema.SObjectType f : gd)
        {   
            if(!f.getDescribe().isCustomSetting() && f.getDescribe().isAccessible() && f.getDescribe().isCreateable() && f.getDescribe().isSearchable() && f.getDescribe().isQueryable())
            {
                if(string.valueof(f.getDescribe().getName()) == 'Lead' || string.valueof(f.getDescribe().getName()) == 'Contact' || string.valueof(f.getDescribe().getName()) == 'User')
                options.add(new SelectOption(f.getDescribe().getName(),f.getDescribe().getLabel()));
            }      
            options.sort();       
        }
        return options;
    }
    public List<SelectOption> getfd()
    { 
        List<SelectOption> fieldsName =new List<SelectOption>();
        if(objectName != null)
        {
            system.debug('!!!!!!!'+objectName );
            Map <String, Schema.SObjectField> fieldMap= Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap();
            for(Schema.SObjectField sfield : fieldMap.values())
            {
                schema.describefieldresult dfield = sfield.getDescribe();
                fieldTypes.put(string.valueof(dfield.getName()),string.valueof(dfield.getType()));
                fieldsName.add(new SelectOption(dfield.getName(),dfield.getLabel()));
            }
        }
        return fieldsName;
    }
    public List<SelectOption> getSelect()
    {
                    List<SelectOption> option = new List<SelectOption>();
                option=getSearchOperator(Fname1);
                return option;

        return open;
    }
  /*   public void add()
    {
      sno=sno+1;
      addrow();
    }  */
   public void addrow()
    {
        rowlist = new List<Sobject>();
        totalRecords=0;          
         sno = value.size();   
        system.debug('@@@@@@@@@@@@@'+sno);
        for(Sobject s:val4)
        {
            wrapperclass wr = new wrapperclass('s.Email','s.Name',false,s.id,sno);   
            value.add(wr);   
        } 
        system.debug('$$$$$$$$$$$$$$$'+value);
        
    }   

  public void removerow()
    {
        if(value.size() > 1)
        {
            value.remove(value.size()-1);
        }
    } 
                             
}

Thanks.
Hi,

I pasted my code below. Help me to resolve my issue.

public void addrow()
    {
        rowlist = new List<Sobject>();
        totalRecords=0;          
        sno = value.size();    
        system.debug('@@@@@@@@@@@@@'+sno);
        for(Sobject s:val4)
        {
            wrapperclass wr = new wrapperclass('s.Email','s.Name',false,s.id,sno);   
            value.add(wr);   
        } 
        system.debug('$$$$$$$$$$$$$$$'+value);
        
    }

Thanks.
Hi,
  I need to autopopulate the number datatype field after the record is deleted.
For example,
I have 5 records and their serial numbers are  1,2,3,4 and 5. If i delete the 3rd record , then the serial number of the 4th record should be automatically populated as 3 and 5th records as 4.
How to achieve this delete operation?

My Trigger Code:

trigger RecordSteps on Record__c(before insert,after delete) 
    {
        List<Record__c> cp = new List<Record__c>(); 
        set<id> id = new set<id>();
        List <AggregateResult> requirements = new List<AggregateResult>();  
       if (Trigger.isBefore && Trigger.isInsert)
       { 
        for(Record__c pt:trigger.new)
        {
         requirements=[select Count(Seq__c) from Record__c];
         if(requirements.size() > 0)
         {
         for(AggregateResult ar:requirements)
         {
         pt.Seq__c = Decimal.ValueOf(String.ValueOf(ar.get('expr0')));
          }
      }
      }
}
      if (Trigger.isAfter&& Trigger.isDelete) 
      {
      for(Record__c pt1:trigger.old)
        {
          }
          }   
     }
Hi All,

Can anyone send me the source code for this requirement.

Thanks in advance
Hi,

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Permissionset caused an unexpected exception, contact your administrator: Permissionset: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.Premissionset: line 6, column 1

trigger Permissionset on Permissionset__c (Before Update) 
{
   User usr = [SELECT Id,Profile.Name FROM User WHERE Id =:UserInfo.getUserId()];
   if(trigger.isUpdate && trigger.isBefore)
   {
       List<PermissionSetAssignment> lstcurrentUserPerSet = [SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSet.Label LIKE '%Super%'];      
       for(Permissionset__c tt:Trigger.new)
       {       
           if(trigger.oldMap.get(tt.id).CTMax__Global_Usage__c == true  && lstcurrentUserPerSet[0].AssigneeId != usr.id && usr.Profile.Name != 'System Administrator')
           {
              tt.adderror('Only Super User has access to update the Master Template. Please Contact Super User');
           }
       }
   }
}

Thanks in Advance
Hi

I have fields like S.No and Email. My Requirement is when i try to insert or update the bulk records using data loader, trigger has to check the S.No is already exists when S.No and Email is poulated and display the error message and in same way trigger has to check the S.No is already exists when s.no is populated  and Email is not poulated and display the error message.

Thanks in Advance.
 
Hi Everyone,

                  I created the custom javascript button. The issue is when i click on that button it is redirecting to the some other page which is not i am expecting, I mentioned the URLs for your reference,
for eg:
https://test--ctm--ctm.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> This URL coming default
https://test--ctm--c.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> I need to redirect to this URL

I am expecting to do this functionality only in javascript without using the apex class.

Thanks in Advance.
Hi Guys,

                I am trying display my group name ( My Group)  in Group drop down list.(marked in red box) . somebody help me to how to display My Group in that drop down to all users in my org.
User-added image
Thanks.
Hi,

   I have to check the file is csv or not while uploading it, if not then i want to display the error message, otherwise it gets upload without showing the error "Error:BLOB is not a valid UTF-8 string"

Thanks in Advance

 
Hi,

    I need to insert my company logo(which is already designed using site.com) in VF Page. Can anyone tell how to achieve this functionality.

Thanks in Advance.

Hi,

I need to put a custom related list on the account detail page and put the Hover link on the top of the page for the custom related list.

 

I was able to do the custom related list displayed on the bottom of the Account detail page wiring a standard controller extension and visula force page.

 

Now the problem is How do I place the Hover link on the top of the page for the custom list? I saw couple of threads for the above, but the hover links issue was never discussed?.

 

Can any one please guide me how can I do this.

 

Thank you.