• AnupPrakash_Algoworks
  • NEWBIE
  • 179 Points
  • Member since 2015

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 27
    Replies
Hello everyone,
 can any one explain how to play with bellow map , how its usful in developement . can you provide proper example with below map.

Map<String,Map<String,List<String>>> mapOfMaps = new Map<String,Map<String,List<String>>>();

Thanks to all  advance :)
I am having a issue in Trigger. Its unable to fire..

trigger CreateWithJIRAIssue on Case (after insert) {
List<Case> escCases = new List<Case>();
  

   for (Case c : Trigger.new){

    // all the cases that have status as abc' is added to a list called xCases
    if(c.Status == 'abc'){
     xCases.add(c);
    }
   }
   if(xCases != null && xCases.size()>0){
    // now iterate over the selected cases and call the web service
    for(Case c : xCases){
     //call webservice
     system.debug('inside case ' + c.CaseNumber);
     //Define parameters to be used in calling Apex Class
     String jiraURL = 'http://jira';
     String systemId = '2';
     String objectType ='Case';
     String objectId = c.id;
     String projectKey = 'LEV';
     String issueType = 'BUG';
     System.debug('\n\n status is escalated');
     //Execute the web service call
     
     JIRAConnectorWebserviceCallout.CreateIssue(jiraURL, systemId ,objectType,objectId,projectKey,issueType);
    }
   }
  }
}
}
How to integrate facebook and salesforce app using SOAP approach. Please guide me step by step procedure
Hi,
I have a link custom object called "Registrations" which links a Contact with a Course (another custom object) on a many-to-many relationship.
So Registration is the child object for Contact, and Course is the lookup object when creating a new Registration.

I want to send Emails to Contact showing which Course they are booked into (not a problem, as I can specify the Course on the "Related to Record:" look-up. But I need to specify the Registration instead, so that I can display merge fields from the Registration object on the Email.
There is no problem inserting Registration fields on the Email or the Template (the field chooser includes all the fields from Registration) but what I not allowed to do is to choose a specific Registration record - so when the email is sent (or tested) all the fields from Registration are blank.
 
User-added image

Any ideas greately appreciated.
Luison
Hello,

I am system admin, how do it not allow other sstem admins to not login in to my account
  • December 02, 2015
  • Like
  • 0
Hi,
I have a scanario where there is a lookup relationship between two objects and the requirement is to not allow more than One Child Object record for a that Master object (In a way to have just 1:1  record ) between the two objects, related with a lookup relationship.
Please help me understand, how do I achieve this.

Thanks
Hello everyone,
 can any one explain how to play with bellow map , how its usful in developement . can you provide proper example with below map.

Map<String,Map<String,List<String>>> mapOfMaps = new Map<String,Map<String,List<String>>>();

Thanks to all  advance :)
Hi all,

I was wondering if its possible for a trigger to automatically create an opportunity product when an opportunity is closed won.

I have an Object related to the opportunity that has fields called Product_Name__c and Total_Price__c.

I would like the trigger to populate these fields into the corresponding fields on the Opportunity Products object.

Thanks
i want to auto populate the picklist after selecting a lookup field.  please help me.


User-added image
 
<apex:page Controller="OppContactRoleController" id="p1">
<script>
var ContactValue='';
function changeValue(input) {

 asChangePrimary(input.value);

}  

function ValidateRoles(input,objSelection,Object) {

 if(input.value!='--None--'){
 if(ContactValue!=''){
 alert('Please select '+Object);
 }
}
}
function setContact(convalue){

ContactValue=convalue;

} 
    
    function getvalue(myinput)
    {
        //  var x=document.getElementById('p1:fm:pb2:pbt:c1:opp:contactid').value;
        //alert(x);
        // alert(myinput.value);
        var y=myinput.value;
        document.getElementById('p1:fm:iph').value=y;
            }
            
