visualforce

Using apex:relatedList in a Visualforce page when the user profile denies access to child objects

旧城冷巷雨未停 提交于 2019-12-11 04:31:41
问题 I have two custom objects, Appointment and Session Report. Session Report is a child of Appointment in a standard Master-Detail relationship. Additionally, I have a profile, Student, which has Read-Create-Edit-Delete for Appointments and no rights for Session Reports. The use case is a Student can create an Appointment but cannot view the Session Reports created for this Appointment by a Tutor. Using a standard layout for the Appointment object works as expected when viewing Appointments.

Removing None Option in PickList visualforce apex

不想你离开。 提交于 2019-12-11 03:54:32
问题 i have created an object with name PS_Detail__c .in this custom object i created a custom field .in this picklist i defined two values Dollar ,Unit . when i go to P/S Detail Tab for creating a new PS_Detail__c object then i get None also as a value in picklist field .i want only Dollar and Unit as Picklist values .some one please help how to remove this None from Picklist !! 回答1: As you have discovered, you cannot make this picklist required at the object level. However, making this field

How do I display the results of an aggregate SOQL query on a Visualforce page?

青春壹個敷衍的年華 提交于 2019-12-11 02:48:33
问题 I'm very new to Visualforce. I'm looking at this page here: http://force.siddheshkabe.co.in/2010/11/displaying-aggregate-result-on.html So when I added this code onto a VisualForce page: AggregateResult[] groupedResults = [SELECT Name, Days__c FROM Contact WHERE Days__c != ]; for (AggregateResult ar : groupedResults) { System.debug('Name: ' + ar.get('Name') + '\nDays Taken : ' + ar.get('Days__c') + '\n'); But all it does is print the code instead of executing it. What should I be doing?

Combine multiple objects within a list

我与影子孤独终老i 提交于 2019-12-11 02:39:10
问题 I'm looking to create a single list of records of various sObject types using apex to display to a custom visualforce page. I'm wondering if there is a way to combine multiple objects (case, opportunity, account, etc) within a single list. If not, how do you append the second object to the first in a list using visualforce code? Is there a best practice? Thanks So I could use a little more assistance completing this. I have written this: public class MyController { public List<ContactAndCase>

Why JQueryUI does not work on salesforce standard input elements?

ぃ、小莉子 提交于 2019-12-11 02:28:02
问题 I am having trouble using JQueryUI with salesforce standard elements. Basically, I want to auto suggest the record names to the user, instead of the user clicking on the salesforce search button. <apex:inputField value="{!MyRecord.ChildRecord__c}" id="inpId" required="true/> <script> jq$(document.getElementById('{!$Component.inpId}')).autocomplete( { minLength: 2, autoFocus: true, source: mySource }); </script> Therefore, I want to know if anyone attempted to use JQueryUI with standard

How to get in a Visualforce page controller a value from a custom component controller?

半城伤御伤魂 提交于 2019-12-10 15:23:41
问题 I'm trying do develop a visualforce custom component which is an entity chooser. This custom component displays a UI which helps browsing some records. It's possible to select one record, and I'd like to get it from outside the component or its controller. I've looked at the standard salesforce binding with assignTo bug it's not bidirectional... Hope someone can help me.. Thanks 回答1: Are you passing an object into the component? Objects are passed by reference, so if your component has an

CSRF safe Custom button linked to Apex method

跟風遠走 提交于 2019-12-09 17:01:03
问题 I'm looking for a technique to execute Apex code from a custom button added to the Opportunity object in a way that protects the user against CSRF. The current approach being used comes from the question - Custom Button or Link to a Visualforce page with a custom controller. Essentially: There is an Opportunity Custom Button with the Content Source set to "Visualforce Page". The Content for this button is set to a Visualforce page that uses Opportunity for the standardController, has an

Apex Code Version Control

爱⌒轻易说出口 提交于 2019-12-09 16:32:34
问题 Is there any way to integrate version control system for Apex & Visualforce code? I can thinking of keeping a separate repository but no way to have it integrated with Salesforce Platform. Thanks in Advance. 回答1: You can do this by using Subversion and the Force.com Eclipse IDE with the Subclipse plugin. Here are a few links to some instructions. Setting up Subversion (Windows) Installing Force.com IDE (Eclipse) Installing Subclipse (Eclipse plugin) Use the update site when installing in

why iframe control is not loading the source page in visual force preview?

允我心安 提交于 2019-12-08 09:39:23
问题 I am new to salesforce. I want to use iframe control in visualforce page to load some content from .net. I've used the iframe control as follows <apex:page > <apex:iframe frameborder="true" src="http://www.salesforce.com" scrolling="true" id="theIframe"/> </apex:page> but it is not loading anything in the iframe control.It is showing only white back ground an also I tried with html iframe control but I got the same response. So can anyone please tell me what am I missing? 回答1: It will be the

VisualForce: convert carriage returns to html line-breaks in a long text field

耗尽温柔 提交于 2019-12-07 04:37:44
问题 In Salesforce, if I'm binding a text field into a VisualForce page, whats a good way to convert the carriage returns in the text-field into HTML <br/> tags? e.g. starting from something like this: <apex:page standardController="Case"> <apex:pageBlock title="Test"> <p>{!case.Description}</p> </apex:pageBlock> <apex:detail relatedList="false" /> </apex:page> ... if the Description is long with lots of carriage returns, how do I HTML-ify it? (I guess this is a fairly easy question, and I'm sure