Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce DEX-450 Exam - Topic 9 Question 16 Discussion

Posted by Melodie on May 03, 2022 at 04:00 PM

A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id = :apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?

Suggested Answer: A

Get Premium DEX-450 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
11 comments · newest first
LA
Laurene 12 months ago
Converting to String doesn't make sense here, that's not the issue.
TH
Theodora 12 months ago
Surprised this isn't working already, seems like a simple fix!
MI
Mila 12 months ago
I thought changing theAccount to public would work too.
ET
Ettie 1 year ago
Totally agree, that's the way to fix it!
MA
Martha 1 year ago
A needs a getter method for actType.
AN
Annette 1 year ago
Adding with sharing (option D) could affect data visibility, but I don't think it would solve the display issue directly. I might lean towards option A.
IN
In 1 year ago
I feel like converting theAccount.Type to a String (option C) isn't necessary since it's already a String type. That seems off to me.
RY
Ryann 1 year ago
I'm not entirely sure, but I think making theAccount public (option B) might expose it, which isn't always a good practice.
MA
Marquetta 1 year ago
I remember we discussed that if a variable is not being displayed, it might be due to not having a proper getter method. So, option A sounds plausible.
RO
Rosalind 1 year ago
I'm a bit confused on this one. Is it B - Supply Chain Management (SCM)? Or is that a different module? I'll have to double-check my understanding.
HE
Herminia 1 year ago
Okay, let's see. The interviewing method is typically used when you need to gather requirements directly from stakeholders, especially when there are communication challenges or time constraints. I think option C is the best fit here.
0/2000 characters

Save Cancel