</script>
           <apex:form id="fm" >
                 <apex:actionfunction name="getvalue" action="{!getcontactrole}" />

				<!-- do not remove this -->
               <apex:inputtext value="{!mylookupvalue}" id="iph" >
               <!--    <apex:actionsupport event="on" action="{!getcontactrole}" /> -->
               </apex:inputtext>
                 <!-- *********************** -->
           <apex:pageMessages id="pgmsg" />
            <apex:actionFunction action="{!setPrimary}" name="asChangePrimary" rerender="hdn">
             <apex:param name="PrimaryContact" assignTo="{!PrimaryContact}" value="" />
           </apex:actionFunction>
           <apex:actionFunction action="{!SaveAll}" name="RemoveExcessOncomplete"  rerender="pb2">
           
           </apex:actionFunction>
           
            <apex:pageBlock id="pb1" title="Contact Role and Partner Merge" rendered="{!!ShowView}">
            <apex:pageBlockButtons location="top">      
            
             <a class="btn" style="text-decoration: none;" href="{!$Page.OppcontactRolePage}?Id={!strId}&IsInline=1&IsNew=1" target="_top">New Project Firm</a>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!lstMainConAccRoleWrap}" var="l">
              <apex:column headerValue="Action">
              <apex:outputPanel >
               <apex:outputLink style="color:#015ba7" value="{!$Page.OppcontactRolePage}?Id={!strId}&IsInline=1" target="_top">Edit</apex:outputLink>
                 
                 <span style="color:#015ba7">|</span> </apex:outputPanel>
                  <apex:commandlink style="color:#015ba7" value="Del" onclick="return confirm('Are you sure?');" target="_top" action="{!DelOCR}" >
                   <apex:param value="{!l.iIndex}" name="RowIndex" assignTo="{!RowIndex}"/>
                  <apex:param value="{!l.RecordId}" name="delRecordId" assignTo="{!delRecordId}"/>
                 </apex:commandlink>
                 </apex:column>
                <apex:column headerValue="Project Firm" value="{!l.objAcc.Name}"/>
  
                <apex:column headerValue="Company City" value="{!l.objAcc.BillingCity}"/>
                <apex:column headerValue="Company State" value="{!l.objAcc.BillingState}"/>
                <apex:column headerValue="Firm Role">
                <apex:outputPanel > {!l.objOPR.Role}  </apex:outputPanel>
                </apex:column>
                 <apex:column headerValue="Contact Role">
                <apex:outputPanel > {!l.objOCR.Role}  </apex:outputPanel>
                </apex:column>
                <apex:column HeaderValue="Contact" value="{!l.objOCR.ContactId}"/>
              
                <apex:column HeaderValue="Primary">
                <apex:outputPanel rendered="{!!l.objOCR.IsPrimary}"><img src="/img/checkbox_unchecked.gif" alt="Not Checked" width="21" height="16" class="checkImg" title="Not Checked"/></apex:outputPanel>
                <apex:outputPanel rendered="{!l.objOCR.IsPrimary}"><img src="/img/checkbox_checked.gif" alt="Checked" width="21" height="16" class="checkImg" title="Checked"/> </apex:outputPanel>
                </apex:column>                
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        <apex:pageblock id="pb2" rendered="{!ShowView}">
      
            <apex:pageBlockTable value="{!lstMainConAccRoleWrap}" var="l" id="pbt">
          <apex:column headervalue="Action">
        
            <apex:commandLink rendered="{!if(l.RecordId!='',true,false)}" value="Delete" onclick="return confirm('Are you sure ?');" action="{!DelOCR}" 
            style="color:#015ba7;">
            <apex:param value="{!l.iIndex}" name="RowIndex" assignTo="{!RowIndex}"/>
            <apex:param value="{!l.RecordId}" name="delRecordId" assignTo="{!delRecordId}"/>
            </apex:commandLink>
            <apex:outputLink rendered="{!if(l.RecordId=='',true,false)}" onclick="return confirm('Are you sure ?');" style="color:#015ba7" value="{!$Page.OppcontactRolePage}?Id={!strId}&IsInline=1" target="_top">Delete</apex:outputLink>
            </apex:column>
            
            <apex:column headervalue="Primary">
            <apex:outputPanel >
            <apex:outputPanel rendered="{!If(l.IsPrimary,true,false)}">
            <input type="radio" checked="true" name="chosen" id="{!l.RecordId}" VALUE="{!l.RecordId}" onclick="changeValue(this);" />
            </apex:outputPanel>
             <apex:outputPanel rendered="{!If(l.IsPrimary,false,true)}">
             <input type="radio"  name="chosen" id="{!l.RecordId}" VALUE="{!l.RecordId}" onclick="changeValue(this);" />
            </apex:outputPanel>
            </apex:outputPanel>

            </apex:column> 
            
            <apex:column headerValue="Contact" id="c1">
            <apex:outputPanel id="opp">
             <apex:inputField required="false"  value="{!l.objOCR.ContactId}" id='contactid'  >
               <apex:actionsupport event="onchange" action="{!getcontactrole}" />
                 <!-- action support added for sending value to apex class.-->
              <!--  <apex:actionsupport event="onchage" action="{!getcontactrole}" />  -->
                </apex:inputField>
             </apex:outputPanel>
             </apex:column> 
             
            <apex:column headerValue="Contact Role">
                    <apex:inputField value="{!l.objOCR.Role}" >
                   
                    </apex:inputField>
              </apex:column> 
             <apex:column headerValue="Account">
               <apex:outputPanel > 
              <apex:inputField value="{!l.objCon.AccountId}"/>
             </apex:outputPanel>
             </apex:column> 
             <apex:column headerValue="Partner Role">
               <apex:outputPanel > 
                  <apex:selectList value="{!l.objOPR.Role}" size="1" multiselect="false">
                    <apex:selectOptions value="{!OPRRoleOptions}"></apex:selectOptions>
                  </apex:selectList>
                 </apex:outputPanel> 
                  <!--   <apex:inputField rendered="{!if(l.objOCR==null,false,true)}" value="{!l.objOCR.Role}" />
                  <apex:inputField rendered="{!if(l.objOCR==null,true,false)}" value="{!l.objOPR.Role}" />  -->
             </apex:column> 
  
                 
            </apex:pageBlockTable>

         <apex:pageBlockButtons location="bottom">  
         <apex:commandButton value="Save" action="{!SaveAll}"     />

          <apex:commandButton value="New" onclick="SavePage();" rerender="pb2,pgmsg"   />
          <apex:commandButton value="Back" action="{!Back}"    />
         </apex:pageBlockButtons>
        </apex:pageblock>
        <apex:actionFunction action="{!QuickSave}" oncomplete="AddNew();" name="SavePage" rerender="pb2,pgmsg"  />
        <apex:actionFunction action="{!AddNew}" rerender="pb2,pgmsg" name="AddNew"/>
      ...........{!cons.role__c}
    </apex:form>
