• CvrK
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 18
    Replies
Hi Everyone,

  I have a picklist value called AV_Category__c when this picklist value is with "ISO" as its value and Recordtype name as 'Case' along whenever the  OwnerId  changed . the status field should be updated as "Pending"

i am successfull till the below part but how can i add the picklist value for the formula..
(RecordType.Name == 'Case' ) && (ISCHANGED( OwnerId))

Thanksl in advance
  • March 08, 2016
  • Like
  • 0
Hi ,

How to Enable or Disable a commandbutton based on selecting a picklist value,
I have requirement to enable/disable a command button based on a picklist value then i have an Outputpanel(a fieldset inside) that has to be displayed when the button is clicked..the button has to be enabled only twice.

I am breaking my head since the three days, sample code will be very highly appreciated.
I am posting the question here after a lot of Online references, but i hav not find any online reference or code that is close to my requirement.


Thanks in Advance
Ck  
  • January 07, 2016
  • Like
  • 0
Hi,
How to display a fieldset in outputpanel after render/rerender based on commanbutton's onclick event.

Thanks
Cvrk
  • January 05, 2016
  • Like
  • 0
Hi,
How to call a picklist field based on the selected value of another picklist field?
For Ex: if i have a Picklist field Named Request__c with values Auditing and Consulting
When I select Auditing value,another picklist field named US__c should be displayed, similarly if Consulting__c is selected,UK__c should be displayed.
please provide the sample code if possible.

Thanks
Cvrk
 
  • January 04, 2016
  • Like
  • 0
Hi Everyone,
Is there any way out there to provide Notes and Attachment option in VF Page(Web form),so that when users try to submit requests for the case object using web form they can enter the notes and upload related attachment along with the field values,which helps the support people to process their request,
Currently what i have in mind is, creating a Description(Text Area) field and making it availablle for then web form.just wondering if there is any better solution than my idea. Please provide me any sample code if possible.

Thanks
Cvrk 
  • December 29, 2016
  • Like
  • 0
Hi Everyone,
I have a requirement to display different fieldsets after rerender based on its respective picklist value selection by user in the field called Request Type.
After clicking save(saverequest custom method to save records) one record in Case Object and one in Custom Obj (Functional_Request__c) should be created along with an attached document(document should go into document object),now my records are saving in objects but i am unable to provide upload and download  functionality to my webforms.

Note: The upload option shoud be enabled/available to users only for the 1st Select option and download option for the 3rd option out of 3 options and currently there are unused variable and methods in the cotroller, i left it in as they are,thought it gets easier for anyone of you to help me.
Sample Web form

I have tried the steps from below links but no luck,i wonder it is because i have custom save method to save records and may not be close to my use case.
http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller
http://blog.jeffdouglas.com/2010/04/28/uploading-an-attachment-using-visualforce-and-a-custom-controller/


Help will be highly appreciated.

 
VF Page code:



                         <apex:actionRegion >
                            <apex:selectList label="Request Type" value="{!RequestValue}" size="1" multiselect="false">
                                    <apex:actionSupport event="onchange"  reRender="fieldSet"/>
                                    <apex:actionstatus startText="Applying Values.............">                   
                                    </apex:actionstatus>
                                     <apex:selectOption itemLabel="Provide Access Request" itemValue="Provide_Access_Request"></apex:selectOption
                                     <apex:selectOption itemLabel="Other" itemValue="Other"></apex:selectOption>
                                     <apex:selectOption itemLabel="Package Request" itemValue="Package_Request"></apex:selectOption> 
                                     </apex:selectList>
                          </apex:actionRegion>

          <apex:commandButton action="{!saveRequest}" value="Submit" styleClass="js-save-button button green submitButton" />
          <apex:commandButton action="{!Cancel}" value="Cancel" styleClass="js-save-button button green submitButton" />





Controller:

