• Rangeshwara Kona
  • NEWBIE
  • 75 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
Hello Everyone,

I'm attempting to create a VF page/component that will give me a case history so to speak. When a user creates a case I'd like a history of cases created by that user for any record type to appear in a case history list. Any ideas on how I can acheive this. I'm completely new to SF and Apex.
1) A developer created a Visualforce page that has a custom controller that navigates to an external website after the'
command button is pressed. What is the recommended way to test this functionality? 
A. Use .getURL() on the result of the action method and System.assertEquals () to compare the resulting URL.
B. ‘ Use ApexPages.currentPage () .getUrl () and System.assertElquals () to compare the end URL.
C. ‘ Use Test.getCurrentPage() .getUrl () and System.assertEquals () to compare the end URL.
D. Test the navigation by executing the use case through the browser and manually inspecting the resulting URL.

2) What is the output of the following code snippet?
Contact con = new Contact( LastName = 'JOHNSON', LeadSource = 'Web')
Savepoint sp = Database.setSavepoint();
insert con;
Database.rollback(sp);
con.LeadSource = 'Email'
insert con;
Error is at line 6(last) - > Can not specify id in an insert call
A. A runtime error will be thrown on line 5.
B. The contact record will be inserted with Leadsource value Web.
C. A runtime error will be thrown on line 8.
D. The contact record will be inserted with Leadsource value Email.

3) A company has 20,000 rows in the Account object and 2 million rows in the Sales_Data_c object that is related to Account. All
of the records in the Sales_Data_c object have a field that contains the string 'Le.‘ Which statement will throw a "Too many query
rows" exception? Choose 2 answers 
A. List<List<SObject>> result= [FIND 'Le' IN ALL FIELDS RETURNING Sales_Data_c(Id)];
B. List<Account> result = [SELECT Id, (SELECT Id FROM Sales_Data_r) FROM Account]
C. List<sObject> result = Database.query('SELECT Id FROM Sales_Data_c LIMIT 50000');
D, List<AggregateResult> result = [SELECT count(Id) total FROM Sales_Data_c];

4) What is the output of the following code snippet?
Contact con = new Contact( LastName = 'Smith', Department = 'Admin')
insert con;
Savepoint sp_finance = Database.set5avepoint();
con.Department = 'finance';
update con;
SavepOLnt sp_hr = Database.set5avepo1nt();
con.Department = 'HR';
update con;
Database.rollback(3p_flnance);
Database.rollback(3p_hr); = Error
A. The contact record will be saved ME department value HR.
B. A runtime error will be thrown on line 12.
C. A runtime error will be thrown on line 13.
D. The contact record will be saved with department value Finance

5) What is a limitation of compound fields? 
A. Are read-only unless accessed by Location and Address Apex classes.
B. Can only be updated through individual field components.
C. Are read-only when accessed through Visualforce pages.
D. Cannot be queried through the use of Apex classes.

6) A developer has created a solution using the SOAP API for authenticating Communities users. What is needed when issuing
the login()Call? Choose 2 answers 
A. Organization Id
B. Security Token
C. Session Id
D. Username and Password

7) Given the following code sample, what is a potential issue regarding bulk processing of records?
trigger accountTestTrggr on Account (before insert, before update)
Account acct = Trigger.new[0];
List <Contact> contacts = new List <Contact> ([select id, salutation, firstname, lastname,
email from Contact where accountId = :acct.Id]);
for (Contact con: contacts)
con.Title = 'Not Selected';
update contacts; 
A. The code will not execute because the record in the list can be null and cause an exception.
B. The code will process one record that is called explicitly per execution.
C. The code will not execute because the list can be null and cause an exception.
D. The code will have to be invoked multiple times to process all the records.

8) A company requires that a child custom record is created when an Order record is inserted. The company's administrator
must be able to make changes to the solution.
What is the recommended solution for implementing this requirement? 
A. Create a Visual Workflow that will create the custom child record when the Order is inserted.
B. Create a Force.com Workflow Rule to create the custom child record when the Order is inserted.
C. Create an Apex Trigger to create the custom child record when the Order is inserted.
D. Create a Lightning Process to create the custom child record when the Order is inserted

9) What is a best practice when unit testing a controller? Choose 2 answers 
A. Simulate user interaction by leveraging Test.setMock().
B. Verify correct page references by using getURL()
C. Access test data by using seeAllData=true.
D. Set query parameters by using getParameters () .put

10) What is a consideration when testing batch Apex? 
Choose 2 answers
A. Test methods must execute the batch with a scope size of less than 200 records.
B. Test methods must call the batch execute () method once.
C. Test methods must use the @isTest (SeeAllData=true) annotation.
D. Test methods must run the batch between Test. startTest () and Test.stopTest

