• Kbhaskar
  • NEWBIE
  • 170 Points
  • Member since 2015


  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 15
    Replies
i have a  requirement when only account field type update to Prospect the related opp stage name  update's Prospect ,but her whenever i chage any field in account . the opp stage names update's Prospect .
 
trigger updateopportunities on Account(after update) 
{
    Set<Id> accountIds = new Set<Id>(); //new set of IDs 
    for(Account ac : Trigger.new)     //bulklification 
    {
         {
            if(ac.Type!=trigger.oldMap.get(ac.Id).name)   // er
         

         if(ac.Type=='Prospect')        //if axcount if of prospect
         accountIds.add(ac.Id);         //add it to set values 
       {
    }

     List<Opportunity> oppsToUpdate = new List<Opportunity>();      //new list 

     for(Opportunity opp : [select id, StageName from Opportunity where AccountId in: accountIds]) //bulklification   query for stagename ,id from opportunity
     {
          opp.StageName='Prospect';      
          oppsToUpdate.add(opp);         //  adding to the list     
     }

     update oppsToUpdate;               //update the opp
}
}
}

 
Hi all ,
While accessing data from Salesforce, I have to activate TLS 1.0 but I have a requirement where I should activate it, or how to update my salesforce system to acquire TLS 1.0 
thanks ,
How to work with text to speech functionality in Salesfroce desktop?.
Hi everyone, i have an IT project lined up regarding text to speech functionality. I would like to know that how to work with text to speech functionality from API or from AppExchange in Salesfroce desktop UI ?
Hello there,
Is it possible to build a approval process when a record is updated .For example  i do have multiple fields in account object and if a user update's any one field in the account object a approval procees is fired to the 'admin '.is it possible ?
hi,
I am trying to add a new validation rule ISNUMBER(number) on a custom phone  field.
but it seems like its accepting  symbols like + at the first position
 ISNUMBER(Phone_c)
eg:-
ISNUMBER('12345') --> no error 
ISNUMBER('+1234')--->no error(this needs to be avoided )
------------------------------------------------------------------------------------------------------------------------------

IF( 
ISBLANK(Phone_c) , false , ISNUMBER(Phone_c))
hi all ,
Am just curious why Salesforce can't let you See Note object ?
when i have query like (select id,Title FROM Note) it displays the data but I cannot see that object in salesfroce UI,can anyone help me out 

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_note.htm
 
Thanks
BK
hi
i'm trying to update Field permission set from apex code  but still it's not working can anyone help me out !
Error: Compile Error: Method does not exist or incorrect signature: [List<FieldPermissions>].put(Integer, String) 

 
String parameterValue = ApexPages.currentPage().getParameters().get('Permission_Set_ID'); //Permission_Set_ID reference from URL

}
}
//update field permission for Opportunity  permission
        fieldpermissions fp=new fieldpermissions();
        list<fieldpermissions>rt=[select id FROM fieldpermissions where parentid=:parameterValue AND      SobjectType='Opportunity' ];       
 rt.put(1,parameterValue );
        
        if(!rt.isempty())
        {
        fp.id=rt[0].id ;
        }else{
          rt.parentid          = parameterValue ;
          rt.SobjectType       ='Opportunity'; 
        }
        
        for(wrapper i:lstwrapperIntString)
        {
        if(i.selectedread ==true){  //vf page if selected read
         rt.PermissionsRead= true;
        }
        if(i.selectedwrite ==true){
         rt.PermissionsEdit=true;
         rt.PermissionsRead= true;
         }
           upsert rt;
        }
           return null;

    }
}

 
I'm getting the following error:

Error: Compile Error: Initial term of field expression must be a concrete SObject: Map<Id,FieldPermissions> at line 71 column 9