Public without sharing class  Provisional_Request_ctrl extends WSitesController
{

 

    /*Public Variables*/
    
    Public Functional_Request__c FormExtn {get;set;}
    Public List<Functional_Request__c> licaseformextn;// {get;set;}
    Public Map<string,Functional_Request__c> caseformmap;// {get;set;}
    Public Case Ocase; //{get;set;} 
    Public List<RecordType> OcaseRecordType;// {get;set;}
    public String recordType {get;set;}
    public String requesttype {get;set;}
    public String additionalcomments;//{get;set;} 
    public List<RecordType> ProvisionalRecordtypes {get; set;}
    public List<SelectOption> orecordtypes {get; set;}
    Public string iscentraloginisuue{get;set;}
    
    Functional_Request__c str;
    Public Document doc {get;set;}
    public List<String> docIdList = new List<string>();
  
    public boolean addAttachment{get; set;}
    public string setpopdisplay{get;set;}
    public List<Document> selectedDocumentList {get;set;}
    
    
    /* Error Message related variables */
    public boolean pageError {get; set;}
    public boolean showlist{get; set;}
    public boolean RenderFunction{get; set;}
    public boolean RenderFieldSetBlock{get; set;}
    public String pageErrorMessage {get; set;}
    public string formname{get;set;}
    Public Map<string,Id> caseformextrecordtypeMap{get;set;}
    
    public boolean displayPopup{get; set;}
    Public string contactemailid{get;set;}
    public boolean fileUpload{get;set;}
    public string RequestValue{get; set;}
    
    Public Provisional_Request_ctrl(){
        
      //Create New Record in Functional Request Obj Object      
        FormExtn = new Functional_Request__c ();
        caseformmap =  new Map<string,Functional_Request__c> ();
        Ocase = new case();        
        doc = new Document();
        doc = null;
       // UploadedDocumentList = new List<AttachmentsWrapper>();
        showlist = false;
        RenderFieldSetBlock = false;
        requesttype = 'None';
        iscentraloginisuue = 'false';
        RenderFunction = true;
        getfields();
        displayPopup = true;
        contactemailid = '';
        addAttachment = false;
        setpopdisplay = ''; 
        
        }
   
   public pagereference Cancel()
    {
        pageReference pg=new PageReference('https://domain.visual.force.com/apex/FRS_Request');
        pg.setRedirect(True);
        return pg;
    }
   
   
   // Get record types for  request forms and display in 'Request type'.
    
    
    Public void getfields(){
     
        if(String.IsNotEmpty(apexpages.currentpage().getparameters().get('Param1'))){
           RenderFieldSetBlock=true; 
           RenderFunction = false;
           requesttype = apexpages.currentpage().getparameters().get('Param1');
           formname=requesttype;
           requesttype = EncodingUtil.urlDecode(requesttype, 'UTF-8');
           FormExtn.TDR_Request_Type__c = requesttype ;   
           DlccategorySelection = '';
           system.debug('12784563' + requesttype);
           if(requesttype != 'None'){
               requesttype=requesttype.replace(' ','_').replace('(' , '').replace(')' , '').replace(',' , '_').replace('-' , '_').replace('/' , '_').replace('.' , '');
           }
           
           if(requesttype.length() > 41){
               
             requesttype = requesttype.substring(0,40);
             system.debug('@@@@@@@@@@@@' + requesttype );
             if(requesttype.endsWith('_')){
              requesttype= requesttype.removeEnd('_');
                              
             }
         }
       
       }
       
      }  
        
        
   // saverequest method is to save the request.
   
    Public PageReference saveRequest(){
                 
    try{
         pageError = false;
         pageErrorMessage = '';
         
        // If there is no validation error save the request.
              
          if(pageError == false){  
            
              RecordType rectype = new RecordType();
         
             string recrdtname; 
            
            system.debug('##'+RequestValue);
			
             if( RequestValue=='Provide_Access_Request')//referring fieldsets
             {
                         FormExtn.RecordTypeId = System.Label.Provide_Access_Request; //custom labels which has record typeIds in its value field
             
             }
             else
             if( RequestValue=='Other')
             {
                        FormExtn.RecordTypeId = System.Label.Other; 
                        fileUpload = true;
             }
             else
             if( RequestValue=='Package_Request')
             {
                         FormExtn.RecordTypeId = System.Label.Package_Request; 
             
             }
             
             
            
             
        //Insert Case
           try{
              Ocase = new case();
              Ocase.Status    = 'New';
              Ocase.Subject =  System.Label.TDR_Case_Subject;
              Ocase.Origin = System.Label.TDR_Case_Origin;
              Ocase.Description = apexpages.currentpage().getparameters().get('description') ;  
              Ocase.Contactid   = loggedInContact.id;             
              Ocase.Gen_Request_Type__c = RequestValue;
              Ocase.RecordTypeid   = System.Label.Provisional_RecordTypeId;
             
           // Assigning Case using Case-Assignment Rule.
             
             Database.DMLOptions dmlOpts = new Database.DMLOptions();
             dmlOpts.assignmentRuleHeader.assignmentRuleId= Label.Case_Assignment_Rule_Id ;
             dmlOpts.EmailHeader.TriggerUserEmail = true;
             Ocase.setOptions(dmlOpts); 
            
             Database.insert(Ocase, dmlOpts);
             
             system.debug('=========Case=======' + Ocase);
           
           // Insert Functional Request Obj. 
             FormExtn.Case_Form_App__c = System.Label.Case_Form_App;
             FormExtn.TDR_Employee__c  = loggedInContact.id;
             FormExtn.GEN_Case__c= Ocase.Id;
            
             system.debug('=========Form Extension=======' + FormExtn);
            
             Insert FormExtn;
        
             return new PageReference('/apex/AutoResponse_Page url); 
             }catch(Exception e){
             return null;
             }
          }
       
                 else{
           return null;
          }
}
catch(Exception ex){
system.debug('------getMessage----'+ex.getMessage()+'--------getLineNumber--------'+ex.getLineNumber());
 return null;
         }
        
    }
         
    
}

Thanks
Cvrk

 
  • December 24, 2015
  • Like
  • 0
Hi
I am trying to write a simple trigger that updates Stage name,amount fields on Opportunities when its associated account is 
updated with the Rating field value as 'Hot',Can someone help me with the Below trigger code which is saved but not working at all.

trigger AutoUpdateOpps on Account(after update) {
  List<Opportunity> newOpps = new List<Opportunity>();
  for (Account acc : Trigger.old) {
  if (acc.Rating=='Hot'){
    Opportunity opp = new Opportunity();
    opp.StageName   = 'Needs Analysis';
    opp.Amount      = 100,000;
    opp.AccountId   = acc.Id;
    newOpps.add(opp);
     }
  }
  update newOpps;
}
  • November 20, 2015
  • Like
  • 0
Hi,
I have seen lot of examples in the posts about avoiding recursive triggers,what i wonder why the boolean value is set to '"true" in helper class that handles the trigger events and why the boolean value is set to "false" in trigger.
can someone explain or post some sample code if possible eith comments so that it make sense to me what the boolean value is exactly doing the helper class and in the trigger.
  • November 09, 2015
  • Like
  • 0
Hi,
Is bulkyfying the trigger means,just defining the DML operation outside the loop or is it a specific work around that needs to be done based on the requirement?
  • November 09, 2015
  • Like
  • 0
Hi ,
Does trigger.newmap or trigger.oldmap used only to compare the values or is it possible to perform DML operation based on them alone,i mean without using trigger.new or trigger.old in the same trigger code
  • November 09, 2015
  • Like
  • 0

Hi 
i am at beggining stage of development Interested to know about best practices of apex controller, best practices and considerations for batch apex not just triggers,i have searched alot but only found the references for apex triggers not on controllers and batch apex.
below are my doubts that made me post here:
1)i got a convincing answer while reading about the difference between controllers and extensions 

