-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
38Questions
-
18Replies
Need help to buld the Workflow rule
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
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
-
- CvrK
- March 08, 2016
- Like
- 0
- Continue reading or reply
How to Enable/Disable a commandbutton and display an outputPanel based on selecting a picklist value?
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
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
-
- CvrK
- January 07, 2016
- Like
- 0
- Continue reading or reply
How to display a fieldset based onclick of commandbutton?
Hi,
How to display a fieldset in outputpanel after render/rerender based on commanbutton's onclick event.
Thanks
Cvrk
How to display a fieldset in outputpanel after render/rerender based on commanbutton's onclick event.
Thanks
Cvrk
-
- CvrK
- January 05, 2016
- Like
- 0
- Continue reading or reply
How to call a picklist field based on the selected value of another picklist field?
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
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
-
- CvrK
- January 04, 2016
- Like
- 0
- Continue reading or reply
Is it possible to provide Notes and Attachments option in VF Page(Web form)?
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
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
-
- CvrK
- December 29, 2016
- Like
- 0
- Continue reading or reply
How to add upload document functionality on a VF page(webform) ?
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.

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.
Thanks
Cvrk
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.
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
-
- CvrK
- December 24, 2015
- Like
- 0
- Continue reading or reply
How to write an after update trigger on account to update its related opportunities?
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;
}
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;
}
-
- CvrK
- November 20, 2015
- Like
- 0
- Continue reading or reply
How does static boolean variable helps in avoiding recursive triggers?
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.
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.
-
- CvrK
- November 09, 2015
- Like
- 0
- Continue reading or reply
Is bulkyfying the trigger means,just defining the DML operation outside the loop or need any specific work around ?
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?
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?
-
- CvrK
- November 09, 2015
- Like
- 0
- Continue reading or reply
Is it possible to use perform DML operation using trigger.Newmap or trigger.old map without trigger.new or trigger.old in the same trigger code?
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
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
-
- CvrK
- November 09, 2015
- Like
- 0
- Continue reading or reply
-
- CvrK
- November 05, 2015
- Like
- 0
- Continue reading or reply
Best practices of apex conteollers and bach apex considerations not jist triggers?
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?
-
- CvrK
- November 05, 2015
- Like
- 0
- Continue reading or reply
Perfect use cases to use trigger.newmap and trigger.oldmaps instead of trigger.new and trigger.old
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
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
-
- CvrK
- November 04, 2015
- Like
- 0
- Continue reading or reply
Is it possible to perform dml operation in after triggers?
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?
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?
-
- CvrK
- November 04, 2015
- Like
- 0
- Continue reading or reply
What are the approximate dates or months of salesforce releases?
Hi Everyone,
can someone provide me any references or list out What are the approximate dates or months of salesforce releases?
can someone provide me any references or list out What are the approximate dates or months of salesforce releases?
-
- CvrK
- November 03, 2015
- Like
- 0
- Continue reading or reply
On what event does trigger.Oldmap is available?
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
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
-
- CvrK
- November 03, 2015
- Like
- 0
- Continue reading or reply
Need help,before trigger not working
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

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;
}
}
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
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;
}
}
-
- CvrK
- November 03, 2015
- Like
- 0
- Continue reading or reply
How to invoke a static resource that contains zip files in the folder after referencing it on the VF page?
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.
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.
-
- CvrK
- November 01, 2015
- Like
- 0
- Continue reading or reply
How to fix the deployment problem using packages into production?
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.
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.
-
- CvrK
- November 01, 2015
- Like
- 0
- Continue reading or reply
Unable to sign up for EE free trial version
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.
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.
-
- CvrK
- October 30, 2015
- Like
- 0
- Continue reading or reply
How to Enable/Disable a commandbutton and display an outputPanel based on selecting a picklist value?
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
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
- CvrK
- January 07, 2016
- Like
- 0
- Continue reading or reply
Is it possible to provide Notes and Attachments option in VF Page(Web form)?
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
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
- CvrK
- December 29, 2016
- Like
- 0
- Continue reading or reply
How to add upload document functionality on a VF page(webform) ?
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.

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.
Thanks
Cvrk
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.
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
- CvrK
- December 24, 2015
- Like
- 0
- Continue reading or reply
Is it possible to perform dml operation in after triggers?
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?
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?
- CvrK
- November 04, 2015
- Like
- 0
- Continue reading or reply
Need help,before trigger not working
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

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;
}
}
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
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;
}
}
- CvrK
- November 03, 2015
- Like
- 0
- Continue reading or reply
How to invoke a static resource that contains zip files in the folder after referencing it on the VF page?
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.
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.
- CvrK
- November 01, 2015
- Like
- 0
- Continue reading or reply
Unable to sign up for EE free trial version
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.
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.
- CvrK
- October 30, 2015
- Like
- 0
- Continue reading or reply
Does Trigger.New works for After triggersin any way ?
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;
}
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;
}
- CvrK
- October 29, 2015
- Like
- 0
- Continue reading or reply
Need help with the simple trigger?
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;
}
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;
}
- CvrK
- October 29, 2015
- Like
- 0
- Continue reading or reply
what happens to the detail record when either of the primary or secondary master record is deleted?
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?
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?
- CvrK
- August 24, 2015
- Like
- 0
- Continue reading or reply
In how many ways we can display Dashboard?
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.?
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.?
- CvrK
- August 24, 2015
- Like
- 0
- Continue reading or reply
Usually in realtime,In How many ways leads can be converted to Acounts,contacts and Opportunities9Optional)?
Hi,
Usually in realtime,In How many ways leads can be converted to Acounts,contacts and Opportunities(Optional)?
Thanks
Usually in realtime,In How many ways leads can be converted to Acounts,contacts and Opportunities(Optional)?
Thanks
- CvrK
- August 09, 2015
- Like
- 0
- Continue reading or reply
ActionSupport and ActionFunction, which one to use when?
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
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
- CvrK
- August 06, 2015
- Like
- 0
- Continue reading or reply
Auto approval process record unlock
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 ..
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 ..
- cool 183
- August 06, 2015
- Like
- 0
- Continue reading or reply