• Pratik Pawar
  • NEWBIE
  • 30 Points
  • Member since 2016
  • SFDC CPQ Specialist/Developer


  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
I'm writing a Test Class where I need to create a Test Data for Article Vote. 

I've created KnowledgeArticle Record and Vote record by Passing ParentId and Type='Up' but I'm unable to get the knowledge__VoteStat record. 

Need a urgent help. Thanks in Advance. 
I am completing MOBILE SDK NATIVE APP TRAILHEAD COURSE( https://trailhead.salesforce.com/modules/mobile_sdk_native_android/units/mobilesdk_android_getting_started)
but I'm getting stuck while building cloned repo using Android studio.

Error occured into build.graddle file: 
Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.

First few lines of code are pasted below:
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

dependencies {
  compile project(':libs:SmartStore')
}

android {
  compileSdkVersion 25
  buildToolsVersion '23.0.1'

  buildTypes {
      debug {
         testCoverageEnabled = true
      }
  }

Please help me to resolve this issue.
Hi,

I am a Trainee in VF development. Stucked in between one assignement. Please suggest me solution to fulfill below requirement. 

Requriment: User should be able to select an Account, based on the selected Account, show Account’s Name, Industry and Type in new section.
 
<apex:page controller="AccountDetails">

<script type="text/javascript">
    function getRemoteAccount(){
        alert(document.getElementById("form1.accName"));//Unable to access selected value
    }

</script>
 <apex:form id="form1">
 <apex:pageblock >
     <apex:pageblockSection >
         <apex:inputField value="{!acc.AccountId}" id="accName" onchange="getRemoteAccount()"/>
     </apex:pageblockSection>
     <apex:pageBlockSection >
     <span id="span1" />
     </apex:pageBlockSection>
 </apex:pageblock>
 </apex:form>
</apex:page>
 
/************Controller*********************/

public class AccountDetails {

    public contact acc { get; set; }
}

 
Hello,

I have two custom picklist on Account with respective values:
First Picklist
Bussiness Segment: VALUES{PACS, IA, SI}
&
Second Picklist 
Applications : VALUES{ PACS-1, PACS-2, PACS-3, IA-1, IA-2, IA-3,} (No values for Segment SI)

Requirement :
Create VF page which will allow user to select Business segment and show available “Applications” based on the Business Segment using JavaScript.
Also, when no application is available for selected Business segment, then show alert message “Applications not available for business segment: Business Segment name” using JavaScript.

NOTE: Don't want to use any Extension or Custom controller. i.e. need to perform using JavaScript only.

First question: Is it possible through JS only?
Second question: what need to change in below JS code?

Currently, Second Picklist is not re-rendering. 

Please help in this issue.


************************************VF PAGE**********************************************
<apex:page standardController="Account">
<script type="text/javascript">
    function displayChildPickValues(selectPick){
        var pickValue = selectPick.options[selectPick.selectedIndex].value;
        if(pickValue == 'SI')alert('Applications not available for business segment: '+pickValue);
        if(pickValue == 'PACS'){
                   for(var x in document.getElementsByClassName("second")[0].options){
                   var m = document.getElementsByClassName("second")[0].options[x].value;
                   if(!m.startsWith("P")){
                   if(!document.getElementsByClassName("second")[0].options[x].hasAttribute("style"))         
                   document.getElementsByClassName("second")[0].options[x].setAttribute("style","hidden:true;");
                  }//End of IF
                }//End of For
        
    }//End of IF
    
    secondPickFun(); //Calling actionFunction
    
 }//End of javascript function
</script>
  <apex:form >
      <apex:pageblock >
          <apex:pageblockSection >
                 <apex:inputField value="{!Account.Name}"/>
                 <apex:inputField value="{!Account.Business_Segment__c}" onchange="displayChildPickValues(this)">
                  <apex:actionFunction reRender="appPick" name="secondPickFun"/> 
                 </apex:inputField> 
                 <apex:inputField value="{!Account.Applications__c}" Styleclass="second" id="appPick"/> 
          </apex:pageblockSection>
      </apex:pageblock>
  </apex:form>
</apex:page>
 
Any clue on error.

/*********************************************VF Page*****************************************/
<apex:page standardController="Account" extensions="getSingleRelatedList">
    <apex:form >
        <apex:detail relatedList="false"/>
            <apex:selectList value="{!selectString }" multiselect="false" size="1">
              <b>Record Type :</b>  <apex:selectoptions value="{!Items}"/>
              <apex:actionSupport event="onchange" action="{!ClientRelatedList}" rerender="conList"/>
            </apex:selectList> <br/> <br/>
    </apex:form>
        <apex:relatedList list="Contacts" title="Employee Contacts" id="conList">
            <apex:facet name="body">
                <apex:pageBlock id="pageBlock">
                    <apex:pageBlockTable value="{!listContactClientRecT}" var="con">
                        <apex:column headerValue="Name">
                            <apex:outputLink value="/{!con.Id}">{!con.FirstName} {!con.LastName}</apex:outputLink>
                        </apex:column>
                    </apex:pageBlockTable>
            </apex:pageBlock>
           </apex:facet>
        </apex:relatedList>
</apex:page>


/**********************************Controller****************************************/

public class getSingleRelatedList {
     public List<Contact> listContactClientRecT{get; set;}
     public List<String>  listRecordType {get; set;}
     public String selectString {get; set;}
     public ID accId {set; get;}
     
     public getSingleRelatedList(ApexPages.StandardController controller) {
        listRecordType = new List<String>();
        listContactClientRecT = new List<Contact>();
        accId = controller.getId();
     }
    
    public pageReference getClientRelatedList(){
        listContactClientRecT  = [Select Id,FirstName,LastName, RecordTypeId from Contact where RecordTypeId =:selectString];  
    }
    
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        List<Contact> listContactRecTypeId =[Select RecordTypeId from contact where AccountId =: accId]; 
        Set<ID> rectypeID = new Set<ID>();
        for(Contact objContact : listContactRecTypeId ){
            rectypeID.add(objContact.RecordTypeId);
        }
        
        
        if(listContactRecTypeId!=Null && !listContactRecTypeId.isEmpty())
        for(ID objContact: rectypeID){
            options.add(new SelectOption(objContact,objContact));
        }  
          return options;
    }
   
}
I am completing MOBILE SDK NATIVE APP TRAILHEAD COURSE( https://trailhead.salesforce.com/modules/mobile_sdk_native_android/units/mobilesdk_android_getting_started)
but I'm getting stuck while building cloned repo using Android studio.

Error occured into build.graddle file: 
Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.

First few lines of code are pasted below:
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

dependencies {
  compile project(':libs:SmartStore')
}

android {
  compileSdkVersion 25
  buildToolsVersion '23.0.1'

  buildTypes {
      debug {
         testCoverageEnabled = true
      }
  }

Please help me to resolve this issue.
Hi,

I am a Trainee in VF development. Stucked in between one assignement. Please suggest me solution to fulfill below requirement. 

Requriment: User should be able to select an Account, based on the selected Account, show Account’s Name, Industry and Type in new section.
 
<apex:page controller="AccountDetails">

<script type="text/javascript">
    function getRemoteAccount(){
        alert(document.getElementById("form1.accName"));//Unable to access selected value
    }

</script>
 <apex:form id="form1">
 <apex:pageblock >
     <apex:pageblockSection >
         <apex:inputField value="{!acc.AccountId}" id="accName" onchange="getRemoteAccount()"/>
     </apex:pageblockSection>
     <apex:pageBlockSection >
     <span id="span1" />
     </apex:pageBlockSection>
 </apex:pageblock>
 </apex:form>
</apex:page>
 
/************Controller*********************/

public class AccountDetails {

    public contact acc { get; set; }
}

 
Hello,

I have two custom picklist on Account with respective values:
First Picklist
Bussiness Segment: VALUES{PACS, IA, SI}
&
Second Picklist 
Applications : VALUES{ PACS-1, PACS-2, PACS-3, IA-1, IA-2, IA-3,} (No values for Segment SI)

Requirement :
Create VF page which will allow user to select Business segment and show available “Applications” based on the Business Segment using JavaScript.
Also, when no application is available for selected Business segment, then show alert message “Applications not available for business segment: Business Segment name” using JavaScript.

NOTE: Don't want to use any Extension or Custom controller. i.e. need to perform using JavaScript only.

First question: Is it possible through JS only?
Second question: what need to change in below JS code?

Currently, Second Picklist is not re-rendering. 

Please help in this issue.


************************************VF PAGE**********************************************
<apex:page standardController="Account">
<script type="text/javascript">
    function displayChildPickValues(selectPick){
        var pickValue = selectPick.options[selectPick.selectedIndex].value;
        if(pickValue == 'SI')alert('Applications not available for business segment: '+pickValue);
        if(pickValue == 'PACS'){
                   for(var x in document.getElementsByClassName("second")[0].options){
                   var m = document.getElementsByClassName("second")[0].options[x].value;
                   if(!m.startsWith("P")){
                   if(!document.getElementsByClassName("second")[0].options[x].hasAttribute("style"))         
                   document.getElementsByClassName("second")[0].options[x].setAttribute("style","hidden:true;");
                  }//End of IF
                }//End of For
        
    }//End of IF
    
    secondPickFun(); //Calling actionFunction
    
 }//End of javascript function
</script>
  <apex:form >
      <apex:pageblock >
          <apex:pageblockSection >
                 <apex:inputField value="{!Account.Name}"/>
                 <apex:inputField value="{!Account.Business_Segment__c}" onchange="displayChildPickValues(this)">
                  <apex:actionFunction reRender="appPick" name="secondPickFun"/> 
                 </apex:inputField> 
                 <apex:inputField value="{!Account.Applications__c}" Styleclass="second" id="appPick"/> 
          </apex:pageblockSection>
      </apex:pageblock>
  </apex:form>
</apex:page>
 
I'm trying to go through "Trailhead Native Android" and I'm getting stuck in the first chapter on "forcedroid create". the error I'm getting after i enter the output directory and the error even appears when i leave it blank.
error i am getting from the command line is
"forcedroid create failed
Command failed: git clone --branch v5.0.0 --single-branch --depth 1 --recurse-submodules https://github.com/forcedotcom/SalesforceMobileSDK-Templates C:\Users\Owner\Documents\Android project\tmp84510\SalesforceMobileSDK-Templates 
'git' is not recognized as an internal or external command,
operable program or batch file."


 
I'm trying to go through "Trailhead Native Android" and I'm getting stuck in the first chapter on "forcedroid create". the error I'm getting from the command line is
"forcedroid create failed
Command failed: git clone --branch v5.0.0 --single-branch --depth 1 --recurse-submodules https://github.com/forcedotcom/SalesforceMobileSDK-Templates C:\Users\Owner\Documents\Android project\tmp84510\SalesforceMobileSDK-Templates
Too many arguments."