The answer which i read says "controllers  can exist with or without parameterized constructors but extensions must have parameterized constructors" then
My doubt is why cant i have both parametered and non parameterized constructors in one controller instead of having an extension to my custom controller particularly when i use custom controllers with extensions not referring to the usage of standard controllers with extensions?


  • November 05, 2015
  • Like
  • 0
Hi 
can some one describe me some perfect use cases where trigger.newmap works instead of trigger.new and similarly where only trigger.oldmap works better than trigger.old
 
  • November 04, 2015
  • Like
  • 0
Hi 
1) Is it possible to update a child record when its associated master record is updated with a particular value on after update trigger?if possible which trigger context variable best suits the requirement?
For Example: when ever a field FA1 is updated with a X value in the master object then a field FB1 should be updated with X value on after update event.
2) similarly is it possible to delete child record when a master record is updated on after update event?
  • November 04, 2015
  • Like
  • 0
Hi Everyone,
can someone provide me any references or list out What are the approximate dates or months of salesforce releases?
  • November 03, 2015
  • Like
  • 0
Hi Everyone,
trigger.Newmap is available only for Before update,aftrer update and after insert triggers,
and Trigger.oldmap is available for Update and delete triggers but wondering is that for all events like  Before update,after update,before delete and after delete or only on specific events like mentioned for trigger.newmap
  • November 03, 2015
  • Like
  • 0
