• karimulla salesforce
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
for(integer i=1; i<=10; i++){
     
Account a = new account();
  a.name ='sha';
  a.phone='123';
  a.annualrevenue=9096;
  insert a;
    
}

hi, iam going to insert a multiple records using a forloop on the account object, but getting an dml exception.


User-added image
//if tried for contact object , it is getting work , may i know the reason behind it...

Thanks 
karimulla syed
i have installed, JRE and installed the Eclipse , and to Configure the Eclipse to force.com , showing an error below while Installing a new software adding the url . showing cannot find it..

User-added image
thanks
karimulla
Hi..! need to render the values in the two pages , like in dotnet, they have the Partialview concept .. do we have same functionality . in salesforce..
Thanks

 
<!--Using the Includetab with multiple controllers-->

<apex:page controller="actionfunctiontest1" >
   
   <apex:form >
        <ul>
          <li onclick="passValueToController('Testing'); return false;" style="cursor:pointer;">Click Me</li>
        </ul> 
     
    <apex:actionFunction name="passValueToController" action="{!testing}" reRender="frm" >
        <apex:param name="selectedval" value="selectedval" assignTo="{!selectedval}"></apex:param>
     </apex:actionFunction>
   </apex:form>
       
    <apex:outputPanel id="frm">
           <apex:include pageName="actionfunctiontest2"/>
     </apex:outputPanel>
      
  </apex:page>

<!--apexclass-->
Apex Controller:

public class actionfunctiontest1 {
 public String selectedval{get;set;}
  // public actionfunctiontest2 t1{get;set;}
  public void testing(){
  system.debug('form the selectedval controller1'+selectedval);
  
      actionfunctiontest2  t1= new actionfunctiontest2();
   } 
}

page2andclass2:
 
<apex:page controller="actionfunctiontest2">
  <apex:form >
 The value passed is:<apex:inputtext value="{!name}"/>
  </apex:form>
</apex:page>


Apex Controller:-

public class actionfunctiontest2 {
   public string name{get;set;}
   public actionfunctiontest2(){
        name =Apexpages.currentPage().getParameters().get('selectedval');
        system.debug('This is the controller2 form 1 im getting the values here');
        system.debug(' sucess:'+ name);
      }
      }

Here iam getting the values in the debug window, but unable to render it in the visualforce page..! how to display it in the visualforce page.

Thank you...!
Using the Includetab with multiple controllers, if yes, iam getting the values in the system.debug(); , but unable to display the values in the visualforce page..!
 
<!--Using the Includetab with multiple controllers-->

<apex:page controller="actionfunctiontest1" >
   
   <apex:form >
        <ul>
          <li onclick="passValueToController('Testing'); return false;" style="cursor:pointer;">Click Me</li>
        </ul> 
     
    <apex:actionFunction name="passValueToController" action="{!testing}" reRender="frm" >
        <apex:param name="selectedval" value="selectedval" assignTo="{!selectedval}"></apex:param>
     </apex:actionFunction>
   </apex:form>
       
    <apex:outputPanel id="frm">
           <apex:include pageName="actionfunctiontest2"/>
     </apex:outputPanel>
      
  </apex:page>

<!--apexclass-->
Apex Controller:

public class actionfunctiontest1 {
 public String selectedval{get;set;}
  // public actionfunctiontest2 t1{get;set;}
  public void testing(){
  system.debug('form the selectedval controller1'+selectedval);
  
      actionfunctiontest2  t1= new actionfunctiontest2();
   } 
}
Included page is:
<apex:page controller="actionfunctiontest2">
  <apex:form >
 The value passed is:<apex:inputtext value="{!name}"/>
  </apex:form>
</apex:page>


Apex Controller:-

public class actionfunctiontest2 {
   public string name{get;set;}
   public actionfunctiontest2(){
        name =Apexpages.currentPage().getParameters().get('selectedval');
        system.debug('This is the controller2 form 1 im getting the values here');
        system.debug(' sucess:'+ name);
      }
      
}

//iam gettig the value is the system.debug, but unable to dispaly it in the visualforce page..
//can multiple controllers can be used for the Include tag in salesforce

Thank you
Can we use the mutiple controllers or multiple clases when iam using the <apex:inculde page />
Can we use apex:include  multiple controller,

Ex: page1
 <apex:page  controller="class1">

 <apex:include pageName="page2"/>
</apex:page>

Page:2

<apex:page  controller="class2">

 <apex:inputext />
</apex:page>

Thanks in advance ...!
 
Can we use apex:include  multiple controller,

Ex: page1
 <apex:page  controller="class1">

 <apex:include pageName="page2"/>
</apex:page>

Page:2

<apex:page  controller="class2">

 <apex:inputext />
</apex:page>

 
How to use the salt in the salesforce for encryption and decryption in salseforce like C#... any ideas ??? 

Thanks in advance
Hi everyone,am trying to create a contact related to paritcular account in lightning .tried so far..,and embeded this component in accountrecord page ,but unable to save. can someone help me out .