Here are the snippets of code 
//update field permission for Opportunity  permission
        fieldpermissions fp=new fieldpermissions();
        Map<id,fieldpermissions>rt=new Map<id,fieldpermissions >([select id,Field FROM fieldpermissions where parentid=:parameterValue AND SobjectType='Opportunity']);
        if(!rt.isempty()) //Compile Error
        {
        rt.id=rt[0].id ;
        }else{
          rt.parentid          = parameterValue ;
          rt.SobjectType       ='Opportunity'; 
        }
        
        for(wrapper i:lstwrapperIntString) //wrapper loop
        {
        if(i.selectedread ==true){
         rt.PermissionsRead= true;
        }
        if(i.selectedwrite ==true){
         rt.PermissionsEdit=true;
         rt.PermissionsRead= true;
         }
           upsert rt;
        }
           return null;

    }

 
hi,
I do have a requirement where we need to use for loop  with if statement for multiple fields if selected ,is it possible ?
}	
public pagereference actionsupport()                 //pageReference method
	{
		lstwrapperIntString = new List<wrapper>();       //new lstwrapperIntString list
		Map<String, SobjectField> fieldMap = Opportunity.getsObjectType().getDescribe().Fields.getMap(); 
		for(String f : fieldMap.keySet())
		{
			lstwrapperIntString.add(new wrapper(fieldMap.get(f).getDescribe().getLabel(),selectedValue));
		}
		return null;
	}
	public class wrapper    //Wrapper Class 
	{
		public boolean selectedread  {get;set;}
		public boolean selectedwrite {get;set;}

		public String  fieldName     {get;set;}

		public wrapper(String Name,String write) // wrapper constructor 
		{
			this.fieldName=Name;                     
			this.selectedread=true;
			if(write=='writeseleted')
			{
				this.selectedwrite=true;
			}
		}  
	}

 
hi, 
i'm trying to update permission set from apex code  but still it's not working can anyone help me out !
String parameterValue = ApexPages.currentPage().getParameters().get('Permission_Set_ID'); //Permission_Set_ID from the URL for reference 






         }
      }  
   }
       public pagereference Assign()   //assign of user difend permissions
              {
            if(selectedValue == 'readselected')          
             {
              //update Object permission for Opportunity 
                PermissionSet ps =[select id,ProfileId,SystemModstamp,UserLicenseId FROM PermissionSet where id='parameterValue '];
                ObjectPermissions op = new ObjectPermissions();
                op.parentid          = ps.id;
                op.SobjectType       = 'Opportunity';  
                op.PermissionsCreate = false;
                op.PermissionsRead   = true;
                op.PermissionsEdit   = false;
                insert op;
                 } 
          return null;
        
     }
     }

 
hi, 
i'm trying to update permission set from apex code but still it's incorrect can anyone help me out !
Error: actionradioab Compile Error: Variable does not exist: SobjectType at line 40 column 9

 
}
       public pagereference Assign()   
          {
        if(selectedValue == 'readselected')          
         {
        //update Object permission for Opportunity 
        actionradioab op = new actionradioab();
        op.permissionSetID = parameterValue;
        op.SobjectType = 'Opportunity';
        op.PermissionsCreate = false;
        op.PermissionsRead = true;
        op.PermissionsWrite = false;
        update op;

        }
        }
}

User-added image
 
hi,
Below is the code for  displaying Checkbox and Field Label in two colums but i'm not able to see field name can anyone help me out !
 
<!----------- Creating this page for dispaly Opportunity fields object in single table with check box ---------->

<apex:page  controller="WrapperIntStringDisplayClass">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!lstwrapperIntString}" var="w">
                    <apex:column headervalue="click2Select">
                        <apex:inputcheckbox />
                    </apex:column>
                    <apex:column headervalue="Opportunity fields">
                        {!w.Id}
                        {!w.Name}                 
                    </apex:column>    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex class
public with sharing class WrapperIntStringDisplayClass 
 {
// Creating lists for the object opportunity
   List<opportunity> lsttest = new List<opportunity>();
// Creating List for Wrapper class
   public List<wrapper> lstw = new List<wrapper>();
// Get method calling from PageBlockTable and return the list of wrapper to Table
   public List<wrapper> getLstwrapperIntString() {
        lsttest = [select Id, Name from opportunity];
    for(Integer i=0;i<lstw .size();i++){
        lstw.add(new wrapper(lsttest[i].Id,lsttest[i].Name));
}
    return lstw;
}
// Wrapper Class Construction

    public class wrapper{
         public String Id{get;set;}
         public String Name{get;set;}
// Wrapper class constructor
    public wrapper(String Id,String Name ){
        this.Id=Id;
        this.Name=Name;
        }
        
    }
}