Hi Everyone,
i have below trigger with both before insert and after insert events,Client__c (Master Obj) and Project__c(Detail Obj) with master detail relationship.
My requirement is when a ever a new client record is going to be inserted Quotation__c field has to be updated with the value that provided in the trigger,and i have an after insert event in the same trigger

After trigger is working as expected but my before trigger throwing following error
Error for the trigger

Trigger :

trigger AutoProjects on Client__c (before insert,After insert){
    
    If(trigger.isbefore)
    {
         list <Client__c>NewClnts=New List<Client__c>();
         for(Client__c Clnt:trigger.New)
         {
            Client__c c=new Client__c();
            C.Name=   //Need a value that says "the record that is going to be created with any name not a particular name"
            c.Assigned_To__c='chhakri;chetan';
            NewClnts.add(C);
         }
       Insert NewClnts;  
    }
   
   if(Trigger.isafter){
    List <Project__c> NewProjs= new List <Project__c> ();
        for(client__c Clnt:trigger.new)
        {
            Project__c p=new project__c();
            p.Name=Clnt.Name+'Project';
            p.Start_date__c=date.today();
            p.Client_Type__c='Silver';
            p.Client__c= clnt.Id;
            NewProjs.add(p);
        }
        Insert NewProjs;
    }
 }
 
  • November 03, 2015
  • Like
  • 0
Hi Everyone,
i have folder that has zip files or image files and uploaded as a static resource and called it on the VF page as includescript value="
{!URLFOR($Resource.assets, 'assets/js/jquery-ui.custom.min.js')}"

".now how should i make it working, i mean how to invoke it.
  • November 01, 2015
  • Like
  • 0
Hi,
Scenario:if an object is moved into production and now there is large amount of data in it,later the requirement is changed that a field type has to be changed on that object in the sandbox,now how to deply and apply this changes in production because there is a large amount of data in the production and it does not need to be disturbed,wondering if there is any possibilityor any most possible approach that we can go for or any considerations,
your suggestions and idea will be highly appreciated.
  • November 01, 2015
  • Like
  • 0
Hi
I am trying to find out what are the User licences and the standard profiles that come up with them in EE or UE,for this i have tried all the possible ways to signup for a free trial for EE by going to the oficial site and also the links by google but every time after registering via the links a professional edition was being created,so can someone give me or screen shot the list of User licenses and their related standard Profiles that come along with the respective edition like EE or UE if anyone have access to any of those editions.
  • October 30, 2015
  • Like
  • 0
