Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [extension]

Content relating to Visualforce Controller Extension Classes

0
votes
1answer
54 views

I have added a vf page(displays an error message) in pagelayout. I don't want it to be displayed when the case has attachment

I have a vf page that displays an error message. On Case object when I edit a case, and save it with an attachment, I don't want it to display that vf page. VF Page Code: <apex:page ...
0
votes
1answer
129 views

standard controller with extension

If we have standard controller with extension controller, extension runs in system mode generally. So now in this case extension controller, will it run in user mode? Provided i don't have with ...
-2
votes
1answer
98 views

Null reference in loop?

I'm getting this error: System.NullPointerException: Attempt to de-reference a null object when I'm trying to pass child records to new record creation(order_LIne_item__c). Here I have nested ...
0
votes
1answer
1k views

Standard controller and extension method with same name [duplicate]

Provided you have a Visualforce page that uses both a standard controller and an extension class. The extension class has a method with the same name as a method in the standard controller (i.e, ...
2
votes
1answer
113 views

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

I'm on the Advanced Apex Specialist Superbadge step 8 and I'm writing the test class, but what they are asking for seems different from what I've been taught about test methods. I thought that I ...
2
votes
3answers
326 views

SOQL Query Limits in Wrapper Class (using dlrs)

I have been trying to build a wrapper class which creates a junction Object (Delivery_Note_Line_Items__c) between two other objects (orderLine & Delivery_Note__c) depending on the Visualforce's ...
2
votes
1answer
71 views

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

I have a search box that will pull into all accounts we currently have. It will then direct to a custom record detail page that shows account's main information with the equipment they currently have( ...
0
votes
1answer
1k views

Apex Class for Extension AND Standard Controller Save Button

I have a visual force page using an extension and the standard controller. I added a pagereference save() action to the page but it is only updating the child and grandchild records. How can I get ...
0
votes
0answers
200 views

Automatic pop up appears on clicking on custom button

I have a Url custom button, and for some record types, a pop-up appears on Napili Community after clicking that button. Accept Button url: /XXXX/X/acceptreferral?recordId={!Service_Request__c.Id} ...
-1
votes
2answers
114 views

Assert on a standard controller

I am starting to learn writing testclasses but dont know how to assert on a standard controller see my code below public class accSearchController { public string searchStringContact {get;...
1
vote
1answer
688 views

Dynamic visualforce table using Map

I was originally building lists using dynamic query which works great, like so: extension: // initialize lead variables and columns string leadFields = [SELECT lead_fields__c FROM ...
0
votes
1answer
167 views

Controller Extension Test Help?

I will start out by apologizing for being a total n00b but, I need some help increasing my code coverage ASAP. Currently I am at 73%... so close!! Any help/advice/anything is a huge help! Thank You! ...
0
votes
1answer
815 views

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

What i want is , to display the next and last button only when its the first page,first,next,last,previous when its 2nd page or more, and first and previous when its last page of opportunities. <...
0
votes
1answer
427 views

when do we use ApexPages.StandardSetController in apex class?

I recently started learning and using extensions, but i was not able to understand the use of ApexPages.StandardSetController Controllername(){}. I used it in last two days but i dont know why it is ...
1
vote
1answer
31 views

Field updating in client but not server

I am trying to update quantity field in customer_product__c, but no luck - its updating in client level but not in server Code: /*method to update quantity in customer product */ public void ...
0
votes
2answers
509 views

Get data from apex standardcontroller into extension

I have a custom object standardcontroller and an extension. I have embedded a VF page on the custom object's pagelayout. When the new custom object is created, I want to be able to access the custom ...
2
votes
1answer
59 views

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

I tried to write a Testclass for an Extension that is supposed to handle a replacement for a creation-page. TestClass: @isTest public class VisualforcePageExtTest{ static testMethod void ...
3
votes
0answers
157 views

How do I import contacts from Data EXtension into Mobile Connect?

I already have audience in Data Extension. I would like to send SMS to those audience, but I can't access Data Extension from Mobile Connect. I have been told that I can import Data Extension into ...
0
votes
1answer
1k views

Use input field value from standard controller extension property

I am trying to get an input field value to reference a standard controller extension property. Here is my controller extension: public class LicenseActivationController { private final Contact ...
0
votes
1answer
2k views

Chrome Extension ( for API Name and Value)

I remember seeing a chrome extension which gives the fieldAPI + values of the field populated on the detail records. You can copy the code and run to insert the record in other org or test classes. ...
0
votes
2answers
79 views

Can I place ampscript in a data extension colum?

I am trying to create a data extension that houses ampscript within it. Within the email itself, I've placed this code just after the open body tag: %%[ Var @orgname, @short Set @orgname = "...
1
vote
2answers
58 views

Populate Order fields from Account

My first controller extension here, trying to populate some customer order fields based on the Order Account selected. Not having much luck. Also uncertain if the two lines I commented out in the ...
0
votes
1answer
62 views

Running code yields random return

This is a long one. Copied and pasted from blog entry found here: http://www.bespokn.net/2017/01/22/code-anomaly-a001/ Running code should not produce different results given the same inputs. ...
0
votes
2answers
246 views

What is the filetype extension for salesforce pages?

I'm trying to embed a standard salesforce records page and one of the criteria for the webapp that I'm using to do that is that the iframe url be terminated with a filetype extension. Looking at the ...
0
votes
1answer
360 views

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

I´m trying to test my extension: public class CampaignRelatedListExtension { public List<CampaignMember> campaignMembers { get; private set; } public CampaignRelatedListExtension(...
0
votes
1answer
198 views

Constructor not defined: [CheckPostalAddress].<Constructor>()

I have created a extension class and when i try and deploy i get the error as described in the title. I have searched in the internet, but cannot see a resolution, therefore, if anyone has any ideas, ...
1
vote
1answer
184 views

Export ExactTarget single record to CSV files

I would like to export a single row from a Data Extension to CSV in FTP. Once the download is completed i would like to delete the same record from Data Extension.
3
votes
1answer
278 views

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

I am creating a visual force page where a user can log a completed task and set up a new one. I'd like to set default values for the Status to New for one section and Complete for the other. Is ...
2
votes
1answer
440 views

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

I'm been searching the forum, but haven't found a clear answer. Is it possible to reference a field set with only a custom controller? I could possibly use a standard controller and an extension, ...
2
votes
1answer
459 views

Marketing Cloud send syncronized Data Extension information to Data Extension

i just setted up my Sales cloud integration in MC. Im now able to see my "Lead" Data in MC syncr. Data extensions. But i cant get the Data into a normal Data Extension to work with the information i ...
1
vote
1answer
430 views

Help with Controller Extension for Save Redirect Function

I need help creating a controller extension for a Visualforce page. The extension should cause the Save button to redirect to a visual force page named "ProductSelector". The relevant portion of my ...
1
vote
1answer
55 views

What am I doing wrong with my extension?

I have two salesforce custom objects, service case and customer. I am trying to make a page that displays data from both objects. I used service case as a standard controller and get no problems. I ...
2
votes
2answers
84 views

Embedded VF Page Not Responding To StandardController

I am trying to embed a custom VF page into my Accounts layout. I believe my error is in the standardController. I assumed it should be SObject but it did not work and now I am not 100% sure what it ...
3
votes
1answer
201 views

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

I want to toggle edit mode to on/off for <apex:detail> component for account by dynamically setting "inlineEdit" to TRUE/FALSE attribute on click of commandbutton.Following is my code. It keeps ...
0
votes
2answers
60 views

Trouble relating second object for dynamically added records From Controller Extension

I'm editing this, as I just realized that the two objects are being saved, but they are not being related. These two objects are related via lookup. I'm relatively new to coding, and haven't been ...
1
vote
0answers
39 views

Loop over null throws error in Production but not Sandbox?

I'm trying to debug someone else's code where they're trying to populate a visualforce picklist with options from the controller. Without going into detail, the page is failing to load because the ...
0
votes
1answer
439 views

Add field to active SFMC Data extension

Can you add additional fields to an active Data extension? These data extensions are currently being used to populate Active Journeys so I was not sure if I could add additional fields to the DE. ...
2
votes
0answers
113 views

How can I clear all data from data extension using Java fuel sdk API

PerformRequestMsg performRequestMsg = new PerformRequestMsg(); performRequestMsg.setAction("ClearData"); PerformRequestMsg.Definitions definitions = new PerformRequestMsg.Definitions(); definitions....
0
votes
2answers
57 views

How to add new fields to a VF page when they are not included in the custom controller used for the page

I have a custom controller and VF page which allow my users to create and save a contract by using several information fields on the opportunity and related account page. Since this was first created, ...
1
vote
1answer
1k views

On click of save record button i need to download opportunitylineitems details as pdf

I have written one VF page,1 extensions on opportunity detail page with show products button.Once i click show products,it will show all products present in that current opportunity.List of products ...
0
votes
1answer
70 views

Not getting opportunity against the current account

I am trying to create a Vf page on click of a custom button "Show opportunities" on account detail page.Currently when i preview my Vf page it shows only two button "Proceed with Selected" & "...
1
vote
1answer
84 views

Help with a custom extension test class

I'm pretty new to VisualForce and Apex but I know a little bit of Java so I've been able to figure out how to set up a pretty simple page to create an account and two contacts. I found some useful ...
0
votes
1answer
162 views

Using Input Field to occupy Output Field through Extensions Class

M a SF rookie and i need the output fields ie Amount,Price and Quantity to be displayed when their respective Product is selected.All are fields of an Sobject known as Sales_Order_Line_Item__c.The ...
2
votes
2answers
4k views

URL Encoding in Apex - PageReference to Merge Accounts

Following to my previous question - Merge Accounts based on Account Number. I have written a Visualforce page with a selectable table list of Accounts. When selecting the accounts and pressing the ...
1
vote
1answer
183 views

Reuse / share functionality between base and extension managed packages

I have a managed base package that contains Visualforce components and pages that I would like to reuse in its extension package. I don't want to make them global as this would allow customers to ...
1
vote
0answers
91 views

Dev on extension package against unmanaged version of base package

We are currently developing both an extension and base package. Currently, due to namespaces, we are forced to develop the extension package against a managed base package. When we have to change the ...
2
votes
0answers
834 views

Pass VF component attribute to component extension

Following is my code: VF PAGE: <apex:page standardController="account" extensions="ForecastHierarchyEditExtension" tabStyle="Account" sidebar="false" standardStylesheets="false"> ...
1
vote
1answer
1k views

StandardController of Account to show a pageblocktable of related child object from an extension errors out

I have a object Competitor_Mapping__c that has lookup with Account. In the page, i have used standard controller of Account to fetch the current Account id from URL, used in a SOQL to populate a list ...
1
vote
1answer
973 views

Update picklist value after commandButton onclick event

I have two buttons on my visualforce page: <apex:form > <apex:commandButton styleclass="btn-lg btn-data" value="Value 1" onclick="setValue1()"/> <apex:commandButton ...
1
vote
1answer
754 views

When I change a VisualForce page ContentType, can I somehow give it a file extension?

Currently reading about Using Custom ContentType. I see that, instead of serving an HTML page, I can instead serve some other media types, such as Excel or RTF. However, when I create the page, I ...