</apex:page>
 
public with sharing class OppContactRoleController {

   Public List<Contact> contactList {get;set;}
    
    public boolean ShowView{get;set;}
    public String strId{get;set;}
    public string PrimaryContact{get;set;}   
    Id OCRId;  
    public string delRecordId{get;set;}   
    Map<string,string> mapOCR=new Map<string,string>();
    string FirstPrimaryContact;
    public integer RowIndex{get;set;}
    set<Id> conIds = new Set<Id>();
    
    public string PrimaryAccount{get;set;} 
    public string delOPRId{get;set;}   
    Map<string,string> mapOPR=new Map<string,string>();
    string FirstPrimaryAccount; 
    set<Id> AccIds = new Set<Id>();
   
    /*  New Approach */
    List<Account> lstAcc=new List<Account>();
    public list<MainConAccRoleWrap> lstMainConAccRoleWrap{get;set;}
    List<OpportunityContactRole> lstOCR=new List<OpportunityContactRole>();
    List<Partner> lstOPR=new List<Partner>();
    Map<Id,Account> mapIDAcc=new Map<Id,Account>();
    Map<Id,Contact> mapIDCon=new Map<Id,Contact>();
    public List<SelectOption> OPRRoleOptions{get;set;} 
    set<string> setOPRRole=new set<string>();
    Map<string,integer> MapMerge=new Map<string,integer>(); // Account,Role
    set<integer> MergeIndex=new set<integer>();
    Map<string,integer> MapParterAccId=new Map<string,integer>();
    
    // modification code for contact role auto populate.
    public string mylookupvalue{get;set;}
    public contact cons{get;set;}
    public void getcontactrole()
    {
      cons=[select id,name,role__c from contact where name=:mylookupvalue limit 1];
    }
    
    Public OppContactRoleController (){//ApexPages.StandardController cntrl
    try{
     
    }catch(exception ex){
        
        system.debug('------Error------'+ex.getMessage()+'-----ar Line #----------'+ex.getLineNumber());
    }   
    OPRRoleOptions= new List<SelectOption>();
    lstMainConAccRoleWrap=new list<MainConAccRoleWrap>();
    
    
    RowIndex=-1;
    try{
    strId=ApexPages.currentPage().getParameters().get('Id');
    ShowView=false;
    string IsNew=ApexPages.currentPage().getParameters().get('IsNew');
    string IsInline=ApexPages.currentPage().getParameters().get('IsInline');
 
    if(IsInline=='1'){
    ShowView=true;
    
    }
    OPRRoleOptions();
    
    contactList = new List<Contact>();
    
    for(OpportunityContactRole cRole :[Select Id,ContactId,IsPrimary,Role from OpportunityContactRole where Role!=null and OpportunityId =: strId]){
      
     if(cRole.IsPrimary){
           PrimaryContact=cRole.Id;
           FirstPrimaryContact=cRole.Id;
        } 
        lstOCR.add(cRole);
        conIds.add(cRole.ContactId);
    }
    
    for(Partner oRole :[Select Id,AccountToId,IsPrimary,Role from Partner where  Role!=null and AccountToId!=null and AccountFromId=null and OpportunityId =: strId]){

        lstOPR.add(oRole);
        AccIds.add(oRole.AccountToId);
        integer PartnerOccurCount=MapParterAccId.get(oRole.AccountToId)==null?0:MapParterAccId.get(oRole.AccountToId);
       // MapParterAccId.put(oRole.AccountToId,PartnerOccurCount++);
    }
    
 
    contactList = [Select Id, Name, AccountId from Contact where Id in: conIds];

    for(Contact ObjCon:contactList){

     mapIDCon.put(ObjCon.Id,ObjCon);
     AccIds.add(ObjCon.AccountId);
    }
    
    lstAcc=[Select Id, Name,BillingStreet,BillingCity, BillingState, BillingCountry  from Account where Id in: AccIds];
    for(Account ObjAcc:lstAcc){
     mapIDAcc.put(ObjAcc.Id,ObjAcc);
    }
    integer i=0;
    for(OpportunityContactRole objOCR:lstOCR){
       
    lstMainConAccRoleWrap.add(new MainConAccRoleWrap(objOCR.Id,objOCR,new Partner(),mapIDAcc.get(mapIDCon.get(objOCR.ContactId).AccountId),objOCR.IsPrimary,lstMainConAccRoleWrap.size(),new Contact(AccountId=mapIDCon.get(objOCR.ContactId).AccountId)));
    MapMerge.put(String.ValueOf(mapIDCon.get(objOCR.ContactId).AccountId),i); 
    i++;    
    }
    
    for(Partner objOPR:lstOPR){
 
    If(!MapMerge.Keyset().Contains(String.ValueOf(objOPR.AccountToId))){
     lstMainConAccRoleWrap.add(new MainConAccRoleWrap(objOPR.Id,new OpportunityContactRole(OpportunityId=strId),objOPR,mapIDAcc.get(objOPR.AccountToId),objOPR.IsPrimary,lstMainConAccRoleWrap.size(),new Contact(AccountId=objOPR.AccountToId)));
    }
    else{
        
    integer IndexUpd=MapMerge.get(String.ValueOf(objOPR.AccountToId));
    if(!MergeIndex.Contains(IndexUpd)){
    MainConAccRoleWrap objUpd=lstMainConAccRoleWrap[IndexUpd];
    string RecordId=objUpd.RecordId+','+objOPR.Id;
    objUpd.RecordId=RecordId;
    objUpd.objOPR=objOPR;
    objUpd.IsPrimary=objOPR.IsPrimary;
    objUpd.objAcc=mapIDAcc.get(objOPR.AccountToId);
    objUpd.objCon=new Contact(AccountId=objOPR.AccountToId);
    lstMainConAccRoleWrap[IndexUpd]=objUpd;
    MergeIndex.add(IndexUpd);
    }
    }   
    }
    
    
    
    
    
    
    if(IsNew=='1'){
        ShowView=true;
        lstMainConAccRoleWrap.add(new MainConAccRoleWrap(null,new OpportunityContactRole(OpportunityId=strId),new Partner(),new Account(),false,lstMainConAccRoleWrap.size(),new Contact()));
    
    }
    }
    catch(Exception Ex){
     system.debug('-------Exception-------'+ex.getMessage()+'------at Line #-----'+ex.getLineNumber());
    }
    delRecordId=null;
      system.debug('---lstMainConAccRoleWrap--Load-'+lstMainConAccRoleWrap);  
    }

    
    Public class MainConAccRoleWrap{


        public OpportunityContactRole objOCR{get;set;}
        public Partner objOPR{get;set;}
        public boolean IsPrimary{get;set;}
        public integer iIndex{get;set;}
        //public Contact objCon{get;set;} Contact objCon1,
        public Account objAcc{get;set;}
        public string RecordId{get;set;}
        //public List<SelectOption> ObjOPRole{get;set;}
        public Contact objCon{get;set;}
        // string RecordId,OpportunityContactRole objOCR,Partner objOPR,Account objAcc,boolean IsPrimary,integer iIndex,Contact objCon
        public MainConAccRoleWrap(string RecordId1,OpportunityContactRole objOCR1,Partner objOPR1,Account objAcc1,boolean IsPrimary1,integer iIndex1,Contact objCon1){
        
        this.RecordId=RecordId1;
        this.objOCR=objOCR1;
        this.objOPR=objOPR1;
        this.IsPrimary=IsPrimary1;  
        this.iIndex=iIndex1;
        //this.objCon=objCon1;
        this.objAcc=objAcc1;
        this.objCon=objCon1;
        }
        
    }
    

    
    
    
    public void AddNew(){
    ShowView=true;
    lstMainConAccRoleWrap.add(new MainConAccRoleWrap(null,new OpportunityContactRole(OpportunityId=strId),new Partner(),new Account(),false,lstMainConAccRoleWrap.size(),new Contact()));
    }
    
    public void RemoveExcess(){
    ShowView=true;
    System.debug('----------contactList----------'+contactList);
    }
    
    public void setPrimary(){
    system.debug('---PrimaryContact ---'+PrimaryContact );
    
    }
    
    public pageReference DelOCR(){
    
     if(!string.IsEmpty(delRecordId)){
      delRecordId= lstMainConAccRoleWrap[RowIndex].RecordId;
	   if(delRecordId.contains(',')){
	     string[] delArr=delRecordId.split(',');
	     Database.delete(delArr[0]); 
	     Database.delete(delArr[1]); 
	   }
	   else{
	   	 Database.delete(delRecordId);
	   }
   
    }
    ShowView=false;
    pageReference pg=new PageReference('/'+strId);
    pg.setredirect(true);
    return pg;
    }
    
    public pageReference Back(){
    
    pageReference pg=new PageReference('/'+strId);
    //pageReference pg=new PageReference('/apex/OppcontactRolePage?Id=00617000005UyFO&IsInline=1');
    pg.setredirect(true);
    return pg;
    
    }
    
    
    public void PrepareView(){
        
          try{      
        system.debug('---lstMainConAccRoleWrap---Save--'+lstMainConAccRoleWrap);  
        
        
    List<OpportunityContactRole> lstOCRDML=new List<OpportunityContactRole>();
    List<Partner> lstOPRDML=new List<Partner>();
    // string RecordId,OpportunityContactRole objOCR,Partner objOPR,Account objAcc,boolean IsPrimary,integer iIndex,Contact objCon
    set<string> setPartnerAcc=new set<string>();
    for(MainConAccRoleWrap objMCA:lstMainConAccRoleWrap){ 
        
    if(objMCA.objOCR.ContactId!=null && objMCA.objOCR.Role!=null && objMCA.objOCR.Role!='--None--'){
        
        if(PrimaryContact==objMCA.RecordId){
        objMCA.objOCR.IsPrimary=true;
        }

        lstOCRDML.add(objMCA.objOCR);
       
        
    }
    
    
   // if(objMCA.objOPR.Role!=null && objMCA.objOPR.Role!='--None--'){ //objMCA.objCon.AccountId!=null && 
       String PartnerAccId='';
       if(objMCA.objCon!=null && objMCA.objCon.AccountId!=null){
       	PartnerAccId=objMCA.objCon.AccountId;
       }
       else{
	       if(!string.IsEmpty(objMCA.objOCR.ContactId)){
		       if(mapIDCon.get(objMCA.objOCR.ContactId)!=null){
		        PartnerAccId=mapIDCon.get(objMCA.objOCR.ContactId).AccountId;	
		       }
		       else{
		       	PartnerAccId=[select AccountId from Contact where Id=:objMCA.objOCR.ContactId].AccountId;
		       }
	       }
       }
       //integer PartnerOccurCount=MapParterAccId.get(PartnerAccId)==null?0:MapParterAccId.get(PartnerAccId);
      // PartnerOccurCount<=1 &&
       if(!string.IsEmpty(PartnerAccId) &&  !setPartnerAcc.contains(PartnerAccId)){ 
	       Partner objPartNew=new Partner(); 
	       objPartNew.Role=objMCA.objOPR.Role;
	       objPartNew.AccountToId=PartnerAccId;
	       if(PrimaryContact==objMCA.RecordId){
	       		objPartNew.IsPrimary=objMCA.IsPrimary;
	       }
	       objPartNew.OpportunityId=strId;
	       lstOPRDML.add(objPartNew); 
	       //if(PartnerOccurCount==0){
	      //   MapParterAccId.put(PartnerAccId,PartnerOccurCount++);
	       //}
	       setPartnerAcc.add(PartnerAccId);
       }
    //  }
  
  
    }
    
    if(!lstOCRDML.IsEmpty()){

    Upsert lstOCRDML;
    }
    
    Delete[select Id from Partner where OpportunityId=:strId]; 
    if(!lstOPRDML.IsEmpty()){
       Upsert lstOPRDML;
    }   
    

    ShowView=false;
   
    
    }catch(exception ex){
        
        system.debug('------Error------'+ex.getMessage()+'-----ar Line #----------'+ex.getLineNumber());
             ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'------Error------'+ex.getMessage()+'-----ar Line #----------'+ex.getLineNumber());
            ApexPages.addMessage(myMsg);
       
    }
    } 
    
    
    
    public pageReference SaveAll(){
     PrepareView();
     pageReference pg=new PageReference('/'+strId);
     pg.setredirect(true);
     return pg;
    }
    
    
    public void QuickSave(){
   
    PrepareView();

    }
    

   public void OPRRoleOptions()
   {
       Schema.DescribeFieldResult fieldResult = Partner.Role.getDescribe();
       List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        OPRRoleOptions.add(new SelectOption('--None--', '--None--'));    
       for( Schema.PicklistEntry f : ple)
       {
          OPRRoleOptions.add(new SelectOption(f.getLabel(), f.getValue()));
          setOPRRole.add(f.getLabel());
       }       
      
   }
    
    
}


 
I am having a issue in Trigger. Its unable to fire..