Hi ,

How to Enable or Disable a commandbutton based on selecting a picklist value,
I have requirement to enable/disable a command button based on a picklist value then i have an Outputpanel(a fieldset inside) that has to be displayed when the button is clicked..the button has to be enabled only twice.

I am breaking my head since the three days, sample code will be very highly appreciated.
I am posting the question here after a lot of Online references, but i hav not find any online reference or code that is close to my requirement.


Thanks in Advance
Ck  
  • January 07, 2016
  • Like
  • 0
Hi Everyone,
Is there any way out there to provide Notes and Attachment option in VF Page(Web form),so that when users try to submit requests for the case object using web form they can enter the notes and upload related attachment along with the field values,which helps the support people to process their request,
Currently what i have in mind is, creating a Description(Text Area) field and making it availablle for then web form.just wondering if there is any better solution than my idea. Please provide me any sample code if possible.

Thanks
Cvrk 
  • December 29, 2016
  • Like
  • 0
Hi Everyone,
I have a requirement to display different fieldsets after rerender based on its respective picklist value selection by user in the field called Request Type.
After clicking save(saverequest custom method to save records) one record in Case Object and one in Custom Obj (Functional_Request__c) should be created along with an attached document(document should go into document object),now my records are saving in objects but i am unable to provide upload and download  functionality to my webforms.

Note: The upload option shoud be enabled/available to users only for the 1st Select option and download option for the 3rd option out of 3 options and currently there are unused variable and methods in the cotroller, i left it in as they are,thought it gets easier for anyone of you to help me.
Sample Web form

I have tried the steps from below links but no luck,i wonder it is because i have custom save method to save records and may not be close to my use case.
http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller
http://blog.jeffdouglas.com/2010/04/28/uploading-an-attachment-using-visualforce-and-a-custom-controller/


Help will be highly appreciated.

 
VF Page code:



                         <apex:actionRegion >
                            <apex:selectList label="Request Type" value="{!RequestValue}" size="1" multiselect="false">
                                    <apex:actionSupport event="onchange"  reRender="fieldSet"/>
                                    <apex:actionstatus startText="Applying Values.............">                   
                                    </apex:actionstatus>
                                     <apex:selectOption itemLabel="Provide Access Request" itemValue="Provide_Access_Request"></apex:selectOption
                                     <apex:selectOption itemLabel="Other" itemValue="Other"></apex:selectOption>
                                     <apex:selectOption itemLabel="Package Request" itemValue="Package_Request"></apex:selectOption> 
                                     </apex:selectList>
                          </apex:actionRegion>

          <apex:commandButton action="{!saveRequest}" value="Submit" styleClass="js-save-button button green submitButton" />
          <apex:commandButton action="{!Cancel}" value="Cancel" styleClass="js-save-button button green submitButton" />





Controller:

