• Avishek Roy 18
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 0
    Replies
Appreciate if someone can help, as i am struggling to resolve the issue for last 3 days.
Requirement: In our application there is a custom Object created name 'Vehicle'. There is another junction object named Vehicle Relationship. 'Vehicle Relationship' has lookup relationship with Accunt and Vehicle. Requirement is to open a VF page(VF Page1) by calling a button in the Vehicle screen. And it will display all the relationship it has with customers. In this view customer would like to have 'Radio' button against those relationship records, so that only 1 record can be selected. Once you can click on a button in this VF page 1, it should navigates to another VF page2 and display the relationship records for user confirmation.Both the VF page is using same custom controller. And both VF page is not Using any standard controller. 

Problem i am facing: I configured the functionality using wrapper class. When i am using 'Checkbox' in the first VF page, it is able to correclty navigates to the second page and showing the records in VF page 2. But when i am using the 'Radio' button on VF page 1, after clicking button VF page 2 is not showing any records. When i am selecting the records with Radio button i am passing the paramer to controller. Seems issue in Radio button selection records.

Can you please help me why for Radio buttion i am not able to retrive records in VF page2. I am not giving the code for 'Checkbox' here as it is working fine. Sharing below the codes for 'Radio' button selection.
VFPage1
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <script>
         function myFunction()
         { 
         var i = {!RecordSize};
         var SelectedRecordIdInbox;
         
         for(j=0;j<i;j++)
         {
         
             if(document.getElementsByName("SelectedCustomer")[j].checked)
             {
                SelectedRecordIdInbox = document.getElementsByName("SelectedCustomer")[j].value;
             
             }
         
         }
          PassTheVariableToController(SelectedRecordIdInbox);
        }
        
    </script>
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrp}" var="w">
       
            <apex:column headerValue="Select">
                 <input value="1" Name="SelectedCustomer" type="radio"/>
            </apex:column>
            <apex:column value="{!w.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
         <apex:pageBlockButtons >
             <apex:commandButton value="Select" onclick="myFunction(); return false;"/>
         </apex:pageBlockButtons>
         
          <apex:actionFunction name="PassTheVariableToController" action="{!RedirectSelectedAcc}" rerender="Pb2">
                <apex:param name="P1" value="" assignTo="{!Param1}"/>
          </apex:actionFunction>
          
    </apex:pageBlock>
</apex:form>


</apex:page>
VFPage2
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrpSelected }" var="w1">
            <apex:column value="{!w1.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w1.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w1.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
     </apex:pageBlock>
</apex:form>

</apex:page>
Controller Code:
public class cVehiclesendwrapperRadioButton {

    public List<VehicleSelectCheckbox> LstWrp {get; set;}
    public List<VehicleSelectCheckbox> LstWrpSelected {get; set;}
    public string VehId {get; set;}
    public integer RecordSize {get; set;}
    public integer Param1 {get; set;}
    
    public cVehiclesendwrapperRadioButton()
    {
        LstWrp= new List<VehicleSelectCheckbox>();
        LstWrpSelected = new List<VehicleSelectCheckbox>();
        VehId = ApexPages.currentPage().getParameters().get('id');

        List<Vehicle_Relationship__c> VRQuery = new List<Vehicle_Relationship__c>([SELECT Id,Name,OwnerId,Vehicles__c, customer__c, 
                                                                                   customer__r.Id, customer__r.Name, Vehicles__r.Id, Vehicles__r.Name
                                                                                    FROM Vehicle_Relationship__c WHERE Vehicles__c =:VehId]);
        for(integer i=0;i<VRQuery.size();i++)
        {
        
           LstWrp.add(new VehicleSelectCheckbox(VRQuery[i]));
        
        }     
        
        RecordSize= LstWrp.size();                                                                   
    
    }
    
    public Pagereference RedirectSelectedAcc()
    {
        LstWrpSelected = new List<VehicleSelectCheckbox>();
       
        for(VehicleSelectCheckbox wrp:LstWrp)
        {
            if(Param1==1)
            {
                LstWrpSelected.add(wrp);
        
            }
            
          }
        
        PageReference P=Page.VehiclesendwrapperRadioButtonView;
        P.setredirect(true);
        return P;
    }
    
    
    //----Wreapper Class Started----
    
    public class VehicleSelectCheckbox
    {
    