trigger CreateWithJIRAIssue on Case (after insert) {
List<Case> escCases = new List<Case>();
  

   for (Case c : Trigger.new){

    // all the cases that have status as abc' is added to a list called xCases
    if(c.Status == 'abc'){
     xCases.add(c);
    }
   }
   if(xCases != null && xCases.size()>0){
    // now iterate over the selected cases and call the web service
    for(Case c : xCases){
     //call webservice
     system.debug('inside case ' + c.CaseNumber);
     //Define parameters to be used in calling Apex Class
     String jiraURL = 'http://jira';
     String systemId = '2';
     String objectType ='Case';
     String objectId = c.id;
     String projectKey = 'LEV';
     String issueType = 'BUG';
     System.debug('\n\n status is escalated');
     //Execute the web service call
     
     JIRAConnectorWebserviceCallout.CreateIssue(jiraURL, systemId ,objectType,objectId,projectKey,issueType);
    }
   }
  }
}
}
Hi All,
     
 Iam new to soap integration. I have generated this class from WSDL file, I have to pass the Currentdate,BD,BDtype,restrictions into this class but i am confusing to find out method?
  can you help me in this?
  
  public class generatdclass
  {
   public class CandAllows {
        public String CurrentDate;
        public String BD
        public String BDType;
        public wwwsampleendpointcom.ArrayOfAllows Allows;
        private String[] CurrentDate_type_info = new String[]{'CurrentDate','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BD_type_info = new String[]{'BD','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] BDType_type_info = new String[]{'BDType','http://www.Samplendpoint.com/se/',null,'0','1','true'};
        private String[] Allows_type_info = new String[]{'Allows','http://www.Samplendpoint.com/se/null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.Samplendpoint.com/se/','true','false'};
        private String[] field_order_type_info = new String[]{'CurrentDate','BD','BDType','Allows'};
    }
  }