Public without sharing class  Provisional_Request_ctrl extends WSitesController
{

 

    /*Public Variables*/
    
    Public Functional_Request__c FormExtn {get;set;}
    Public List<Functional_Request__c> licaseformextn;// {get;set;}
    Public Map<string,Functional_Request__c> caseformmap;// {get;set;}
    Public Case Ocase; //{get;set;} 
    Public List<RecordType> OcaseRecordType;// {get;set;}
    public String recordType {get;set;}
    public String requesttype {get;set;}
    public String additionalcomments;//{get;set;} 
    public List<RecordType> ProvisionalRecordtypes {get; set;}
    public List<SelectOption> orecordtypes {get; set;}
    Public string iscentraloginisuue{get;set;}
    
    Functional_Request__c str;
    Public Document doc {get;set;}
    public List<String> docIdList = new List<string>();
  
    public boolean addAttachment{get; set;}
    public string setpopdisplay{get;set;}
    public List<Document> selectedDocumentList {get;set;}
    
    
    /* Error Message related variables */
    public boolean pageError {get; set;}
    public boolean showlist{get; set;}
    public boolean RenderFunction{get; set;}
    public boolean RenderFieldSetBlock{get; set;}
    public String pageErrorMessage {get; set;}
    public string formname{get;set;}
    Public Map<string,Id> caseformextrecordtypeMap{get;set;}
    
    public boolean displayPopup{get; set;}
    Public string contactemailid{get;set;}
    public boolean fileUpload{get;set;}
    public string RequestValue{get; set;}
    
    Public Provisional_Request_ctrl(){
        
      //Create New Record in Functional Request Obj Object      
        FormExtn = new Functional_Request__c ();
        caseformmap =  new Map<string,Functional_Request__c> ();
        Ocase = new case();        
        doc = new Document();
        doc = null;
       // UploadedDocumentList = new List<AttachmentsWrapper>();
        showlist = false;
        RenderFieldSetBlock = false;
        requesttype = 'None';
        iscentraloginisuue = 'false';
        RenderFunction = true;
        getfields();
        displayPopup = true;
        contactemailid = '';
        addAttachment = false;
        setpopdisplay = ''; 
        
        }
   
   public pagereference Cancel()
    {
        pageReference pg=new PageReference('https://domain.visual.force.com/apex/FRS_Request');
        pg.setRedirect(True);
        return pg;
    }
   
   
   // Get record types for  request forms and display in 'Request type'.
    
    
    Public void getfields(){
     
        if(String.IsNotEmpty(apexpages.currentpage().getparameters().get('Param1'))){
           RenderFieldSetBlock=true; 
           RenderFunction = false;
           requesttype = apexpages.currentpage().getparameters().get('Param1');
           formname=requesttype;
           requesttype = EncodingUtil.urlDecode(requesttype, 'UTF-8');
           FormExtn.TDR_Request_Type__c = requesttype ;   
           DlccategorySelection = '';
           system.debug('12784563' + requesttype);
           if(requesttype != 'None'){
               requesttype=requesttype.replace(' ','_').replace('(' , '').replace(')' , '').replace(',' , '_').replace('-' , '_').replace('/' , '_').replace('.' , '');
           }
           
           if(requesttype.length() > 41){
               
             requesttype = requesttype.substring(0,40);
             system.debug('@@@@@@@@@@@@' + requesttype );
             if(requesttype.endsWith('_')){
              requesttype= requesttype.removeEnd('_');
                              
             }
         }
       
       }
       
      }  
        
        
   // saverequest method is to save the request.
   
    Public PageReference saveRequest(){
                 
    try{
         pageError = false;
         pageErrorMessage = '';
         
        // If there is no validation error save the request.
              
          if(pageError == false){  
            
              RecordType rectype = new RecordType();
         
             string recrdtname; 
            
            system.debug('##'+RequestValue);
			
             if( RequestValue=='Provide_Access_Request')//referring fieldsets
             {
                         FormExtn.RecordTypeId = System.Label.Provide_Access_Request; //custom labels which has record typeIds in its value field
             
             }
             else
             if( RequestValue=='Other')
             {
                        FormExtn.RecordTypeId = System.Label.Other; 
                        fileUpload = true;
             }
             else
             if( RequestValue=='Package_Request')
             {
                         FormExtn.RecordTypeId = System.Label.Package_Request; 
             
             }
             
             
            
             
        //Insert Case
           try{
              Ocase = new case();
              Ocase.Status    = 'New';
              Ocase.Subject =  System.Label.TDR_Case_Subject;
              Ocase.Origin = System.Label.TDR_Case_Origin;
              Ocase.Description = apexpages.currentpage().getparameters().get('description') ;  
              Ocase.Contactid   = loggedInContact.id;             
              Ocase.Gen_Request_Type__c = RequestValue;
              Ocase.RecordTypeid   = System.Label.Provisional_RecordTypeId;
             
           // Assigning Case using Case-Assignment Rule.
             
             Database.DMLOptions dmlOpts = new Database.DMLOptions();
             dmlOpts.assignmentRuleHeader.assignmentRuleId= Label.Case_Assignment_Rule_Id ;
             dmlOpts.EmailHeader.TriggerUserEmail = true;
             Ocase.setOptions(dmlOpts); 
            
             Database.insert(Ocase, dmlOpts);
             
             system.debug('=========Case=======' + Ocase);
           
           // Insert Functional Request Obj. 
             FormExtn.Case_Form_App__c = System.Label.Case_Form_App;
             FormExtn.TDR_Employee__c  = loggedInContact.id;
             FormExtn.GEN_Case__c= Ocase.Id;
            
             system.debug('=========Form Extension=======' + FormExtn);
            
             Insert FormExtn;
        
             return new PageReference('/apex/AutoResponse_Page url); 
             }catch(Exception e){
             return null;
             }
          }
       
                 else{
           return null;
          }
}
catch(Exception ex){
system.debug('------getMessage----'+ex.getMessage()+'--------getLineNumber--------'+ex.getLineNumber());
 return null;
         }
        
    }
         
    
}

Thanks
Cvrk

 
  • December 24, 2015
  • Like
  • 0
Hi 
1) Is it possible to update a child record when its associated master record is updated with a particular value on after update trigger?if possible which trigger context variable best suits the requirement?
For Example: when ever a field FA1 is updated with a X value in the master object then a field FB1 should be updated with X value on after update event.
2) similarly is it possible to delete child record when a master record is updated on after update event?
  • November 04, 2015
  • Like
  • 0