Visualforce page _
vf page
hi, 
the below code(Still incorrect) is dynamically render a label value based on radiobutton onchange.but how i can  dynamically render a pageblock based  radiabutton onchange ?
 
<apex:page controller="Sample34">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                Object Permissions:
                <apex:selectRadio >
                    <apex:selectOption id="read1" itemLabel="Read" itemValue="f"  />
                    <apex:selectOption id="write1" itemLabel="Write" itemvalue="cpp" />   
                    <apex:actionsupport event="onchange"  rendered="sampleView" />
               </apex:selectRadio>
            </apex:pageBlockSection>
            <apex:outputPanel id="SampleView">
                <apex:pageBlockSection rendered="{!isChecked}">
                    <apex:pageblockSectionItem >
                        <apex:outputlabel value="Section 1"/>
                    </apex:pageblockSectionItem>                           
                </apex:pageBlockSection>
                <apex:pageBlockSection rendered="{!IF(isChecked = true , false , true)}">
                    <apex:pageblockSectionItem >
                        <apex:outputlabel value="Section 2"/>    
                    </apex:pageblockSectionItem>            
                </apex:pageBlockSection>
            </apex:outputPanel>
            <apex:pageBlockButtons >
                <apex:commandButton value="Assign"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Class
public class Sample34 {

    public Boolean isChecked { get; set; }
}

 
Hi,
According to a requirement ,I have created a vf page to create a user but on same time Standard Object Permissions should be editied on the same visualfroce page and it should be reflected to the desired profile is it possible ?
 
<apex:page standardController="User" extensions="CreateNewStaffAndUserExtension" >
 
 
   
  
<apex:sectionHeader title="Welcome" subtitle="Create a new user" help="/help/doc/user_ed.jsp?loc=help"></apex:sectionHeader>
    <apex:form >
        <apex:pageBlock mode="edit">
        <apex:pageMessages />
            <apex:pageBlockButtons >
                    <apex:commandButton action="{!save}" value=" Save " ></apex:commandButton>
                    <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
                 </apex:pageBlockButtons>
              
              <apex:pageBlockSection title="User Information" columns="2" collapsible="false">  
                
                 
                  <apex:inputField value="{!User.IsActive}"/>
                  <apex:inputField value="{!User.FirstName}"/>
                  <apex:inputField value="{!User.Username}"/>
                  <apex:inputField value="{!User.LastName}"/>
                  <apex:inputField value="{!User.Email}"/>
                  <apex:inputField value="{!User.alias}"/>
                  <apex:inputField value="{!User.UserRoleId}"/>
                  
                 
                  </apex:pageBlockSection>
                 <!-- <apex:inputField value="{!User.UserType}"/> -->
            
           
            

              <!--  <apex:pageBlockSectionItem >
                    <apex:outputLabel value="User" for="usr"></apex:outputLabel>
                   
                    <apex:selectList value="{!selectedRoleId}" multiselect="false" size="1" id="selectedRoleId">
                       <apex:selectOptions value="{!userList}" />
                    </apex:selectList>
                    </apex:pageBlockSectionItem>
            
            -->
                    
                    
            <apex:pageBlockSection >
              <!--    <apex:inputField value="{!User.ProfileId}"/> -->
                   <apex:inputField value="{!User.Phone}"/>
                   <apex:inputField value="{!User.Extension}"/>
                   <apex:inputField value="{!User.Fax}"/>
                   <apex:inputField value="{!User.EmployeeNumber}"/>
                   <apex:inputField value="{!User.Title}"/>
                   <apex:inputField value="{!User.CompanyName}"/>
                   <apex:inputField value="{!User.Division}"/>
                   <apex:inputField value="{!User.Department}"/>
                   <apex:inputField value="{!User.CommunityNickName}"/>

                 <!--  <apex:inputField value="{!User.UserType}"/> -->
                   
                   <apex:inputField value="{!User.ReceivesInfoEmails}" />
                   </apex:pageBlocksection>
              
                    <apex:pageBlockSection columns="1" showHeader="false" title="License">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="License" for="lic"></apex:outputLabel>
                    <apex:selectList id="mgr" value="{!User.UserType}" size="1" title="Manager">
                        <apex:selectOptions value="{!license}"></apex:selectOptions>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Profile" for="pro"></apex:outputLabel>
                   
                    <apex:selectList value="{!User.ProfileId}" multiselect="false" size="1" id="selectedProfileId">
                       <apex:selectOptions value="{!profile}" />
                    </apex:selectList>
                    </apex:pageBlockSectionItem>
            </apex:pageBlockSection> 
            
              
              
               <apex:pageBlockSection title="Other Information" columns="1" collapsible="false">
                   <apex:inputField value="{!User.EmailEncodingKey}"/>
                   <apex:inputField value="{!User.TimeZoneSidKey}"/> 
                   <apex:inputField value="{!User.LocaleSidKey}"/>
                   <apex:inputField value="{!User.LanguageLocaleKey}"/>
               </apex:pageBlockSection>
            <apex:pageBlockSection>   
          <apex:pageBlockSectionItem >
          <apex:outputLabel value="License" for="lic"></apex:outputLabel>
          <apex:selectList id="mgr" value="{!User.UserType}" size="1" title="Manager">
             <apex:selectOptions value="{!license}"></apex:selectOptions>
            <u> <apex:actionSupport event="onchange" rerender="selectedProfileId"/></u>
           </apex:selectList>
        </apex:pageBlockSectionItem>
            
                       </apex:pageBlockSection>   

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