        public boolean RadioButton {get; set;}
        public Vehicle_Relationship__c VehicleRelation {get; set;}
        
        
        public VehicleSelectCheckbox()
        {
        
        }
        
         public VehicleSelectCheckbox(boolean b, Vehicle_Relationship__c VR)
        {
            this.RadioButton=b;
            this.VehicleRelation=VR;
        }
        
        
         public VehicleSelectCheckbox(Vehicle_Relationship__c VR)
        {
            this.RadioButton=false;
            this.VehicleRelation=VR;
        }
    
    }
     //End of wrapper class

}


 
Appreciate if someone can help, as i am struggling to resolve the issue for last 3 days.
Requirement: In our application there is a custom Object created name 'Vehicle'. There is another junction object named Vehicle Relationship. 'Vehicle Relationship' has lookup relationship with Accunt and Vehicle. Requirement is to open a VF page(VF Page1) by calling a button in the Vehicle screen. And it will display all the relationship it has with customers. In this view customer would like to have 'Radio' button against those relationship records, so that only 1 record can be selected. Once you can click on a button in this VF page 1, it should navigates to another VF page2 and display the relationship records for user confirmation.Both the VF page is using same custom controller. And both VF page is not Using any standard controller. 

Problem i am facing: I configured the functionality using wrapper class. When i am using 'Checkbox' in the first VF page, it is able to correclty navigates to the second page and showing the records in VF page 2. But when i am using the 'Radio' button on VF page 1, after clicking button VF page 2 is not showing any records. When i am selecting the records with Radio button i am passing the paramer to controller. Seems issue in Radio button selection records.

Can you please help me why for Radio buttion i am not able to retrive records in VF page2. I am not giving the code for 'Checkbox' here as it is working fine. Sharing below the codes for 'Radio' button selection.
VFPage1
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <script>
         function myFunction()
         { 
         var i = {!RecordSize};
         var SelectedRecordIdInbox;
         
         for(j=0;j<i;j++)
         {
         
             if(document.getElementsByName("SelectedCustomer")[j].checked)
             {
                SelectedRecordIdInbox = document.getElementsByName("SelectedCustomer")[j].value;
                
             }
         
         }
          PassTheVariableToController(SelectedRecordIdInbox);
        }
        
    </script>
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrp}" var="w">
       
            <apex:column headerValue="Select">
                 <input value="1" Name="SelectedCustomer" type="radio"/>
            </apex:column>
            <apex:column value="{!w.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
         <apex:pageBlockButtons >
             <apex:commandButton value="Select" onclick="myFunction(); return false;"/>
         </apex:pageBlockButtons>
         
          <apex:actionFunction name="PassTheVariableToController" action="{!RedirectSelectedAcc}" rerender="Pb2">
                <apex:param name="P1" value="" assignTo="{!Param1}"/>
          </apex:actionFunction>
          
    </apex:pageBlock>
</apex:form>


</apex:page>
VFPage2
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrpSelected }" var="w1">
            <apex:column value="{!w1.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w1.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w1.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
     </apex:pageBlock>
</apex:form>

</apex:page>
Controller Code:
public class cVehiclesendwrapperRadioButton {

    public List<VehicleSelectCheckbox> LstWrp {get; set;}
    public List<VehicleSelectCheckbox> LstWrpSelected {get; set;}
    public string VehId {get; set;}
    public integer RecordSize {get; set;}
    public integer Param1 {get; set;}
    
    public cVehiclesendwrapperRadioButton()
    {
        LstWrp= new List<VehicleSelectCheckbox>();
        LstWrpSelected = new List<VehicleSelectCheckbox>();
        VehId = ApexPages.currentPage().getParameters().get('id');

        List<Vehicle_Relationship__c> VRQuery = new List<Vehicle_Relationship__c>([SELECT Id,Name,OwnerId,Vehicles__c, customer__c, 
                                                                                   customer__r.Id, customer__r.Name, Vehicles__r.Id, Vehicles__r.Name
                                                                                    FROM Vehicle_Relationship__c WHERE Vehicles__c =:VehId]);
        for(integer i=0;i<VRQuery.size();i++)
        {
        
           LstWrp.add(new VehicleSelectCheckbox(VRQuery[i]));
        
        }     
        
        RecordSize= LstWrp.size();                                                                   
    
    }
    