Hi Everyone,
i have below trigger with both before insert and after insert events,Client__c (Master Obj) and Project__c(Detail Obj) with master detail relationship.
My requirement is when a ever a new client record is going to be inserted Quotation__c field has to be updated with the value that provided in the trigger,and i have an after insert event in the same trigger

After trigger is working as expected but my before trigger throwing following error
Error for the trigger

Trigger :

trigger AutoProjects on Client__c (before insert,After insert){
    
    If(trigger.isbefore)
    {
         list <Client__c>NewClnts=New List<Client__c>();
         for(Client__c Clnt:trigger.New)
         {
            Client__c c=new Client__c();
            C.Name=   //Need a value that says "the record that is going to be created with any name not a particular name"
            c.Assigned_To__c='chhakri;chetan';
            NewClnts.add(C);
         }
       Insert NewClnts;  
    }
   
   if(Trigger.isafter){
    List <Project__c> NewProjs= new List <Project__c> ();
        for(client__c Clnt:trigger.new)
        {
            Project__c p=new project__c();
            p.Name=Clnt.Name+'Project';
            p.Start_date__c=date.today();
            p.Client_Type__c='Silver';
            p.Client__c= clnt.Id;
            NewProjs.add(p);
        }
        Insert NewProjs;
    }
 }
 
  • November 03, 2015
  • Like
  • 0
Hi Everyone,
i have folder that has zip files or image files and uploaded as a static resource and called it on the VF page as includescript value="
{!URLFOR($Resource.assets, 'assets/js/jquery-ui.custom.min.js')}"

".now how should i make it working, i mean how to invoke it.
  • November 01, 2015
  • Like
  • 0
Hi
I am trying to find out what are the User licences and the standard profiles that come up with them in EE or UE,for this i have tried all the possible ways to signup for a free trial for EE by going to the oficial site and also the links by google but every time after registering via the links a professional edition was being created,so can someone give me or screen shot the list of User licenses and their related standard Profiles that come along with the respective edition like EE or UE if anyone have access to any of those editions.
  • October 30, 2015
  • Like
  • 0
 I read that trigger.new does not work for after insert/update triggers but i have seen in many examples where trigger.new is used in after triggers,so wondering if trigger.new works or not for after events in any situation.