Apex class 
public class CreateNewStaffAndUserExtension {


   
    public Id accountId{get;set;}
    public String accountName{get;set;}

      public List<Account> accs{get;set;}

    private final User user;
    public CreateNewStaffAndUserExtension(ApexPages.StandardController controller)
    {
    
 
      this.user= (User)controller.getrecord();

    }
    
 
    public List<selectOption> getLicense()
    {
        List<selectOption> options = new List<selectOption>(); //new list for holding all of the picklist options
        options.add(new selectOption('', '- None -')); //add the first option of '- None -' in case the user doesn't want to select a value or in case no values are returned from query below
          for (UserLicense users :[SELECT Id,Name FROM UserLicense])  
          {    
                options.add(new selectOption(users.Id, users.Name)); //for all records found - add them to the picklist options
          }
        return options; //return the picklist options
    }
    
    public List<selectOption> getProfile() {
        List<selectOption> options1 = new List<selectOption>(); //new list for holding all of the picklist options
        options1.add(new selectOption('', '- None -')); //add the first option of '- None -' in case the user doesn't want to select a value or in case no values are returned from query below
     //   for (User users : [SELECT Id,UserType FROM User]) { //query for User records with System Admin profile
     for (Profile users1 :[SELECT Id,Name FROM Profile])  {    
                options1.add(new selectOption(users1.Id, users1.Name)); //for all records found - add them to the picklist options
        
        
        
        
        } 
        
        
        return options1; //return the picklist options 
   
   
    } 
  
    
 }


 
Hi how to assign a opportunity Stage values to a particular record type in salesfroce  ?
Hi how to assign a field  to a particular record type in salesfroce

eg A,B are two record types and how to assign them separate fields to them i.e when user clicks on A only A fields are shown  
hi have an error  where need to save amount with respect to record types
Error: Syntax error. Found ')'
AND(
OR(
Amount<10000,
Amount<>10000,
OR(
$RecordType.Name="Small Opportunities",
$RecordType.Name="Big Opportunities",
)))
hi, below is validation rule on date but still i do have err
Error: Syntax error. Extra ','
IF(ISPICKVAL(Account.Type,"Prospect") && DAY(CloseDate) < Today()), true,
IF(ISPICKVAL(Account.Type,"Customer - Direct") && DAY(CloseDate) > Today()), true,
IF(ISPICKVAL(Account.Type,"Customer - Channel") && DAY(CloseDate) > Today()), true,
IF(ISPICKVAL(Account.Type,"Customer") && DAY(CloseDate) > Today(),true, false))
hi im on error when
Opportunity Close date should be in future if account type is prospect else if account type is customer (Opportunity Close date should be in future if account type is prospect else if account type is customer it should be past date

IF(ISPICKVAL( Account.Type,"Prospect") && DAY(CloseDate) < Today()), true,
IF(ISPICKVAL( Account.Type,"Customer ") && DAY(CloseDate) >Today()), true, false)))
hi have done a visual flow tailhead (where a single page(screen) makes auto creation of acount,conatct have been created but when it goes to opp i had this erro )
An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more informati