    public Pagereference RedirectSelectedAcc()
    {
        LstWrpSelected = new List<VehicleSelectCheckbox>();
       
        for(VehicleSelectCheckbox wrp:LstWrp)
        {
            if(Param1==1)
            {
                LstWrpSelected.add(wrp);
        
            }
            
          }
        
        PageReference P=Page.VehiclesendwrapperRadioButtonView;
        P.setredirect(true);
        return P;
    }
    
    
    //----Wreapper Class Started----
    
    public class VehicleSelectCheckbox
    {
    
        public boolean RadioButton {get; set;}
        public Vehicle_Relationship__c VehicleRelation {get; set;}
        
        
        public VehicleSelectCheckbox()
        {
        
        }
        
         public VehicleSelectCheckbox(boolean b, Vehicle_Relationship__c VR)
        {
            this.RadioButton=b;
            this.VehicleRelation=VR;
        }
        
        
         public VehicleSelectCheckbox(Vehicle_Relationship__c VR)
        {
            this.RadioButton=false;
            this.VehicleRelation=VR;
        }
    
    }
     //End of wrapper class

}

 
Appreciate if someone can help, as i am struggling to resolve the issue for last 3 days.
Requirement: In our application there is a custom Object created name 'Vehicle'. There is another junction object named Vehicle Relationship. 'Vehicle Relationship' has lookup relationship with Accunt and Vehicle. Requirement is to open a VF page(VF Page1) by calling a button in the Vehicle screen. And it will display all the relationship it has with customers. In this view customer would like to have 'Radio' button against those relationship records, so that only 1 record can be selected. Once you can click on a button in this VF page 1, it should navigates to another VF page2 and display the relationship records for user confirmation.Both the VF page is using same custom controller. And both VF page is not Using any standard controller. 

Problem i am facing: I configured the functionality using wrapper class. When i am using 'Checkbox' in the first VF page, it is able to correclty navigates to the second page and showing the records in VF page 2. But when i am using the 'Radio' button on VF page 1, after clicking button VF page 2 is not showing any records. When i am selecting the records with Radio button i am passing the paramer to controller. Seems issue in Radio button selection records.

Can you please help me why for Radio buttion i am not able to retrive records in VF page2. I am not giving the code for 'Checkbox' here as it is working fine. Sharing below the codes for 'Radio' button selection.
VFPage1
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <script>
         function myFunction()
         { 
         var i = {!RecordSize};
         var SelectedRecordIdInbox;
         
         for(j=0;j<i;j++)
         {
         
             if(document.getElementsByName("SelectedCustomer")[j].checked)
             {
                SelectedRecordIdInbox = document.getElementsByName("SelectedCustomer")[j].value;
                
                alert("Alert1:"+SelectedRecordIdInbox);
             
             }
         
         }
          alert("Alert2:"+SelectedRecordIdInbox);
          PassTheVariableToController(SelectedRecordIdInbox);
        }
    
    </script>
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrp}" var="w">
       
            <apex:column headerValue="Select">
                 <input value="1" Name="SelectedCustomer" type="radio"/>
            </apex:column>
            <apex:column value="{!w.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
         <apex:pageBlockButtons >
             <apex:commandButton value="Select" onclick="myFunction(); return false;"/>
         </apex:pageBlockButtons>
         
          <apex:actionFunction name="PassTheVariableToController" action="{!RedirectSelectedAcc}" rerender="Pb2">
                <apex:param name="P1" value="" assignTo="{!Param1}"/>
          </apex:actionFunction>

     </apex:pageBlock>
</apex:form>


</apex:page>
VFPage2
<apex:page controller="cVehiclesendwrapperRadioButton">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!LstWrpSelected }" var="w1">
            <apex:column value="{!w1.VehicleRelation.Name}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.OwnerId}" headerValue="Owner"/>
            <apex:column value="{!w1.VehicleRelation.Vehicles__c}" headerValue="Vehicles"/>
            <apex:column value="{!w1.VehicleRelation.Customer__c}" headerValue="Customer Name"/>
            <apex:column value="{!w1.VehicleRelation.customer__r.Id}" headerValue="Customer Id"/>
         </apex:pageBlockTable>
     </apex:pageBlock>
</apex:form>

</apex:page>
Controller Code:
public class cVehiclesendwrapperRadioButton {

    public List<VehicleSelectCheckbox> LstWrp {get; set;}
    public List<VehicleSelectCheckbox> LstWrpSelected {get; set;}
    public string VehId {get; set;}
    public integer RecordSize {get; set;}
    public integer Param1 {get; set;}
    
