Skip to main content
6 votes
Accepted

Dynamic visualforce table using Map

When you iterate over a map, you're actually getting the key, not the value. That means you need to access the value from record map: <apex:pageBlockTable value="{!leadMap}" var="key" id="...
sfdcfox's user avatar
  • 495k
5 votes

SOQL Query Limits in Wrapper Class (using dlrs)

I guess you are confusing the standard practice with SOQL FOR Loop . SOQL For Loops are allowed, but standard practice is you do not write SOQL inside FOR loop. Like this: For(Contact c: contacts){ ...
Mr.Frodo's user avatar
  • 5,802
4 votes
Accepted

Set Two Different Values for the same field in a vf page via controller extension?

I don't think it would be possible with one instance of task. You need to create two separate instance or need to use a list. public Task OldmyTask {get;set;} public Task NewmyTask ...
Tushar Sharma's user avatar
4 votes
Accepted

Is it possible to use a field set with a custom controller?

It is completely possible: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_field_sets.htm <apex:page standardController="Account"> <apex:repeat value=...
Eric's user avatar
  • 54.2k
4 votes
Accepted

Use input field value from standard controller extension property

Since those are not fields on an sObject you will need to use <apex:inputText value="{!activationID}" /> If those are an Id to another object a trick is to create a property in the controller ...
Eric's user avatar
  • 54.2k
4 votes

SOQL Query Limits in Wrapper Class (using dlrs)

This is a good pattern to use as the query is executed once only and then the results are iterated over: for (OrderItem o: [select ... from ... where ...]) { ... } This query inside a loop is ...
Keith C's user avatar
  • 136k
3 votes
Accepted

Combine apex class for VF pages that use a standard controller and a controller?

You can definitely do this. The key is to have two different constructors - one that accepts the standard controller and one with empty params. Something like: public class ...
Caspar Harmer's user avatar
3 votes
Accepted

Standard controller and extension method with same name

Any extension methods take precedence over controller methods with the same name. Take a look at Building a Controller Extension: Multiple controller extensions can be defined for a single page ...
Adrian Larson's user avatar
  • 150k
3 votes
Accepted

How should I write and structure a good Apex Page Extension Test method?

They ask for one test method to cover the whole extension class and it's methods. When you're asked to do something specific, go ahead and do it, even if it's not your usual thing. As developers, we ...
sfdcfox's user avatar
  • 495k
3 votes
Accepted

Field updating in client but not server

To update a record you need to have Id. cList doesn't have Id. So, use the following logic in your loop and update the records. List<Customer_Product__c> cList = new List<...
Santanu Boral's user avatar
3 votes
Accepted

Get data from apex standardcontroller into extension

I would suggest you also go through a nice blog written by Bob, where he has explained everything about how to get extra fields of record in extension. http://bobbuzzard.blogspot.in/2011/04/dynamic-...
Nitish Singhal's user avatar
3 votes
Accepted

Why do I keep getting a "no viable alternative at character ´´ " error within my test class?

A copy and paste of your test class compiles fine (With one small change) on my end so it is most likely an issue with some character in your editor it does not like Note This line in your code does ...
Eric's user avatar
  • 54.2k
3 votes
Accepted

Problem in reRender of <apex:detail> tag on click of commandbutton

It's look like inlineEdit couldn't be binded with dynamic boolean. Try to create two detail and render them accordingly: <apex:tab label="Details" name="AccDetails" id="tabdetails"> <...
Ilya Lepesh's user avatar
  • 4,125
3 votes
Accepted

What am I doing wrong with my extension?

Following example with ititiate extension with Service_Case__c Record and get one customer public class CustomerExt { public Service_Case__c service {get;set;} private list <Customer__c&...
Ilya Lepesh's user avatar
  • 4,125
3 votes
Accepted

Embedded VF Page Not Responding To StandardController

If you are extending a standard controller then the extension controller class requires a standardcontroller as a constructor parameter So your constructor will look like below public ...
Mohith Shrivastava's user avatar
2 votes

Embedded VF Page Not Responding To StandardController

Change your constructor of your extension class into: public noteandtask_controller(ApexPages.StandardController stdController){ //... And your issue will be gone. For a standardcontroller ...
Lance Shi's user avatar
  • 13k
2 votes
Accepted

Trouble relating second object for dynamically added records From Controller Extension

Let's go through possible scenarios: Insert single record and save - ok remove single record and save - ok click save with existing record - nok INVALID_FIELD_FOR_INSERT_UPDATE You inserting ...
Ilya Lepesh's user avatar
  • 4,125
2 votes
Accepted

Help with Controller Extension for Save Redirect Function

You add a reference to your extension class like this: <apex:page standardController="Quote__c" extensions="MyExtension"> and then that class should follow this pattern: public with sharing ...
Keith C's user avatar
  • 136k
2 votes

Get data from apex standardcontroller into extension

I highly recommend you complete this Trailhead module: Create a Controller Extension. It would also be worth reading up on Introduction to Controllers and Extensions. You can get the record from the ...
Adrian Larson's user avatar
  • 150k
2 votes
Accepted

Extension Test: Constructor not defined: [<Extension-Name>].<Constructor>(ApexPages.StandardController)

If you have not defined any constructors explicitly, then the empty constructor is implicitly defined, and no other constructors are allowed. That would also really make your Apex a Controller more ...
Adrian Larson's user avatar
  • 150k
2 votes
Accepted

Chrome Extension ( for API Name and Value)

I believe this is what you are looking for: https://chrome.google.com/webstore/detail/salesforce-inspector/aodjmnfhjibkcdimpodiifdjnnncaafh?hl=en This extension not only lets you get API names on ...
Eric's user avatar
  • 54.2k
2 votes
Accepted

Populate Order fields from Account

You can change public Order ord; to public Order ord {get;set;} And use that ord value in the form where you are referring attributes, like below. <apex:outputField value="{!ord.OrderNumber}"/&...
Santanu Boral's user avatar
2 votes

Running code yields random return

Firstly. The following lines from your code are a big security problem: string q = 'select id, firstname, lastname, name, zfetch__c, mobilephone, '+ 'account.name, account....
Daniel Ballinger's user avatar
2 votes

Null reference in loop?

You need to declare ORINlist variable and assign with List<order_LIne_item__c>. So, initially and out of for loop, do this List<order_LIne_item__c> ORINlist = new List<...
Santanu Boral's user avatar
2 votes
Accepted

No version number was found in Dev Hub for package id and branch 'x' and version number 0.0.0.LATEST that resolved to build number 214

This error happens in the following case. You have two packages, Package Base and Package Extension. Package Extension depends on Package Base, on particular version, for example, 0.0.0.LATEST. You ...
Patlatus's user avatar
  • 17.2k
2 votes

Publishing a Managed Packaged Extension in the AppExchange

If I create a managed package extension and want to list that on the AppExchange, Im assuming the end user would need to have the Base Package first installed in their org. That is correct. Is there ...
David Reed's user avatar
  • 93.2k
1 vote

How to add delete button on each record in pageBlock table - VF

You need to add the wrapper to the list: allrecords.add(new caseWrapper(record, false)); Your page block needs to reference the case, and allow for the checkbox: <apex:column> ...
sfdcfox's user avatar
  • 495k
1 vote
Accepted

Apex Class for Extension AND Standard Controller Save Button

Don't query the parent back from the database; it's already in the Standard Controller: public myClass (ApexPages.StandardController stdController) { SiteP = (Parent__c)stdController.getRecord(); } ...
sfdcfox's user avatar
  • 495k
1 vote
Accepted

How to display next,last,previous and first buttons on a VF page in accordance with conditions?

You can make use of the getHasPrevious and getHasNext properties directly in your markup. You can merge the property values into properties such as rendered, disabled, etc. according to your ...
Adrian Larson's user avatar
  • 150k
1 vote
Accepted

when do we use ApexPages.StandardSetController in apex class?

Short answer, you don't have to use, it's just there. Long answer, it saves you time. Here is a link to the Apex reference. This class contains every essential method for your overridden pages. ...
Laszlo's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible