• Abhilash Mishra 13
  • NEWBIE
  • 373 Points
  • Member since 2015
  • Salesforce developer


  • Chatter
    Feed
  • 3
    Best Answers
  • 5
    Likes Received
  • 3
    Likes Given
  • 72
    Questions
  • 166
    Replies
public with sharing class contollertest {

    Public id Current_le_Id;
    public Boolean isEdit { set; get;}
    public List<Question__c> lstQuestion {set;get;}
    public contollertest (ApexPages.StandardController controller) {
        Current_le_Id = controller.getRecord().id;
        isEdit = false;
        lstQuestion = New List<Question__c>();
        for(Lead le:[select id,name,(select id,Name,Email__c from Questions__r) from lead where id=:Current_le_Id]){
           for(Question__c con:le.Question__c)
               lstQuestion.add(con);
        }
    }
    public void editProcess(){
        isEdit = true;
    }
    public  void save(){
        
        if(lstQuestion.size() > 0){
            upsert lstQuestion;
            lstQuestion.clear();
        }
        
        for(Lead le:[select id,name,(select id,Name,Email__c from Questions__r) from lead where id=:Current_le_Id]){
           for(Question__c con:le.Question__c)
               lstQuestion.add(con);
        }
        isEdit = false;
    }
    public void addQuestion(){
        lstQuestion.add(new Question(leadId = Current_le_Id));
        isEdit = true;
    }
}
<!--Page-->
<apex:page standardController="Account" extensions="contrllr">
  <apex:form >
    <apex:pageblock id="pgb">
    <apex:pageBlockButtons >
        <apex:commandButton value="edit" action="{!editProcess}" rendered="{!Not(isEdit)}" reRender="pgb"/>
        <apex:commandButton value="save" action="{!save}" rendered="{!isEdit}" reRender="pgb"/>        
        </apex:pageBlockButtons>
       <apex:pageBlockTable value="{!lstQuestion}" var="val" rendered="{!Not(isEdit)}">
         <apex:column value="{!val.Name}"/>
         <apex:column value="{!val.Email__c}"/>
       </apex:pageBlockTable> 
       <apex:outputPanel rendered="{!Not(isEdit)}">
           <apex:commandButton action="{!addQuestion}" value="Add Contact" reRender="pgb"/>
       </apex:outputPanel>
        <apex:pageBlockTable value="{!lstQuestion}" var="val" rendered="{!(isEdit)}">
         <apex:column headerValue="FirstName">
             <apex:inputField value="{!val.Name}"/>
         </apex:column>
          <apex:column headerValue="Email">
             <apex:inputField value="{!val.Email__c}"/>
         </apex:column>
         <apex:column >
             <apex:inputField value="{!val.Email__c}"/>
         </apex:column>
       </apex:pageBlockTable> 
    </apex:pageblock>
  </apex:form>
</apex:page>
here is the code i wrote




when i check the challenge ...i am getting this error

The page does not have a bound '{!save}' action for saving the contact record  






User-added image
In standard salesforce layout, if you click on send email and save, it creates a EmailMessage record in the DB and also sends the email.

If we create EmailMessage record using apex code, will the email will be sent to email mentioned in toAddress field?

I want to share a common list between two pages.

 

Scenario. : My first visualforce pages is saving some records and a proper list  of results is  being maintained. (i.e. i am adding the success and error messages to a list) .  Now where i redirect to the other page. I have use the data saved in this list. how can i be able to share list in between two pages.

 

Hello, I need to create a country state dependent picklist in my visualforce page.
I want to Default State and Country/Territory Picklists. I am able to get values of both country and state as suggested here.
But they Are not dependent Enough.
How to make them Dependent.? or should i my own object.
 
We want to to host a site from Our Enterprise Edition, Which will allow users to resister Themselve.
In DE this was possible  using Customer portal, but there is no customer Portal In my Enterprise Edition.
How can I achieve this in DE.

Regards
Abhilash Mishra 
Is there a way to deploy cusrtomizations to other org using a DE.  I had a package installed on several different org and now I need to deploy different changes to the different org. 
Is this possible.??

Regards
Abhilash Mishra
Hi, 
I am Using php tooklit for intergration.
Is there any way I can replace , delete or add new picklist value to an Existing Picklist value.