Encountered unhandled fault when running process New_Customer_Flow/30128000000D1bi exception by user/organization: 00528000000fR1Y/00D28000000UfsRErrorcaused by element : FlowRecordCreate.opp_create
caused by: UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,


An error occurred at element opp_create.
UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null, .

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange
Flow Details

Flow Name: New_Customer_Flow

Type: Flow

Version: 1

Status: DRAFT
Flow Details

Start time(GMT): Wed Sep 02 05:12:32 GMT 2015

End time(GMT): Not Yet Finished

Duration: 16 seconds
Screen: screen_1
Record Create: acc_create
Screen: screen_1345
Record Create: con_create
Screen: contact_created_working_on_opp
Record Create: opp_createSalesforce Error ID: 1328056676-56599 (-1680723869)
Hi ,the below code shows case's with subject but when i click on the subject of the case  the page directs the user to the detail page of the respective case record. but thats not happening below .does anyone knows about it ?
apex Class
public with sharing class NewCaseListController {
    public List<Case> getNewCases() {
        List<Case> results = Database.query(
            'SELECT Id,Subject, CaseNumber, Origin, Status, Account.Name ' +
            'FROM Case ' +
            'LIMIT 100'
    );
    return results;
}

}
apex page 1
<apex:page controller="NewCaseListController">
  <apex:repeat value="{!NewCases}" var="Case">

<apex:outputLink onclick="/apex/detailtag?id={!Case.Id}">
 <li> {!Case.subject}</li>
   
  </apex:outputLink>
  </apex:repeat>
  
</apex:page>
page 2(detail tag)
apex/detailtag
<apex:page standardController="case">
   <apex:detail subject="{!case.userdetail}" relatedList="false" title="false"/> 
</apex:page>




 
hi
can anyone know how to follow  the 'Opportunities Dashboard' in Chatter. (*Feed Tracking enabled)
regards,
kb
There is a requirement of using ios as front end and salesforce as backend.How to establish connection between these two.
Can somebody please help me.

Thanks in advance.
hi
i'm trying to update Field permission set from apex code  but still it's not working can anyone help me out !
Error: Compile Error: Method does not exist or incorrect signature: [List<FieldPermissions>].put(Integer, String) 

 
String parameterValue = ApexPages.currentPage().getParameters().get('Permission_Set_ID'); //Permission_Set_ID reference from URL

}
}
//update field permission for Opportunity  permission
        fieldpermissions fp=new fieldpermissions();
        list<fieldpermissions>rt=[select id FROM fieldpermissions where parentid=:parameterValue AND      SobjectType='Opportunity' ];       
 rt.put(1,parameterValue );
        
        if(!rt.isempty())
        {
        fp.id=rt[0].id ;
        }else{
          rt.parentid          = parameterValue ;
          rt.SobjectType       ='Opportunity'; 
        }
        
        for(wrapper i:lstwrapperIntString)
        {
        if(i.selectedread ==true){  //vf page if selected read
         rt.PermissionsRead= true;
        }
        if(i.selectedwrite ==true){
         rt.PermissionsEdit=true;
         rt.PermissionsRead= true;
         }
           upsert rt;
        }
           return null;

    }
}

 
hi, 
i'm trying to update permission set from apex code  but still it's not working can anyone help me out !
String parameterValue = ApexPages.currentPage().getParameters().get('Permission_Set_ID'); //Permission_Set_ID from the URL for reference 






         }
      }  
   }
       public pagereference Assign()   //assign of user difend permissions
              {
            if(selectedValue == 'readselected')          
             {
              //update Object permission for Opportunity 
                PermissionSet ps =[select id,ProfileId,SystemModstamp,UserLicenseId FROM PermissionSet where id='parameterValue '];
                ObjectPermissions op = new ObjectPermissions();
                op.parentid          = ps.id;
                op.SobjectType       = 'Opportunity';  
                op.PermissionsCreate = false;
                op.PermissionsRead   = true;
                op.PermissionsEdit   = false;
                insert op;
                 } 
          return null;
        
     }
     }

 