below example trigger for the reference that used trigger.new for After Insert event .

trigger AutoOpp on Account(after insert) {
  List<Opportunity> newOpps = new List<Opportunity>();
  for (Account acc : Trigger.new) {
    Opportunity opp = new Opportunity();
    opp.Name        = acc.Name + ' Opportunity';
    opp.StageName   = 'Prospecting';
    opp.CloseDate   = Date.today() + 90;
    opp.AccountId   = acc.Id; // Use the trigger record's ID
    newOpps.add(opp);
  }
  insert newOpps;
}
  • October 29, 2015
  • Like
  • 0
Hi ,
1) Iam New to development,now trying to create a detail record as a result based on after record inserted on its master object,but i am failing to do so
Client__c is master object and project__c is Child Object,

Trigger code:

trigger AutoProjects on Client__c (After insert) {
    List <Project__c> NewProjs= new List <Project__c> ();
        for(client__c Clnt:trigger.new){
            Project__c p=new project__c();
            p.Name=Clnt.Name+'Project';
            p.Start_date__c=date.today();
            p.Client_Type__c='Silver';
            p.Project.Id=Clnt.Id;
            NewProjs.add(p);
        }
        Insert NewProjs;
    }

2) I read that trigger.new does not work for after insert/update triggers but i have seen in many examples where trigger.new is used in after triggers,so wondering if trigger.new works or not for after events in any situation.

below example trigger for the reference that used trigger.new for After Insert event .

trigger AutoOpp on Account(after insert) {
  List<Opportunity> newOpps = new List<Opportunity>();
  for (Account acc : Trigger.new) {
    Opportunity opp = new Opportunity();
    opp.Name        = acc.Name + ' Opportunity';
    opp.StageName   = 'Prospecting';
    opp.CloseDate   = Date.today() + 90;
    opp.AccountId   = acc.Id; // Use the trigger record's ID
    newOpps.add(opp);
  }
  insert newOpps;
}

 
  • October 29, 2015
  • Like
  • 0
Hi,
usually when master record is deleted detail(child) record will be deleted,but wondering,what happens to the detail record when either of the primary or secondary master record is deleted?,will child record be deleted or not?
  • August 24, 2015
  • Like
  • 0
Hi,
Dashboard is agraphical representation by using various components but ,once I get asked in how many ways a dashboard can be displayed,      but i wonder are there any ways to display a dashboard or the question suppose to be in which parts of the sfdc we can use dashboards.?
  • August 24, 2015
  • Like
  • 0
Hi,
Usually in realtime,In How many ways leads can be converted to Acounts,contacts and Opportunities(Optional)?

Thanks
 
  • August 09, 2015
  • Like
  • 0
Hi,
i have been reading about action tags,it make sense to me that,in few ways both Actionsup and actionfunc works similarly,so far have not found any example other than Onclickevent on actionsup and popup message when used action function.

Can someone provide me with few example situations where we can use only ActionFuc but not Actionsup and similarly only ActionSup works but not ActionFunc




 
  • August 06, 2015
  • Like
  • 0
hi,

I have created a custom button and a vf page to edit a record that is locked due to approval process. I wrote a trigger for auto approval process using after update and after insert events.The problem arises when i use after update in trigger.when i make some changes in the vf page and try saving it, it throws this error,
Visualforce ErrorHelp for this Page
System.DmlException: Update failed. First exception on row 0 with id 0069000000bgC3WAAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Approvalprocess1: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: ALREADY_IN_PROCESS, Cannot submit object already in process.: [] Trigger.Approvalprocess1: line 12, column 1: []
Error is in expression '{!saveAs}' in component <apex:commandButton> in page edit_opportunity: Class.EditOpportunity.saveAs: line 38, column 1
Class.EditOpportunity.saveAs: line 38, column 1

This error does not occur when i use only after insert event. can anyone please help me ..