Where do my trailhead achievments show up for other users to see?
Hi all,
         I am new to salesforce development.I have to fetch the contact details like FirstName,LastName,Phone,Email,MailingAddress of a selected record of  account object and display it in the tabular format in vf page.
I tried with this query in controller :-
               Private id AccountId;
               this.accountRecord = (Account)controller.getRecord();
              this.AccountId = this.accountRecord.id;
              List<Contact> details= new List<Contact>();
              details = [SELECT FirstName,LastName,Phone,Role__c,Email,MailingAddress FROM Contact WHERE AccountId=:this.AccountId];
       I am getting the required output for few records,and few records its showing "List index out of bounds: 0 " error.
         Please help me with this.


Thanks & Regards,
Lahari
           
Hi,
Iam trying delete some records and display/stored those deleting records in another folder.Tell me how to approach this scenario

Regards
Galeeb SK
trigger EmployeeInformation on Employe_Infrmation__c (before insert,before update) {

    set<string> gh=new set<string>();
      
    for(Employe_Infrmation__c hh:trigger.new){
    
    if(trigger.IsInsert||(trigger.IsUpdate && hh.Name!=trigger.oldMap.get(hh.Id).Name))
    
    gh.add(hh.Name);
    
}

    set<string> jh =new set <string>();
    
    for(Employe_Infrmation__c hh:[select Name from Employe_Infrmation__c where Name in:gh]){
    
    jh.add(hh.Name);
  }
  
  
  for(Employe_Infrmation__c hh:trigger.new){
  
  if(trigger.IsInsert||(trigger.IsUpdate && hh.Name!=trigger.oldMap.get(hh.Id).Name)){
  
  if(jh.contains(hh.Name))
  
  hh.adderror('Duplicate values');
  }
  }
  }