This is very important for me. 
Regards
Abhilash Mishra
Hello,
I need to use URL rewriting for My site.

How ever the rewriter class only rewrites whats written using   $page or URLFOR() methods.
Like : 
<apex:outputlink value="{!URLFOR($page.pagename,null,[pageid='asdvsv'])}"> This is rewritabale link</apex:outputlink>

this also works fine:
 
<a href="{!URLFOR($page.pagename,null,[pageid='asdvsv'])}"> This is rewritabale link</a>

how ever when it comes to use a simple string to specify URL. It failes poorly.
 
<a href="/pagename?pageid=sdsfv"> This fails in rewriting</a>

the above links are generated as a part of javascript output.

Is there any way or work around to make them rewritable too.

Please Help.
Hi, I want to create site in salesforce.  in which user registration is provided by using customer portal.

Which licence and Profile should i use so that...

1. No restriction on user Registration (thousands of users can be created)

2. Must have create and read access on Account contact order and contracts

Need help
Regards
Abhilash Mishra 

Hi,
Is possible to distribute accounts over users like in queues.

is there any way?

Regards
Abhilash Mishra

Hi,
using same Dynamic component Twice or more?
can this be achieved and how?

I have this component and I am trying to user this more than one's.

It does not give any error, but however only the last one renders.

Here is the page:
 
<apex:page controller="mycustomcontroller">

<apex:dynamicComponent componentValue="{!footerDetails}"/>
</apex:page>

here is the controlller
 
public with sharing class mycustomcontroller {

 public list<string> getfooterlinks(){
         return new list<string>{'user','Leads',' Account' ,'contact'};
      }


 public Component.Apex.datalist getfooterDetails(){
      		Component.Apex.datalist dt= new Component.Apex.datalist();
      		dt.expressions.value='{!footerlinks}';
      		dt.styleclass='footer-link-list';
      		dt.var='s';
      		
      		Component.Apex.outputlink otl=new Component.Apex.outputlink();
      		otl.value='#';
      		Component.Apex.outputText ot= new Component.Apex.outputText();
      		ot.expressions.value='{!s}';
      		otl.childComponents.add(ot);
      		dt.childComponents.add(otl);

      		
         return dt;
      }

}


Need Help?

Regards
Abhilash MIshra
Hi I want to get all the fields data as and instace to inner class. is it possible?

I have written this code here

VF page
<apex:page controller="mycontroller">
   <apex:form>
      <apex:pageblock>
        <apex:pageblocksection>
           <apex:pageblocksectionitem>
                <apex:outputlabel for="fname"> First Name</apex:outputlabel>       
                <apex:inputtext value="{!info.firstname}" id="fname"/>
         </apex:pageblocksectionitem>
          <apex:pageblocksectionitem>
                <apex:outputlabel for="lname">Last Name</apex:outputlabel>
               <apex:inputftext value="{!info.lastname}" id="lname"/>
        <apex:pageblocksectionitem>
     </apex:pageblocksection>
     <apex:commandbutton action="{!savedata}" value="submit"/>   
</apex:pageblock>
   
</apex:form>
</apex:page>

Here is the controller :
public with sharing class mycontoller{

public info {
   get{
      if(info==null)
      return new information();
   return info;  
}
set;
}
 

 public information {
    public firstname {get;set;}
   public lastname {get;set;}

   }

}

above code doesnt seems to be working.

Can someone point out the issue?  need Help
Regards
Abhilash Mishra

Hi I am experiencing issues using phptoolkit 20.0 with with SOAP API version 36.0.
It seems that I am not getting any custom fields values on query.
also there is an issue with managed packaged fields too.

can any one tell why I am experiencing this issue?
are there any higher version available  than 20.0 for recent API

Regards
Abhilash Mishra
 

Hi,
I am using phptool kit. I am trying to get orderid and order number by SOAP call but  call only return orderID I dont know what is the issue. Here is the code.
 
<?php
			define("USERNAME", "abhilash@dev.org");
			define("PASSWORD", "dCEm96uPgRHJ");
			define("SECURITY_TOKEN", "AdTdD3hPtVYr1RNbt6re4OnqO");
			require_once ("Force.com-Toolkit-for-PHP-master/soapclient/SforceEnterpriseClient.php");
			$mySforceConnection = new SforceEnterpriseClient();
			$mySforceConnection->createConnection("Force.com-Toolkit-for-PHP-master/soapclient/enterprise27.wsdl");
		
			
			$response=$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
			echo "<pre>";
			print_r($mySforceConnection->query("select id,ordernumber from order"));
			echo "</pre>";
				
									
?>

This is what comes out as out put
https://qas-shared-assets.s3.amazonaws.com/snaps/4uz5infz2gldi

Here is the WSDL
https://raw.githubusercontent.com/developerforce/Force.com-Toolkit-for-PHP/master/soapclient/enterprise.wsdl.xml



 
Hello,

I am working with javascript. I need to select A field. My javascript is out side the blocks. so With $component  id have to usw hierarchical id (or Dom tree id). structure like {!component.mypage.mypageblock.myfield}. 
I Can't use something {!component.mypage.mypageblock.myfield} as only id fixed is myfield.
 what is the alternative how can i select field directly?
Hi I have schedule a job to send email on a daily basis how ever Its noy working and giving following error

Scheduler: failed to execute scheduled job: jobId: 7075800000IN0MU, class: common.apex.async.AsyncApexJobObject, reason: Not Serializable: com/salesforce/api/fast/List$$lcom/salesforce/api/Messaging/SingleEmailMessage$$r

what could be be the possible reason. what is the meaning of serializable?

Need help !!!
Abhilash Mishra
 

Hello ,
I have an object. which has a status field. I want to create a History log for this field. How van I achieve this. I have tried by copying the schema or orderHistory Table. All done pretty well. but I can not omite that Edit delete options on related list. 
User-added image


Any Idea how to do it in a better way ???

Thanks
Abhilash Mishra

How can I do this, I am using Apex cron, and if condition is true, it sends an email, I have to log this in account 

Need help 
Thanks
Abhilash Mishra
I have need to calculate order age. how can I write a formulate in formula field.
(My order age will start with the order start date. and end on Either current date or order End Date)

Need Help 
Abhilash Mishra

Hi,
I have 10000+ records on my mysql database. Using php tool kit I am trying to  insert them in salesforce,
How ever while doing so I am getting api Limit Exceed error. How can I optimise it, I am not using any batch job.  just simple create function

I have trying to upsert data by using API in salesforce. and while upserting I get and " duplicate ID Exception". when passing the array.
how can fix this. i know my  array has records with same external id(duplicate). But thats why I am upserting them. how can I over come this limitation. it happens with apex to. here is for sample.

list<account> li= new list<account>();
for(integer i =0;i<50;i++){
    account acc= new account();
    acc.name='' tech corp"; 
    acc.company_email__C='example@teccorp.com'; /*this field is an external id */
    acc.updated_count__C=i;
    li.add(acc);
}
upsert li company_email__C;
This also gives the same Error.

Thanks 
Abhilash Mishra

 

Hi I have schedule a job to send email on a daily basis how ever Its noy working and giving following error

Scheduler: failed to execute scheduled job: jobId: 7075800000IN0MU, class: common.apex.async.AsyncApexJobObject, reason: Not Serializable: com/salesforce/api/fast/List$$lcom/salesforce/api/Messaging/SingleEmailMessage$$r

what could be be the possible reason. what is the meaning of serializable?

Need help !!!
Abhilash Mishra
 
Hi, 
can i get all the values of a picklist field in a list some how?

I have picklist type custom field in the product. having some options.
In my apex class i want to use these options. can I get them some how throught code? 
Hi 
can I change my site domain http:/test-developer-edition.ap2.force.com/  to something like www.devtest.force.com or Any easy name.
Thanks 
Abhilash Mishra 
Hi I am using angular js and remoteaction to modify the data on the page My code is
<---------visualforce page------>
<apex:page controller="testangular">
	<apex:includescript value="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"/>
	<apex:stylesheet value="{!URLFOR($Resource.EshopResource,'EShopResource/EshopProduct.css')}"/>
	<apex:stylesheet value="{!URLFOR($Resource.EshopResource,'EShopResource/fonts.css')}"/>
	<style>
		.v-align{
			vertical-align: middle !important;
			}
	</style>

	<div ng-app="myApp" ng-controller="customersCtrl"> 
				
						{{names}}
						<button ng-click="letsset()">Try me</button>
					</div>
				
	

	<script>
		function myfunc(){
			
		}
		var a;
		var app = angular.module('myApp', []);
		app.controller('customersCtrl', function($scope,$window) {
                      $scope.names='Firstname';
		     $scope.letsset=function(){
			testangular.actfast($scope.names,function(result,event){
				 		if (event.status){
				 			
				 			$scope.names=result;
				 			
				 			}
						});
		
			}
		
		});

	</script>
</apex:page>



<!---controller--->

