• Ajay Ranawat
  • NEWBIE
  • 99 Points
  • Member since 2014
  • Technical Consultant
  • Make Positive


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 10
    Replies
Good afternoon,
I can't seem to figure out why my class for the "Getting Started with Apex: Unit 1" won't pass evaluation.  The class appears to work as expected when I run via the Execute Anonymous window, but the checker fails.

Here is my class:

public class StringArrayTest{
    public static void generateStringArray(integer q){
        list<string> test = new list<string>();
            for(integer i=0; i < q;i++){
            test.add('Test '+i);
            system.debug(test[i]);
        }
    }
}

When I run StringArrayTest.generateStringArray(9); in the EAW, I get the return I expected.
Thoughts?

I have to test cover this line: 
ConnectApi.FeedItemPage items = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(null, ConnectApi.FeedType.News, 'me');
Here is my test class:

@isTest private class NewsFeedClassTest {
@IsTest static void doTest() {
// Build a simple feed item
ConnectApi.FeedItemPage testPage = new ConnectApi.FeedItemPage();
List<ConnectApi.FeedItem> testItemList = new List<ConnectApi.FeedItem>();
testItemList.add(new ConnectApi.FeedItem());
testItemList.add(new ConnectApi.FeedItem());
testPage.items = testItemList;
}
}

This works fine with Version 30, but whenever I change to version 34 of apex it givers deprecated property error, any one knows how to test cover the following lines of code??

Thanks & Regards,

Ajay

Is lightning components available on Sandbox of Enterpirse Org? or it's just Developer Edition for now?

While developing VF page for Salesforce 1, I need Datepicker so that user can select specific date.

My Code using following scripts-> 

<meta name="viewport" content="width=device-width, initial-scale=1" /> 
        <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/>
        <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
        <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
        <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
        <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"/> 

and then used either of these input tags:

<input type="date" id="date_val" data-role="date"/>
<!--    <input type="date" name="date" id="date" value=""  />  -->

in both cases when clicked on <input> it doesn't shows any datebox popup for user to select.

User-added image

whereas I want when clicked on this <input> it should be like->

User-added image

I am creating Simple Jquery Mobile Page:


<apex:page showHeader="false" sidebar="false" standardStyleSheets="false">
<html>
    <head>
    <title>My Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<div data-role="page"
    <div data-role="header">
        <h1>My Title</h1>
    </div>
    <div data-role="content">  
           <ul data-role="listview" data-inset="true" data-filter="true">
          <li><a href="#">Acura</a></li>
          <li><a href="#">Audi</a></li>
          <li><a href="#">BMW</a></li>
          <li><a href="#">Cadillac</a></li>
          </ul>
    </div>
</div> 
</body>
</html>
</apex:page>

 

but still page doesn't take these CDN library.

and page shows as such->

User-added image

Why is Mobile Look and feel not attained here?

I Want to create a VF page for Salesforce1. I am planning to do so using components of lightning.


Is that possible? I had hands on with DEV Org earlier and succeded with it, but now I have to work on sandbox, here I don't know how to proceed further as I can see lightning component under setup but can't see other lightning tabs.

Please help me by giving steps how to create lightning component in Sandbox org.
I Want to create a VF page for Salesforce1. I am planning to do so using components of lightning.


Is that possible? I had hands on with DEV Org earlier and succeded with it, but now I have to work on sandbox, here I don't know how to proceed further as I can see lightning component under setup but can't see other lightning tabs.

Please help me by giving steps how to create lightning component in Sandbox org.

I have performed following steps:

1) Sign up a new Developer Edition.

2) Created a Unique Namespace under Setup | Create | Packages and saved it.

But now am looking for Lightning Component Checkbox under develop, but couldn't find it. :(

Anyone facing same issue?

Hi,

Am trying to create Line Chart but its not populating anything on VF page.

VF:

<apex:page controller="ChartController" showHeader="false" sidebar="false">
<apex:chart height="400" width="700" data="{!Data}">
<apex:axis type="Numeric" fields="data1" grid="true" title="No. of Opportunities" position="left"  />
<apex:axis type="Category"  fields="name"   grid="true" title="Months"  position="bottom" />
<apex:lineSeries title="abcd" axis="left" xField="name" yField="data1" fill="true"  markerSize="4" markerFill="blue" markerType="cross"/>
</apex:chart>
</apex:page>