    public cVehiclesendwrapperRadioButton()
    {
        LstWrp= new List<VehicleSelectCheckbox>();
        LstWrpSelected = new List<VehicleSelectCheckbox>();
        VehId = ApexPages.currentPage().getParameters().get('id');

        List<Vehicle_Relationship__c> VRQuery = new List<Vehicle_Relationship__c>([SELECT Id,Name,OwnerId,Vehicles__c, customer__c, 
                                                                                   customer__r.Id, customer__r.Name, Vehicles__r.Id, Vehicles__r.Name
                                                                                    FROM Vehicle_Relationship__c WHERE Vehicles__c =:VehId]);
        for(integer i=0;i<VRQuery.size();i++)
        {
        
           LstWrp.add(new VehicleSelectCheckbox(VRQuery[i]));
        
        }     
        
        RecordSize= LstWrp.size();                                                                   
    
    }
    
    public Pagereference RedirectSelectedAcc()
    {
        LstWrpSelected = new List<VehicleSelectCheckbox>();
       
        for(VehicleSelectCheckbox wrp:LstWrp)
        {
            if(Param1==1)
            {
                LstWrpSelected.add(wrp);
        
            }
            
          }
        
        PageReference P=Page.VehiclesendwrapperRadioButtonView;
        P.setredirect(true);
        return P;
    }
    
    
    //----Wreapper Class Started----
    
    public class VehicleSelectCheckbox
    {
    
        public boolean RadioButton {get; set;}
        public Vehicle_Relationship__c VehicleRelation {get; set;}
        
        
        public VehicleSelectCheckbox()
        {
        
        }
        
         public VehicleSelectCheckbox(boolean b, Vehicle_Relationship__c VR)
        {
            this.RadioButton=b;
            this.VehicleRelation=VR;
        }
        
        
         public VehicleSelectCheckbox(Vehicle_Relationship__c VR)
        {
            this.RadioButton=false;
            this.VehicleRelation=VR;
        }
    
    }
     //End of wrapper class

}



 
I would like to know the best design to pass the session id and calling the external custom webservice methods.
I will site the example with two SFDC Org, Org1 and Org2.

Requirement is when an account in Org1 will be created it will call some custom WS method of Org 2 and will insert the record in to Org2.
I have taken a simple example, will consider that integration is not possible with REST services or in any other way.
Please give your comment only what is feasible for calling custom webservice methods.

To achieve this requirement below tasks have been completed,

1. I have imported below WSDLs in Org1:
      a. The WSDL of the Org2 for the web service with custom method, to call the custom method from Org 1. Lets call it wsdl1
      b. The partner WSDL of Org 2, to call the Login() API to get the Session Id. Lets call it wsdl2
2. Created a wrapper Class in Org 1, and within that wrapper class i have instanciated the stub of wsdl2 and passed hardcoded username and password to get the 'Session Id'. Then I instanciated the stub of wsdl1, add the session Id in to its header and then called the customed method

My questions:
1. Is it the standard/best design to call any external custom webservice methos, as i need to import two WSDL here. What is the other way to get and pass the session Id in single wsdl.
 2.If any other system like SAP would like to call salesforce custom webservice method then will they need to consume two WSDLs from salesforce? one is the partner wsdl and the other is the custom WS wsdl.
 3. If salesforce would like to talk with external system, will it also need two wsdls from external system.
Hi Everyone,

I am doing the challenge Get Started with Hybrid Development, step "Create a Hybrid App". I am not able to complete the challenge and getting one error, sharing the details below:   Steps i have completed in Windows environment: 1. Installed JDK 2. Installed Android Studio 2 3. Installed Android SDK from Android Studio 2 4. Installed Android Virtual Device (AVD) from within Android Studio. 5. Created a Connected App 6. Installed Node.js and npm 7. Installed Cordova by command npm -g install cordova 8. Ran command npm install -g forcedroid, which after running shows version as -- forcedroid@4.1.2 9. When i am trying to create a Hybrid App, with command:      forcedroid create, with parameters Application type, Application            name, Target directory and Package name. Command prompt shows          below details:      You have been opted out of telemetry. To change this, run: cordova     telemetry on.6.2.0 ". Should be in the format x[.y[.ignored]] You have     been opted out of telemetry. To change this, run: cordova telemetry     on.6.2.0 ) is less than the minimum required version (5.4.0).  Please     update your version of Cordova.   Can you please help me how to proceed next?