Thanks in Advance.
apex:
public class QuickCreatecontact {
@AuraEnabled
    public static void createcontact(contact con,Id AccountId){
        con.AccountId=AccountId;
        insert con;
    }
}

component:
<aura:component controller="QuickCreatecontact" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:attribute name="createcontact" type="contact"/>
    <aura:attribute name="accountId" type="string"/>
   <!-- <aura:handler name="init" value="{!this}" action="{!c.doinit}"/>-->
    <div>
        <lightning:input type="text" name="{!v.createcontact.LastName}" label="Enter LastName" />
        <lightning:input type="text" name="{!v.createcontact.FirstName}" label="Enter firstName"/>
        <lightning:input type="phone" name="{!v.createcontact.phone}" label="Enter phone"/>
        
    </div>
    <div>
        <lightning:button label="save" variant="brand" onclick="{!c.dosave}"/>
     </div>
</aura:component>

js:
({
    dosave : function(component, event, helper) {
        var action=component.get("c.createcontact");
        action.setParams({
            con:component.get("v.createcontact"),
            Id:component.get("v.accountId")
        });
        action.setCallback(this,function(response){
            var state=response.getState();
           
            if(state==='SUCCESS'){
                var result=response.getReturnValue();
               alert('SUCCESS');
                
               
            }else if(state==='INCOMPLETE'){
                
            }
        });
        $A.enqueueAction(action);
    }
})
  • September 13, 2021
  • Like
  • 0
Name- aws_WScallout
url - https://servicename.amazonaws.com
Identity Type - Named Principal
Authentication Protocol - AWS Signature Version 4
AWS Access Key ID - ******
AWS Secret Access Key - ********
AWS Region - us-east-1
AWS Server- executea
Generate Authorization Header - true 
 
String token ='abcdefghijkl'; (say)
 HttpRequest req = new HttpRequest();
 req.setEndpoint('callout:aws_WScallout/alpha/plan/5?Source=Ops&localen=NA');
 req.setMethod('GET');
 Http http = new Http();
 HTTPResponse res = http.send(req);
 while (res.getStatusCode() == 302) {
           res.setEndpoint(res.getHeader('Location'));
           res = new Http().send(req);
       }
 System.debug(res.getBody());

I have to add x-amz-access-token which I get programmatically from another webservice. without adding error I am getting.
DEBUG|{"message": "Missing required request parameters: [x-amz-access-token]"}
how should I add to this callout?
I tired doing this 
  • req.setHeader('x-amz-access-token', token); 
  • req.setHeader('Authorization', EncodingUtil.base64Encode( Blob.valueof('x-amz-access-token'+ token)));
  • req.setHeader('x-amz-access-token', EncodingUtil.base64Encode(Blob.valueof(token)));

I get this error
DEBUG|{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method..."}
  • December 06, 2019
  • Like
  • 0
Hi All,
    I want to integrate salesforce with external website (for example: facebook) using canvas app. I have created the connected app setup. but i am unable to get the sample code that we need to embed in external website. can anyone help me  in step by step implementation to integrate with canvas
Using the Includetab with multiple controllers, if yes, iam getting the values in the system.debug(); , but unable to display the values in the visualforce page..!
 
<!--Using the Includetab with multiple controllers-->

<apex:page controller="actionfunctiontest1" >
   
   <apex:form >
        <ul>
          <li onclick="passValueToController('Testing'); return false;" style="cursor:pointer;">Click Me</li>
        </ul> 
     
    <apex:actionFunction name="passValueToController" action="{!testing}" reRender="frm" >
        <apex:param name="selectedval" value="selectedval" assignTo="{!selectedval}"></apex:param>
     </apex:actionFunction>
   </apex:form>
       
    <apex:outputPanel id="frm">
           <apex:include pageName="actionfunctiontest2"/>
     </apex:outputPanel>
      
  </apex:page>

<!--apexclass-->
Apex Controller:

public class actionfunctiontest1 {
 public String selectedval{get;set;}
  // public actionfunctiontest2 t1{get;set;}
  public void testing(){
  system.debug('form the selectedval controller1'+selectedval);
  
      actionfunctiontest2  t1= new actionfunctiontest2();
   } 
}
Included page is:
<apex:page controller="actionfunctiontest2">
  <apex:form >
 The value passed is:<apex:inputtext value="{!name}"/>
  </apex:form>
</apex:page>


Apex Controller:-

public class actionfunctiontest2 {
   public string name{get;set;}
   public actionfunctiontest2(){
        name =Apexpages.currentPage().getParameters().get('selectedval');
        system.debug('This is the controller2 form 1 im getting the values here');
        system.debug(' sucess:'+ name);
      }
      
}

//iam gettig the value is the system.debug, but unable to dispaly it in the visualforce page..
//can multiple controllers can be used for the Include tag in salesforce

Thank you
Can we use the mutiple controllers or multiple clases when iam using the <apex:inculde page />
Can we use apex:include  multiple controller,

Ex: page1
 <apex:page  controller="class1">

 <apex:include pageName="page2"/>
</apex:page>

Page:2

<apex:page  controller="class2">

 <apex:inputext />
</apex:page>

Thanks in advance ...!