How to integrate facebook and salesforce app using SOAP approach. Please guide me step by step procedure
How to integrate salesforce with salesforce using SOAP approach..??? Please help me step by step procedure
Hi techi's,

Please solve this issue

constructor;
try
        {
            orderDetails = (OrderItem)controller.getRecord();
            system.debug('orderdetails'+orderdetails);
            orderDetails = [select id,Stage__c,OrderItemNumber,Quantity from OrderItem where id=:orderDetails.Id];
            Production = new Production_Stage__c();
            Production.Order_Product__c = orderDetails.id;
            system.debug('inputstatus is '+inputstatus);
            productionStageMap=new Map<String,Decimal>();
            productionStageSeqMap=new Map<Decimal,String>();
            
            Map<String,ProductionStage__c> tempMap = ProductionStage__c.getAll();
            
            for(String stageName : tempMap.KeySet())
            {
                if(tempMap.get(stageName)!=null)
                {
                    ProductionStage__c tempObj =tempMap.get(stageName);
                    productionStageMap.put(tempObj.Name,tempObj.Sequence_Number__c);
                    productionStageSeqMap.put(tempObj.Sequence_Number__c,tempObj.Name);
                }
            }
            system.debug('productionStageMap ' + productionStageMap);
            system.debug('productionStageSeqMap ' + productionStageSeqMap.keySet());
        }
        catch(exception ex)
        {
            system.debug('mesg '+ ex.getLineNumber() +'  no '+ex.getMessage());
        }