11) Which statement is true about using ConnectApi namespace (also called Chatter in Apex)?
Choose 2 answers 
A. Chatter in Apex methods honor the 'with sharing' and 'without sharing' keywords.
B. Chatter in Apex operations are synchronous, and they occur immediately.
C. Chatter in Apex methods do not run in system mode; they run in the context of the current user.
D. Many test methods related to Chatter in Apex require the BIsTest (SeeAllData=true) annotation.

12) A developer is writing unit tests for the following method:
public static Boolean isFreezing(String celsiusTemp)
if(String.isNotBlank(celsiusTemp) && celsiusTemp.isNumeric())
return Decimal.valueof(celsiusTemp) <= 0;
return null;
Which assertion would be used in a negative test case? 
A_System.assertEquals(true, isFreezing(null));
B. System. assertEquals (true, isFreezing( ' 0’);
C System.assertEquals(null, isFreezing('asdf'));
D.System.assertEquals(true, isFreezing('lOO'));

13) A company wants to create a dynamic survey that navigates users through a different series of questions based on
their previous responses.
What is the recommended solution to meet this requirement? 
A. Dynamic Record Choice
B. Lightning Process Builder
C. Visualforce and Apex
D. Custom Lightning application

14) Which statement is true regarding both Flow and Lightning Process?
A. Can use Apex methods with the @InvocableMethod annotation.
B. Are both server-side considerations in the Order of Execution.
C. Can use Apex that implements the Process. Plugin interface.
D. Are able to be embedded directly into Visualforce pages.

15) A developer writes the following code:
public with sharing class OrderController
public PaqeReference sendOrder()
Order__c order = new Order__c
insert order;
ExternalOrder externalOrder = new ExternalOrder(order);
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('https://www.example.org/v1/orders');
req.setMethod('POST');
req.setBody(JSON.serialize(externalOrder));
HttpResponse res = h.send(req);
order = (ExternalOrder)JSON.deserialize(res.getBody(), ExternalOrder.class);
While testing the code, the developer receives the followmg error message:
System.CalloutException : You have uncommitted work pending
What should the developer do? 
Choose 2 answers
A. Use the asyncSend() method of the HTTP class to send the request in async context.
B. Ensure all callouts are completed prior to executing DML statements.
C. Move the web service callout into an @future method.
D. Use Database.insert (order, true) to immediately commit any database changes.
Hi, 
We have custom attachment which attach the files to BOX (using REST API) and rendering attachment from there when the user clicks on "View" link. But the following functionolity works on PDF and image files, they are directly opening on next tab/window but when we click on Docs or CSV, the file is downloading direclty rather opening  on new page. Please someone give me clues on this? see the following code snippet.
Apex Code: 
public String fileOpen(){
     HttpRequest req = new HttpRequest();
     req.setEndpoint(fileDownloadURL);
     req.setMethod('GET');
     Http binding = new Http();
     HttpResponse res = binding.send(req);
     Blob boxFile = res.getBodyAsBlob();
     String boxResponse = 'data:'+res.getHeader('Content-Type')+';base64,'+EncodingUtil.base64Encode(boxFile );
     return boxResponse ;
}
VisualForce Page:
<apex:page controller="BoxController" action="{!fileOpen}">
    <apex:form >
        <apex:outputText escape="false" value="{!boxResponse}"/> 
    </apex:form>
</apex:page>

Please help me on rendering doc/csv files on page rather downloading.. 

Appreciate your help..
Sumant K
 
Hello Everyone,

I'm attempting to create a VF page/component that will give me a case history so to speak. When a user creates a case I'd like a history of cases created by that user for any record type to appear in a case history list. Any ideas on how I can acheive this. I'm completely new to SF and Apex.
I have a developer account.  Trying to follow the trailhead course here: https://developer.salesforce.com/trailhead/mobile_sdk_native_ios/mobilesdk_ios_getting_started

The very first step is to create a connected app inside salesforce.  I follow the instructions, but there is no new button - see attached screenshot.

User-added image

Its no different in the new lightening experience.

Since I cannot raise a case this means I am stumped - before I can even evaluate use of salesforce.  

What am I doing wrong here ?

Thanks
Hello,

This is the trailhead questions which I am trying to solve :

Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.


Here is my code :

public class StringArrayTest {
    public static List <String> generateStringArray (Integer n) {
       List<String> List1 = new List<String> ();
        for(Integer i=0;i<n;i++) {
          List1.add('\'Test'+ i+'\'' );
  }
        System.debug(List1);
        return List1;
    } 

}


I am getting following error :

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.


I tried it many times but I am not able to solve this problem. Please help. 



 

Hello sfdc experts and guru's

 

2 Questions from my end:--

 

1)  I looked at videos of informatica cloud and have seen that we can establish a connection(data sync) between  oracle server and salesforce .if i make a change in salesforce data  that change will be in sync with oracle server ( this is ok) .now if some other user of oracle server who hasnt installed informatica cloud makes change to the same oracle database table. will this change be reflected

 

2) I would love to get a step by step process on how to integrate salesforce with Informatica without using informatica cloud. Someone pls help regarding this.

 

Thanks

kartik