Class:
public with sharing class ChartController {
public static List<Data> getData() {
    return ChartController.getChartData();
    }
   
    @RemoteAction
    public static List<Data> getRemoteData() {
        return ChartController.getChartData();
    }
     public static List<Data> getChartData() {
        List<Data> data =new List<Data>();
        data.add(new data('jan',10,20));
        data.add(new data('feb',50,10));
        data.add(new data('march',20,40));
        data.add(new data('june',30,30));
        data.add(new data('april',60,10));
        return data;
    }
   
    public class Data    {
        public String Name{get; set;}
        public Integer data1{get; set;}
        public Integer data2{get; set;}
        public Data(String name, Integer data1, Integer data2)        {
            this.name= name;
            this.data1= data1;
            this.data2= data2;
        }
    }
}
 

While developing VF page for Salesforce 1, I need Datepicker so that user can select specific date.

My Code using following scripts-> 

<meta name="viewport" content="width=device-width, initial-scale=1" /> 
        <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/>
        <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
        <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
        <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
        <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"/> 

and then used either of these input tags:

<input type="date" id="date_val" data-role="date"/>
<!--    <input type="date" name="date" id="date" value=""  />  -->

in both cases when clicked on <input> it doesn't shows any datebox popup for user to select.

User-added image

whereas I want when clicked on this <input> it should be like->

User-added image

Hi,

this is Class:

public with sharing class ideaExtension {
Private final Idea idea;
public ideaExtension(ApexPages.StandardController stdController) {
this.idea = (Idea)stdController.getRecord();
}

}


This is Page:

<apex:page standardController="idea">
<apex:form >
<apex:pageBlock title="New Idea">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Idea Details" columns="1">
<apex:inputField style="width:250px" value="{!idea.title}"/>
<apex:inputField required="true" style="width:600px" value="{!idea.body}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


When I click on Idea object,i still see the Old Idea Page layout. How do it enforce this page?

thanks,
Richa

I am creating Simple Jquery Mobile Page:


<apex:page showHeader="false" sidebar="false" standardStyleSheets="false">
<html>
    <head>
    <title>My Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<div data-role="page"
    <div data-role="header">
        <h1>My Title</h1>
    </div>
    <div data-role="content">  
           <ul data-role="listview" data-inset="true" data-filter="true">
          <li><a href="#">Acura</a></li>
          <li><a href="#">Audi</a></li>
          <li><a href="#">BMW</a></li>
          <li><a href="#">Cadillac</a></li>
          </ul>
    </div>
</div> 
</body>
</html>
</apex:page>

 

but still page doesn't take these CDN library.

and page shows as such->

User-added image

Why is Mobile Look and feel not attained here?

I Want to create a VF page for Salesforce1. I am planning to do so using components of lightning.


Is that possible? I had hands on with DEV Org earlier and succeded with it, but now I have to work on sandbox, here I don't know how to proceed further as I can see lightning component under setup but can't see other lightning tabs.

Please help me by giving steps how to create lightning component in Sandbox org.
Good afternoon,
I can't seem to figure out why my class for the "Getting Started with Apex: Unit 1" won't pass evaluation.  The class appears to work as expected when I run via the Execute Anonymous window, but the checker fails.

Here is my class:

public class StringArrayTest{
    public static void generateStringArray(integer q){
        list<string> test = new list<string>();
            for(integer i=0; i < q;i++){
            test.add('Test '+i);
            system.debug(test[i]);
        }
    }
}

When I run StringArrayTest.generateStringArray(9); in the EAW, I get the return I expected.
Thoughts?
Hi All,

I'm trying to get an array of strings returned based on Integer n, but seem to keep getting a value instead of a string.  What do I need to adjust?  Thanks!

public class StringArrayTest {
    public void generateStringArray(){
        List<String>stringArray = new List<String>{};
        Integer n = 4;
        for(Integer i=n;i<stringArray.size();i++){
            String myInt = n.format();
            stringArray.add('Test' + myInt);
        }
         return stringArray;  
    }
}

I have performed following steps:

1) Sign up a new Developer Edition.

2) Created a Unique Namespace under Setup | Create | Packages and saved it.

But now am looking for Lightning Component Checkbox under develop, but couldn't find it. :(

Anyone facing same issue?