Method :
 public PageReference saveAndnew()
    {
        
        system.debug('The entered production object is ' + Production );
        system.debug('The input stage is ' + inputstatus);   
        system.debug('The production stages are ' + productionStageMap );
        
        PageReference pr;
        
        decimal Quantity = Production.Quantity__c;
        Production_Stage__c previousProductionstages = new Production_Stage__c();
        decimal completedquantity=0;
        decimal DateQty;
        decimal stageqty=0;
        decimal qty=0;
        decimal quan;
        decimal tqty;
        List<decimal> ldec;
        set<string> stageName=new set<string>();
        List<Production_Stage__c>  ProdMap;
        List<Production_Stage__c> stagelist = [select id,Quantity__c,Stage__c from Production_Stage__c where Stage__c=:inputstatus and Order_Product__c =:orderDetails.id];//stagelist here am getting null value&&inputstatus is null
        system.debug('stagelist is'+stagelist);
        
        for(Production_Stage__c ps : stagelist)
        {
            system.debug('Production Qty is'+Production.Quantity__c);
            qty= qty+ps.Quantity__c;
            //stageqty= Production.Quantity__c+quan;
            //completedquantity=stageqty+Production.Quantity__c;
        }
        
        quan = qty+Production.Quantity__c;

Mytest class:
 Production_Stage__c pstage2=new Production_Stage__c();
        pstage2.Date_In__c=system.today();
        pstage2.Date_Out__c=date.newInstance(2015,12,20);
        pstage2.Order_Product__c=oi.id;
        pstage2.Stage__c ='Schedule';
        pstage2.Sequence_Number__c=1;
        pstage2.Quantity__c=5;
        insert pstage2;
        system.debug('SSSSSSS'+pstage2);
        //insertion of custom settings
      
         
        ProductionStage__c ps1=new ProductionStage__c();
        ps1.Name=pstage.Stage__c;
        ps1.Sequence_Number__c=1;
        insert ps1;
       
        system.debug('ProductionStageps1'+ps1);
        
        PageReference pageRef = Page.ProductionProcessVf;
        test.setCurrentPage(pageRef);
        ApexPages.StandardController con = new ApexPages.StandardController(oi);
        system.debug('CCCCCCCCCon'+con);
        
         
        Production_Controller proc= new Production_Controller(con);
        system.debug('CCCCCCCCCon'+proc);
        
      
        proc.inputstatus='PreProcessing';
        proc.getstatusOptions();
        proc.saveAndnew();//Here getting Null pointer Exception 
        proc.cancel();
can any one help?
Hello,

I am system admin, how do it not allow other sstem admins to not login in to my account
  • December 02, 2015
  • Like
  • 0
Hi there

Salesforce does not allow you to create PDF attachments in batch job.

This is work around to that.
https://developer.salesforce.com/forums/?id=906F0000000AlGoIAK

It works!

But As of Summer 15, Salesforce have implemented a critical update "PageReference getContent() and getContentAsPDF() Methods Treated as Callouts". Once enabled, you may get the rather uninformative error "(304497466)|FATAL_ERROR|System.CalloutException: Callout loop not allowed".

And so I have the problem described in this blog: http://codrspace.com/gwickman/callout-loop-not-allowed-error-when-using-getcontent-and-getcontentaspdf/

Can someone please help me get around this error or help with another way to create PDF attachments for emails in a batch job?

Thank you very much


 

Hi all,

 

I have a question is it possible to show visualforce page on the page layout when I hit edit button ? My case is I want to show the visualforce page and standar page layout at the same time on page layout in edit mode. Is is possible to do that? Or maybe there is other suggestions for may case would be great.

 

Thanks

 

Regards,

 

Edwin

Hi all,

I was wondering if its possible for a trigger to automatically create an opportunity product when an opportunity is closed won.

I have an Object related to the opportunity that has fields called Product_Name__c and Total_Price__c.

I would like the trigger to populate these fields into the corresponding fields on the Opportunity Products object.

Thanks