public with sharing class testangular {
     @remoteaction
	 public static string  actfast(string s){
	  return s=='Firstname'?'LastName':'Firstname';
	 
 	

}
code works fine but the view changes abnormaly. some times lastname appear as soon as try me is clicked some time i need to double click

Please help
 
Hello,

I'm having trouble accessing certain sections on a page layout. (For example, when trying to create an Account, I am unable to see the bottom section that I just added to the Account page layout.) What kinds of permissions may I look at to determine where I need to perhaps add my sandbox admin user account?

Any help would be greatly appreciated.

Sincerely,
Jackie
Apex Triggers : If an object has multiple (assume two) before triggers and if first picked trigger inserts a record, is second trigger invoked twice? First time from the initial insert and second time due to an insert operation from first trigger. (I understand order is not guaranteed. but, jsut thinking what would happen if it is picked this way)
  • June 21, 2018
  • Like
  • 0
how to remove Standard button from related list in salesforce and assign to particular profiles (or)Specific users.

I know how to remove : Standard button from related list but i need to know assign to particular profiles (or)Specific users.
 


Thanks
KMK
  • June 21, 2018
  • Like
  • 0
hi,
i created one report and gave that report access to community users those have customer community plus  license only but they are able to see other account's records also means i have two accounts,one account has 5 users and another account has another 3 users.out of the 5 users of 1st account,two users have report access and remaining are using customer community license only.but here is a problem,i can not restrict the records which don't belong to that account,the two users can see other account records also.they are using one common object(Order__c) only how can i solve this....? 
anyone help me please.....
Hi there

I am setting up a custom button and keep receiving an error - Invalid Page Redirection
The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance.


There are 4 other buttons set up on the same object, which are exactly the same - excluding the record type ID and they work perfectly. What could the issue be?

Thanks in advance!
I have installed this package but not sure how to make the button appear in page layout: https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016YuDEAU

The package allows you to add a check box column to different pages so you can delete multiple line iteams at once.

Thanks in advance
Hi,

Please find the below information and let me know any one have idea, how to resolve this issue.

38:37.0 (104303915)|CALLOUT_REQUEST|[938]|System.HttpRequest[Endpoint=callout:CustomerServiceEndPoint, Method=POST]
22:38:37.0 (276864235)|CALLOUT_REQUEST|[938]|System.HttpRequest retrying request in response to handshake failure: Server chose TLSv1, but that protocol version is not enabled or not supported by the client.
EXCEPTION_THROWN|[938]|System.CalloutException: Server chose TLSv1, but that protocol version is not enabled or not supported by the client...

Thanks in advance
Vasu
I have a vf section in my record detail page which displays the attachments under the object.How can i make a command button in such a way that when clicked on it it redirects to new record Attachment creation page for the current object?
Hello All,
            i am new to salesforce. i am not getting how to start with map and how to deal wirh map, wheen should use map and how to use map in apex. so please guide about map .
Hi Team,

I am not a developer so may need some hand holding. I have a requirement to Hide the Notes and Attachement buttons on Objects for Contacts, Accounts and Opps. The buttons should only be visible on the Leads object. From what I have read this is not configurable and requires Apex Code.

I have created an Apex page with the following code but obviously did not work. What stesp do I take and where do I put the code?

Here is the code i used (I found this on a forum )
<apex:page standardController="Account"> <apex:relatedList list="NotesAndAttachments"> <apex:facet name="header">&nbsp;</apex:facet> <!--This line of code removing the attachment header--> </apex:relatedList> </apex:page>
Thanks, A
Hi 

I have a field config_Name__c which is a hyper link formula field.
so i want this in the vf page so that it should appear in the output page and when ever user click that name it should display the user records.

Thanks
I saw the review fee for the paid app is 27500 $ and for Free apps no fee, but our app is free but generating some revenue. For example: screen magic, docu sign  those are  free apps at app exchange, but they are generating some revenue on top of it in this case what is the fee?

If I become ISV partner what is the major benifit we will get?
 
Hello Everyone,

I should like to convert my Custom Controller to a Standard Controller with an extention so that I can refer my Visualforce Page to a related list button.Please help me out Thank you very much. My code is down below.

VF Page:
 
<apex:page controller="ManageListController" tabstyle="Employee_Skills__c">
 <apex:form id="emp_form">
   <apex:pageBlock title="Create Employee Skill">
      <apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">
        
         <apex:column headerValue="Ident">
            <apex:outputText value="{!wrapper.ident}"/>
         </apex:column>
         <apex:column headerValue="Name">
            <apex:inputField value="{!wrapper.empski.Skill_ID__c}"/> 
            <apex:actionSupport event="onchange" rerender="pageBlock" status="channelStatus"/>
         </apex:column>
          <apex:column headerValue="Proficiency">
            <apex:inputField value="{!wrapper.empski.Proficiency__c}"/> 
         </apex:column>
         <apex:column headerValue="Skill Type">
            <apex:inputField value="{!wrapper.empski.Skill_Type__c}"/> 
         </apex:column>
         <apex:column headerValue="Years of Experience">
            <apex:inputField value="{!wrapper.empski.Year_of_Experience__c}"/>
         </apex:column>
       
         <apex:column headerValue="Action">
            <apex:commandButton value="Delete" style="Button" action="{!delWrapper}" reRender="wtable" immediate="true">
               <apex:param name="toDelIdent" value="{!wrapper.ident}" assignTo="{!toDelIdent}"/> 
            </apex:commandButton>
         </apex:column>
         
      </apex:pageBlockTable>
      
       <apex:commandButton value="Add Row" style="Button" action="{!addRows}" reRender="wtable" immediate="true" >
         <apex:param name="addCount" value="1" assignTo="{!addCount}"/> 
      </apex:commandButton>
      <apex:commandButton value="Save" action="{!save}"/>
      
   </apex:pageBlock>
 </apex:form>
</apex:page>


My Custom Controller(That I would like to convert to a extension):

public class ManageListController {
 
     public List<EmpSkillWrapper> wrappers {get; set;}
     public static Integer toDelIdent {get; set;}
     public static Integer addCount {get; set;}
     private Integer nextIdent=0;
     
      public PageReference pageRef;
      public Employee_Skills__c getEmp;
     public Employee_Skills__c empi {set; get;}
     
     
     public ManageListController(ApexPages.StandardController controller) {
            
             this.getEmp = (Employee_Skills__c) controller.getRecord();
             this.empi = new Employee_Skills__c();
             wrappers = new List<EmpSkillWrapper>();
    }
     
     
     public ManageListController()
     {
          wrappers=new List<EmpSkillWrapper>();
          for (Integer idx=0; idx<1; idx++)
          {
           wrappers.add(new EmpSkillWrapper(nextIdent++));
          }
     }
      
   
     public class EmpSkillWrapper{
          public Employee_Skills__c empski {get;set;}
          public Integer ident {get;set;}
           
          public EmpSkillWrapper(Integer inIdent){
               ident=inIdent;
              empski=new Employee_Skills__c();
          }
     }
    
    public PageReference save(){
          
          List<Employee_Skills__c> eskills=new List<Employee_Skills__c>();
          for (EmpSkillWrapper wrap : wrappers){
               eskills.add(wrap.empski);
          }
           
          insert eskills;
           
          return new PageReference('/' + Schema.getGlobalDescribe().get('Employee_Skills__c').getDescribe().getKeyPrefix() + '/o');
          return null;
        // return new PageReference('/' + empski.Employee_ID__c);
         // return null;
    
     }
    
    public void addRows(){
          
          for (Integer idx=0; idx<addCount; idx++){
           wrappers.add(new EmpSkillWrapper(nextIdent++));
          }
         
     }
    
      public void delWrapper(){
          
          Integer toDelPos=-1;
          for (Integer idx=0; idx<wrappers.size(); idx++){
               if (wrappers[idx].ident==toDelIdent){
                    toDelPos=idx;
               }
          }
       
            if (-1!=toDelPos)
              {
                  if(wrappers.size() !=1){
                       wrappers.remove(toDelPos);
                       
                       }
              }
     }
      
      

     
}

Thank you in advance.
Hi all! 
I am creating a custom field that will be auto filled based on a formula from another fields pick list value.  I seem to be having issues with my formula and would love to get some help if possible. 

New field name is Est. Downloads Per Episode  wihich will be give he number or a blank value depening ont he pick list value. 

If Flight_Type_Basis__c  is "Episode" or "Episode Maual"  the new field will fill in the number from the field Avg_Downloads_per_Episode__c
but if the pick list value from Flight_Type_Basis__c is "Impression" or "Impression Manual"  the result for the field will be Blank. 

Any help would be greatly appreciated... I have been working on this most of the day. 
Hi, 
can i get all the values of a picklist field in a list some how?

I have picklist type custom field in the product. having some options.
In my apex class i want to use these options. can I get them some how throught code? 
how to refer to current page id
public with sharing class contollertest {

    Public id Current_le_Id;
    public Boolean isEdit { set; get;}
    public List<Question__c> lstQuestion {set;get;}
    public contollertest (ApexPages.StandardController controller) {
        Current_le_Id = controller.getRecord().id;
        isEdit = false;
        lstQuestion = New List<Question__c>();
        for(Lead le:[select id,name,(select id,Name,Email__c from Questions__r) from lead where id=:Current_le_Id]){
           for(Question__c con:le.Question__c)
               lstQuestion.add(con);
        }
    }
    public void editProcess(){
        isEdit = true;
    }
    public  void save(){
        
        if(lstQuestion.size() > 0){
            upsert lstQuestion;
            lstQuestion.clear();
        }
        
        for(Lead le:[select id,name,(select id,Name,Email__c from Questions__r) from lead where id=:Current_le_Id]){
           for(Question__c con:le.Question__c)
               lstQuestion.add(con);
        }
        isEdit = false;
    }
    public void addQuestion(){
        lstQuestion.add(new Question(leadId = Current_le_Id));
        isEdit = true;
    }
}
<!--Page-->
<apex:page standardController="Account" extensions="contrllr">
  <apex:form >
    <apex:pageblock id="pgb">
    <apex:pageBlockButtons >
        <apex:commandButton value="edit" action="{!editProcess}" rendered="{!Not(isEdit)}" reRender="pgb"/>
        <apex:commandButton value="save" action="{!save}" rendered="{!isEdit}" reRender="pgb"/>        
        </apex:pageBlockButtons>
       <apex:pageBlockTable value="{!lstQuestion}" var="val" rendered="{!Not(isEdit)}">
         <apex:column value="{!val.Name}"/>
         <apex:column value="{!val.Email__c}"/>
       </apex:pageBlockTable> 
       <apex:outputPanel rendered="{!Not(isEdit)}">
           <apex:commandButton action="{!addQuestion}" value="Add Contact" reRender="pgb"/>
       </apex:outputPanel>
        <apex:pageBlockTable value="{!lstQuestion}" var="val" rendered="{!(isEdit)}">
         <apex:column headerValue="FirstName">
             <apex:inputField value="{!val.Name}"/>
         </apex:column>
          <apex:column headerValue="Email">
             <apex:inputField value="{!val.Email__c}"/>
         </apex:column>
         <apex:column >
             <apex:inputField value="{!val.Email__c}"/>
         </apex:column>
       </apex:pageBlockTable> 
    </apex:pageblock>
  </apex:form>
</apex:page>
What would be best approach to integrate with extenal system(Legacy)?  For an example,  Contact information should be in sync with both salesforce and our external system. Whenever "Contact Record" is created/updated/deleted in salesforce, it should be sent to external system and vice versa?