hi, 
i'm trying to update permission set from apex code but still it's incorrect can anyone help me out !
Error: actionradioab Compile Error: Variable does not exist: SobjectType at line 40 column 9

 
}
       public pagereference Assign()   
          {
        if(selectedValue == 'readselected')          
         {
        //update Object permission for Opportunity 
        actionradioab op = new actionradioab();
        op.permissionSetID = parameterValue;
        op.SobjectType = 'Opportunity';
        op.PermissionsCreate = false;
        op.PermissionsRead = true;
        op.PermissionsWrite = false;
        update op;

        }
        }
}

User-added image
 
hi,
Below is the code for  displaying Checkbox and Field Label in two colums but i'm not able to see field name can anyone help me out !
 
<!----------- Creating this page for dispaly Opportunity fields object in single table with check box ---------->

<apex:page  controller="WrapperIntStringDisplayClass">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!lstwrapperIntString}" var="w">
                    <apex:column headervalue="click2Select">
                        <apex:inputcheckbox />
                    </apex:column>
                    <apex:column headervalue="Opportunity fields">
                        {!w.Id}
                        {!w.Name}                 
                    </apex:column>    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex class
public with sharing class WrapperIntStringDisplayClass 
 {
// Creating lists for the object opportunity
   List<opportunity> lsttest = new List<opportunity>();
// Creating List for Wrapper class
   public List<wrapper> lstw = new List<wrapper>();
// Get method calling from PageBlockTable and return the list of wrapper to Table
   public List<wrapper> getLstwrapperIntString() {
        lsttest = [select Id, Name from opportunity];
    for(Integer i=0;i<lstw .size();i++){
        lstw.add(new wrapper(lsttest[i].Id,lsttest[i].Name));
}
    return lstw;
}
// Wrapper Class Construction

    public class wrapper{
         public String Id{get;set;}
         public String Name{get;set;}
// Wrapper class constructor
    public wrapper(String Id,String Name ){
        this.Id=Id;
        this.Name=Name;
        }
        
    }
}

Visualforce page _
vf page
hi, 
the below code(Still incorrect) is dynamically render a label value based on radiobutton onchange.but how i can  dynamically render a pageblock based  radiabutton onchange ?
 
<apex:page controller="Sample34">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                Object Permissions:
                <apex:selectRadio >
                    <apex:selectOption id="read1" itemLabel="Read" itemValue="f"  />
                    <apex:selectOption id="write1" itemLabel="Write" itemvalue="cpp" />   
                    <apex:actionsupport event="onchange"  rendered="sampleView" />
               </apex:selectRadio>
            </apex:pageBlockSection>
            <apex:outputPanel id="SampleView">
                <apex:pageBlockSection rendered="{!isChecked}">
                    <apex:pageblockSectionItem >
                        <apex:outputlabel value="Section 1"/>
                    </apex:pageblockSectionItem>                           
                </apex:pageBlockSection>
                <apex:pageBlockSection rendered="{!IF(isChecked = true , false , true)}">
                    <apex:pageblockSectionItem >
                        <apex:outputlabel value="Section 2"/>    
                    </apex:pageblockSectionItem>            
                </apex:pageBlockSection>
            </apex:outputPanel>
            <apex:pageBlockButtons >
                <apex:commandButton value="Assign"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Class
public class Sample34 {

    public Boolean isChecked { get; set; }
}

 
i have a  requirement when only account field type update to Prospect the related opp stage name  update's Prospect ,but her whenever i chage any field in account . the opp stage names update's Prospect .
 
trigger updateopportunities on Account(after update) 
{
    Set<Id> accountIds = new Set<Id>(); //new set of IDs 
    for(Account ac : Trigger.new)     //bulklification 
    {
         {
            if(ac.Type!=trigger.oldMap.get(ac.Id).name)   // er
         

         if(ac.Type=='Prospect')        //if axcount if of prospect
         accountIds.add(ac.Id);         //add it to set values 
       {
    }

     List<Opportunity> oppsToUpdate = new List<Opportunity>();      //new list 

     for(Opportunity opp : [select id, StageName from Opportunity where AccountId in: accountIds]) //bulklification   query for stagename ,id from opportunity
     {
          opp.StageName='Prospect';      
          oppsToUpdate.add(opp);         //  adding to the list     
     }

     update oppsToUpdate;               //update the opp
}
}
}

 
Hi how to assign a field  to a particular record type in salesfroce

eg A,B are two record types and how to assign them separate fields to them i.e when user clicks on A only A fields are shown  
hi have an error  where need to save amount with respect to record types
Error: Syntax error. Found ')'
AND(
OR(
Amount<10000,
Amount<>10000,
OR(
$RecordType.Name="Small Opportunities",
$RecordType.Name="Big Opportunities",
)))
hi,
 can you correct this 
Public static set<Id>getUniqueIds(list<SObject>sobs)
{
set<Id>Ids=new set<Id>();
for(SObject sob : sobs)
{
Ids.add(sob.Id);
}
return Ids;
}
Error: Compile Error: unexpected token: 'set' at line 1 column 14

 
Hi all,

User-added image

There is some kind of problem with this... Seems the filter is on:

User-added image

Thanks in advance

joseluis
I created several process builder proceeses around check boxes on the contact object.  I wanted to trigger these to update in mass so I created a hidden checkbox field on the contact object called 'Mass Update', set the value to true for all and trying to do an update. I got the error: The record couldnt be saved because it failed to trigger a flow. <br>A flow trigger failed to execute the flow with version ID 30116000000PPKL. <br/> Contact your administrator for help.

I don't have any active conflicting workflow rules on these fields.  When I tested the active processes they all individually worked. Why am I getting this for all 16K contacts i'm trying to update using Jitterbit? 
Hi All,

I want to display number of contacts associated with an account using triggers.

for this I had created a lookup field like noofcontacts__c in account  object. and Wrote code as

trigger numberofcontacts on contact(after insert, after update, after delete) {
    Map<Id, List<Contact>> AcctContactList = new Map<Id, List<Contact>>();
    Set<Id> AcctIds = new Set<Id>();   
    List<schema.Account> AcctList = new List<schema.Account>();
    List<schema.Contact> ConList = new List<schema.Contact>();
   
    if(trigger.isInsert || trigger.isUPdate) {
        for(Contact Con : trigger.New) {
            if(String.isNotBlank(Con.AccountId)){
                AcctIds.add(Con.AccountId); 
            }  
        } 
    }
   
    if(trigger.isDelete) {
        for(Contact Con : trigger.Old) {
            AcctIds.add(Con.AccountId);    
        } 
    }          
   
    if(AcctIds.size() > 0){
        ConList = [SELECT Id, AccountId FROM Contact WHERE AccountId IN : AcctIds];
       
        for(Contact Con : ConList) {
            if(!AcctContactList.containsKey(Con.AccountId)){
                AcctContactList.put(Con.AccountId, new List<Contact>());
            }
            AcctContactList.get(Con.AccountId).add(Con);     
        }                          
      
           
        AcctList = [SELECT noofContacts__c FROM Account WHERE Id IN : AcctIds];
        for(Account Acc : AcctList) {
            List<schema.Contact> ContList = new List<schema.Contact>();
            ContList = AcctContactList.get(Acc.Id);
            Acc.Number_of_Contacts__c = ContList.size();
        }   
       
      
        update AcctList;   
    }

}
 I am   getting an error as "Variable doesnot exist:id".

Kindly support and suggest.

Thanks