• TheSwami
  • NEWBIE
  • 440 Points
  • Member since 2008

  • Chatter
    Feed
  • 17
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 106
    Replies

What is the full URL for a VF page called "myPage" in a sandbox?  For a 3rd party developer key, I need to register all of the subdomains for visualforce the various instances like CS0-CS15, but I don't know what the sandbox URL structure for VF pages is.

 

For example - this is the URL on na11 in production:

https://c.na11.visual.force.com/apex/myPage

 

What would it be in CS1?  Something like these?

https://c.tapp.cs1.visual.force.com/apex/myPage

 

or

https://c.tapp.cs1.visual.force.com/apex/myPage


Thanks!



I've searched a bit and found some posts about using the IF statement within a VF page, but wasn;t clear about the possibility of using it for a simple display of a html page.

 

The controller is the standard ACCOUNT object.

All I need is something like this:

 

<apex:page standardController="account">
{!IF(isnull(account.JOB__c),"No Job","

<html>

some HTML coding here....

</html>"
)
}
</apex:page>

 The syntax is probably wrong, but I was wondering if this is possible.

 

Thanks in advance!

B

Hi, 

 

I am looking to pass the parameter passed through the URL ../apex/New_Lead?msg=test into a custom field called Web_Lead_Source__c.

 

Below is my code:

<apex:page standardController="contact" extensions="setValfromURL" >
Your page redirected from: {!message}<br/>
<!-- {!$CurrentPage.URL}<br/>-->
<!--{!$CurrentPage.parameters.msg}-->
<apex:sectionHeader title="New Lead"/>
<apex:form >
<apex:pageBlock title="Information" mode="edit">

<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Submit"/>
<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Contact Information">
<apex:inputField id="contactFirstName" value="{!contact.firstName}"/>
<apex:inputField id="contactLastName" value="{!contact.lastName}"/>
<apex:inputField id="contactPhone" value="{!contact.phone}"/>
<apex:inputField id="Source" value="{!contact.Web_Lead_Source__c}"/>
<apex:inputField id="Medium" value="{!contact.Web_Lead_Medium__c}"/>
<apex:inputField id="contactEmail" value="{!contact.email}"/>
<apex:inputText id="Source1" value="{!message}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

public class setValfromURL {
private ApexPages.StandardController controller;
public setValfromURL(ApexPages.StandardController controller) {
this.controller = controller;
}
public String getMessage(){
String a = ApexPages.currentPage().getParameters().get('msg');
return a;
}

 }

 

The first reference to {!message} works fine but the second reference to {!message} gives an error : Error: Read only property '[setValfromURL].message'

 

I am also able to use {!$CurrentPage.parameters.msg} to display the parameter value, but I am not able to pass it into the inputText.

 

Please advice.

Thanks,

Ritu

I have a Visualforce page which I have two versions of but the only difference is that one renders as a PDF.  On this one, the date does not appear.  I use the same code for the page that does not render as a PDF and the date appears without issue.  Any help would be great!  Thanks!

 

<apex:page renderas="PDF" standardController="Policy__c" showHeader="false" sidebar="false">
<p><b><font size="4">{!Policy__c.Name} - {!Policy__c.Insured__r.Name}</font></b></p>
<p><b><font size="2">Claim Check as of <script>
 var mydate=new Date()
    var year=mydate.getYear()
   
    if (year < 1000)
        year+=1900
   
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
   
    if (month<10)
        month="0"+month
   
    var daym=mydate.getDate()
    if (daym<10)
        daym="0"+daym
   
    document.write(month+"/"+daym+"/"+year)
</script></font></b></p>
<p></p>
<table border="1" cellspacing="2" cellpadding="10">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Policy__c.Claims1__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.Name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 11, 2011
  • Like
  • 0

I have a req, where the user fills out a form and on save it should be rendered as PDF,

 

Can anyone please help me out.

 

  • November 07, 2011
  • Like
  • 0

When a user selects a row(s) in a pageBlockTable with a checkbox (and then clicks a button) I want to be able to use jQuery (or Javascript) to populate the Account Names in another table.

 

Here's my code so far:

 

Visual Force

 

<apex:page id="testAllen" controller="testAllen">
	<apex:form id="theForm" >
	
		<apex:pageBlock title="Accounts" id="pageBlock">
			<table id="myTable"></table>
			<input type="button" value="Add selected to myTable"  onClick="addAccountsToMyTable()" />
			<apex:pageBlockTable value="{!DisplayAccount}" var="da" id="accountsTable">
				<apex:column >
					<apex:facet name="header">Select</apex:facet>
					<apex:inputCheckbox value="{!da.IsSelected}" />
					<apex:inputHidden value="{!da.account.Id}" id="hdnAccountId" />
				</apex:column>
				<apex:column >
					<apex:outputText value="{!da.account.Name}" />
				</apex:column>
			</apex:pageBlockTable>
		</apex:pageBlock>

		<script type="text/javascript">			
			function addAccountsToMyTable() {
				var accountsTable = $(jq("{!$Component.theForm.pageBlock.accountsTable}"));
				//TODO: need to add selected account names to myTable 
			}
			
			function jq(myid) { 
	   			return '#' + myid.replace(/(:|\.)/g,'\\\\$1');
	 		}
 	
		</script>
	</apex:form>
</apex:page>

 Apex:

public class testAllen {
	public List<DisplayAccount> DisplayAccount {get; set;}
	
	public testAllen() {
		this.DisplayAccount = new List<DisplayAccount>();
		for (Account a : [SELECT id, Name FROM Account LIMIT 20]) {
			this.DisplayAccount.add(new DisplayAccount(a));
		}
	}
	
	public class DisplayAccount {
		public boolean IsSelected {get;set;}
		public Account account {get;set;}
			
		public DisplayAccount(Account a) {
			this.account = a;
			this.IsSelected = false;
		}
	}
}

 

Hi

 

I've got a working search page in visualforce using apex controllers. It works fine in Salesforce user environmen, but I now want to make it visible on our website for others to us. 

 

I've got the page displayed in Sites and can see the page and interact ok with teh search filter boxes. My only issue is that the data is not displaying! I have amended the Public Profile so that the Apex code is enabled and the relevant Custom object is enabled for read only access. The data does not display however. It is linked to the Contacts object which has read access enabled as well.

 

Would it help to see the controller code?

 

I hope someone can help.

 

REgards

 

Justyn

  • November 02, 2011
  • Like
  • 0

Hi,

 

I have designed a VF page(say HOME), which has the controller class and it has the logic to redirect to another page which has also a controller class. When i am executing this VF page in developer mode developer edition account, it works fine.

 

But when i am including the HOME VF page in my site, and trying to access it, it is showing the InMaintenance or Unauthoried Aceess page of my site, instead of showing the required VF page.

 

If any body knows about its solutions, please let me know

  • October 19, 2011
  • Like
  • 0

What component should I use to produce something that looks like a VisualForce data table but populated with static values.

 

I'd just use a table but that would not blend in with the rest of the page that has the VisualForce look to it.

 

 

Hi,

I have a visualforce page from where the users can upload/fax documents.

the above two are radio buttons 

 

in my visualforce page they look like this 

 

<apex:selectRadio value="{!action}" onclick="YAHOO.force.com.showMe();" > 

         <apex:selectOptions value="{!listofactions}" />

</apex:selectRadio> 

 

the problem is the pop up is showing for both the radio buttons but i want to show the popup only when the action= "Upload"

 

is there a way i can put a IF statement in onclick or any other way 

Plz help

  • October 12, 2011
  • Like
  • 0

My visualforce page has a section that should only be 1 column wide.  I've specified 1 column in the page block, but the section still displays the information one half of the screen width.  I need the section to stretch across the page.  Any idea how to fix it?

 

Here's the code that's giving me trouble:

<apex:pageblockSection title="Scorecard" columns="1">

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How well does this fit with the vision*?" style="font-weight:bold"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}"/>

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How effective is this at generating client leads?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}"/>

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How well does this support consumer convenience** of one experience?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How would you describe the consumer driven point-of-difference?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How adaptable is this to multi-platform distribution?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How would you describe the competitive landscape?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How much revenue*** does this generate?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How operationally complex will this be to implement?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:pageblockSectionItem >

<apex:outputLabel value="How much time will this take to launch?"/>

<apex:inputField value="{!Ideas_Projects__c.Fits_Vision__c}" />

</apex:pageBlockSectionItem>

 

<apex:outputText >

* Vision, as defined in Internet Strategy document.<br/>

** Convenience as defined by the ability to deliver a "Find, Discover, Buy" experience.<br/>

*** Estimated revenue for first 12 months following launch.

</apex:outputText>

 

</apex:pageblockSection>

 

Any ideas?

Somewhat new to VF but not SF. 

 

Have a pageBlockTable and I'm trying to conditionally render a row based on record type.  So if recordtype = X, then render the row.

Is this the right approach or is something better?  Not having luck figuring out way to do this aside from put a render statement for each column, which can't be correct.

 

 

<apex:pageBlock rendered="{!$ObjectType.EntityAddress__c.accessible}" title="Location Addresses">

 

<!-- Been trying to add the render statement to line below? So if record type is X then render that row else do not -->

<apex:pageBlockTable value="{!contact.provideraddresses__r}" var="provideraddress">

 

<apex:column headerValue="Is Active" value="{!provideraddress.Active__c}"/>

 

<apex:column headerValue="Type" value="{!provideraddress.Address_Type__c}"/>

 

<apex:column headerValue="Street" value="{!provideraddress.Address__r.Address_Line_1__c} {!provideraddress.Address__r.AddrLn2__c}"/>      

 

<apex:column headervalue="City" value="{!provideraddress.Address__r.City__c}"/>

 

<apex:column headervalue="State" value="{!provideraddress.Address__r.State__c}"/>

</apex:pageBlockTable>

</apex:pageBlock>

 

D

Hi,

 

I have a requirement where I need to display opportunity on a account page. The opportunites that has to be displayed would be based on a filter. Actually the req. is that opportunites should be displayed based on region which will be selected from the dropdown (a vf section on account page) on the account page. Can anybody help me with the code.

 

Thanks in advance!!!

 

 

I would like to improve the Case Comment Template defined in our Cases / Support Settings.

It's a Visualforce Email Template, working well (including translations) but missing the "Last Case Comment" information.

 

I have tried a bunch of solution with no success until now. Can someone pinpoint what I am doing wrong ?

 

Here is my Apex Class:

public class findSaaSlastCaseComment {
    private final List<CaseComment> cComment;
    public Id caseId {get; set;}

    public findSaaSlastCaseComment() {
        cComment = [SELECT CommentBody FROM CaseComment WHERE ParentId = :caseId AND IsPublished = True ORDER BY LastModifiedDate DESC LIMIT 1];
    }

    public List<CaseComment> getSaaSlastCaseComment() {
        return cComment;
    }
}

 Here is my Visualforce Component:

<apex:component controller="findSaaSlastCaseComment" access="global">
    <apex:attribute name="caseId" description="Salesforce Id of the Case" type="Id" assignTo="{!caseId}" />
    <apex:dataTable value="{!SaaSlastCaseComment}" var="lastCaseComment">
        <apex:column >
            {!lastCaseComment.CommentBody}
        </apex:column>
    </apex:dataTable>
</apex:component>

 Here is an extract of my Email Template:

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Case"
    subject="{!relatedTo.Subject}">
    <messaging:htmlEmailBody >
        <html><body>
	Dear customer...
        Description: {!relatedTo.Description}

        Last comment: <c:findSaaSlastCaseComment />

        </body></html>
    </messaging:htmlEmailBody>
<messaging:plainTextEmailBody >
	...
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 As I understand CaseId is empty because the mail template references the Id as "RelatedTo.CaseId" not "CaseId", but I don't know (I am not a developer) how to reference CaseId the right way.

 

Is there a better solution (unfortunately {!Case.Last_Case_Comment} is not available in Visualforce Email Template)?

 

Many thanks for your answers,

Yves

So I believe this subject has been covered a few times in here, however I have not found anywhere that covers merging a series of images using static resources.

 

Right now I am succesfully calling up a single image stored in our static resources by using the following line...

 

<tr><td align="left"><apex:image value="{!$Resource.John_Doe}" width="198" height="227"/></td></tr>

 

What we are now trying to do is call up a series of photos on the same sheet (labels).

 

All of the image names are created from the field Full_Name__c, therefore I was hoping to merge that field into the static resource name to call them up in succession.  Something like....

 

<tr><td align="left"><apex:image value="{!$Resource.{!SelectedOpportunity.Full_Name__c}}" width="198" height="227"/></td></tr>

 

I know this does not work, but does anyone know of another solution?

 

P.S.  I will have to create static image files for all the photos, however all of these photo's are currently held on an intranet server, so our first thought was to reference those URL's in our visualforce page to merge them all using the same technique, ie ...

 

<apex:image url="http://123.123.1.12/~intranet/photos/" {!SelectedOpportunity.Full_Name__c} ".jpg

 

I'm pretty sure this is not possible.... but.... if anyone knows how to do that, it would be the most ideal option.

 

Thanks for all the future replies!

currently I have

DateTime.now().format('MM/dd/yyyy hh:mm a', 'EST');

 

but I would like to have 

DateTime.now().format('MM/dd/yyyy hh:mm a', 'ET');

 

The issue is that when I put ET as the timezone it defaults the timezone to GMT since ET is not a correct time zone.  How do I accomplish this?

Hey all,

 

I have a VF page that includes an image and a stylesheet that when rendered as html in both org (https://emea.salesforce.com/apex/My_Page) and on my site (http://www.mysite.com/My_Page). But when I change the RenderAs to PDF, the images and CSS fail to work (i.e. broken image in pdf and no styling). I have the two resources as static resources. I've also tried putting the image and css files in Documents and make externally accessible (and tested this) but again still they fail in the pdf.

 

Sample code:

<apex:page standardController="Custom_Object__c" showheader="false" renderAs="pdf">
<apex:image url="{!URLFOR($Resource.MyImage)}" />
<apex:image url="http://www.mysite.com/servlet/servlet.ImageServer?id=015200000010duH&oid=00D200000000MZB&lastMod=1302282092000"/>
<img src="http://www.mysite.com/servlet/servlet.ImageServer?id=015200000010duH&oid=00D200000000MZB&lastMod=1302282092000" />
<img src="{!URLFOR($Resource.MyImage)}" />
etc...

 None of these four work when rendered as pdf when accessed through the site.

 

Anyone any ideas as to why this is? How can I get a static resource accessible in pdf when viewed though a site. As I said, viewing the same VF page thru org works fine. It's only when accessed thru site that the issue arises.

 

thanks

R

I have the following vf page to generate geocode for one of my custom object. I am not able to using the following script. Can some one plz help what is wrong with the code???

 

 

 

 

<apex:page standardController="Establishment_Record__c">

<script src="http://maps.google.com/maps?file=api">
</script>

<script type="text/javascript">

var map = null;
var geocoder = null;

var address = "{!Establishment_Record__c.PremiseStreet__c}, {!

Establishment_Record__c.PremiseCity__c}, {!

Establishment_Record__c.PremiseState__c}, {!

Establishment_Record__c.PremisePostalCode__c}";

function initialize() {
if(GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("MyMap"));
map.addControl(new GMapTypeControl());
map.addControl(new GLargeMapControl3D());

geocoder = new GClientGeocoder();
geocoder.getLatLng(
address,
function(point) {
if (!point) {
document.getElementById("MyMap").innerHTML = address + " not found";
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindow(document.createTextNode(address));
}
}
);
}
}
</script>
<div id="MyMap" style="width:90%;height:300px"></div>
<script>
initialize() ;
</script>

</apex:page>

  • April 24, 2012
  • Like
  • 0

Hi,

 

At present I am able to download an image to the local disk. But I need to download an image and store it  as a document in Salesforce Org so that it can be attached to the email.

 

Could anyone please help me on how to download and store an image as a document in Salesforce Org.

 

Thanks in advance.

 

 

 

  • April 20, 2012
  • Like
  • 0

Suppose I have a VF page called "Quick_Edit" for updating an opportunity:

<apex:page standardController="Opportunity">
  <apex:pageMessages />

  <apex:form >
    <apex:pageBlock title="Quick Edit">

      <apex:pageBlockButtons style="float:right;">
        <apex:commandButton value="Save" action="{!save}"/>
        <apex:commandButton value="Cancel" action="{!cancel}"/>
      </apex:pageBlockButtons>
                        
      <span>Opportunity Name:</span>
      <apex:inputField value="{!opportunity.Name}"/>

    </apex:pageBlock>
  </apex:form>

</apex:page>

 

I have a test class like this:

@isTest
public class QuickEditTest {
    
    static testMethod void opportunityEditTest() {
        
        // setting up data
        
        Opportunity op = new Opportunity(
            Name = 'TestOpportunity1', 
            CloseDate = System.today(), 
            StageName = 'Prospecting'
        );
        
        insert op;
           
        
        PageReference pageRef = new PageReference('/apex/'+op.Id);
        Test.setCurrentPage(pageRef);
        
        // now what should I do
    }
}

1. Is it possible to insert data into the form and test the save action?

2. If not, do I have to created getters/setters in a controller (say opportunity extension controller) to set updated field value directly on the opportunity object and then call save?

3. If there is no real good way to interacted with the VF page in tests, what is the purpors of using Test.setCurrentPage(pageRef)? Because I can just test the controller alone.

 

If anybody develops Rails app, you probably know what I need is functionalities like Capybara or Webrat ... 

What is the full URL for a VF page called "myPage" in a sandbox?  For a 3rd party developer key, I need to register all of the subdomains for visualforce the various instances like CS0-CS15, but I don't know what the sandbox URL structure for VF pages is.

 

For example - this is the URL on na11 in production:

https://c.na11.visual.force.com/apex/myPage

 

What would it be in CS1?  Something like these?

https://c.tapp.cs1.visual.force.com/apex/myPage

 

or

https://c.tapp.cs1.visual.force.com/apex/myPage


Thanks!



So let's say that I wanted to load a page on a Standard object like Accounts. I could create the visualforce page with Account as the Controller and drag it onto the Account page.  How can I do this with a custom edit page?  I am trying to get a pop-up to display if a certain condition is met, but can't seem to figure out how this would work.

Hi All,

I have two objects

1,StockTransfer(master)

2,StockTransferLine(child)

there is master-detail relationship b/w these objects 

each Stock transfer have 1 or more than Stock transfer lines

now these records should display in one page 

for suppose StockTransfer having 2 fields 1,location1 2,location2

and StockTransferLine has 3 fields 

1,item

2,quantity

3,request date

 

now these values I want to show in table

like

Source location    Destination location        item  ID            quantity         Request date

USA                           India                                 0001                100               3/3/2012

 

 

please any would help me or provide some sample code.

Thanks in Advance.                                       

  • March 03, 2012
  • Like
  • 0

Hello, I am new to visualforce and I am trying to learn no real expierence so please be as plain as possible. I have created a visual force page, and I would like to know how I can set it up so that if I click on an image it can take the viewer to another visual force page almost ike a hyper link. Also, I installed an app and I am curious to know if there is a way to post the information I placed into that app into my visualforce page so that it is externally visible.... Plz and thank

  • March 02, 2012
  • Like
  • 0

i created 2 custom objects ,the parent is Vacante__c, and the child es Aplicante__c, both are related by a lookup field .
on the related list that shows all the childs for the parent i want to create a new button or override the new button, when i click send me to other page, that show me a label with the name of the parent and a lookup field for search a child ,in this case Aplicante__c, i have created a VFP BUT the icon of lookup not appear ,

i want to make a select by name of the aplicante__c, and when i have the child required update this child, only the field Vacante__c on the object aplicaante__c, with the name or id of the actual parent, i dont know how is the lookup search if save the name of parent or id

im new in VF and apex

here is my code can someboby helpme?

 

actually  it run when i work with the field that is a lookup field, when i work with otre field example Name, not show me the lookup icon

only want search by a lookpup, of parent to child, and no like me code thar search of child to parent

 

public with sharing class MyCustomLookupController1 {
   
    public Aspirante__c aspirante {get;set;}

    public MyCustomLookupController1() {
    aspirante= new Aspirante__c();
    
    }
      
}

 my vfp

<apex:page controller="MyCustomLookupController1" id="Page" tabstyle="Contact">

  <script type="text/javascript"> 
  function openLookup(baseURL, width, modified, searchParam){
    var originalbaseURL = baseURL;
    var originalwidth = width;
    var originalmodified = modified;
    var originalsearchParam = searchParam;
    
    var lookupType = baseURL.substr(baseURL.length-3, 3);
    if (modified == '1') baseURL = baseURL + searchParam;
    
    var isCustomLookup = false;
    
    // Following "001" is the lookup type for Account object so change this as per your standard or custom object
    if(lookupType == "001"){
  
      var urlArr = baseURL.split("&");
      var txtId = '';
      if(urlArr.length > 2) {
        urlArr = urlArr[1].split('=');
        txtId = urlArr[1];
      }
      
      // Following is the url of Custom Lookup page. You need to change that accordingly
      baseURL = "/apex/CustomAccountLookup1?txt=" + txtId;
      
      // Following is the id of apex:form control "myForm". You need to change that accordingly
      baseURL = baseURL + "&frm=" + escapeUTF("{!$Component.myForm}");
      if (modified == '1') {
        baseURL = baseURL + "&lksearch=" + searchParam;
      }
      
      // Following is the ID of inputField that is the lookup to be customized as custom lookup
      if(txtId.indexOf('Name') > -1 ){
        isCustomLookup = true;
      }
    }
    
    
    if(isCustomLookup == true){
      openPopup(baseURL, "lookup", 350, 480, "width="+width+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", true);
    }
    else {
      if (modified == '1') originalbaseURL = originalbaseURL + originalsearchParam;
      openPopup(originalbaseURL, "lookup", 350, 480, "width="+originalwidth+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", true);
    } 
  }
</script>

<apex:sectionHeader title="Demo"  subtitle="Custom Lookup1" />

    <apex:form id="myForm">  
        <apex:PageBlock id="PageBlock">     
            <apex:pageBlockSection columns="1" title="Custom Lookup">
        <apex:inputField id="Aspirante__c" value="{!aspirante.Vacante__c}"  /> <!--i dont know how to work with other field that isn't lookup-->
            </apex:pageBlockSection>
        </apex:PageBlock>
    </apex:form>
       
</apex:page>

 

 

 

  • February 29, 2012
  • Like
  • 0

im exploring ways to make custom reports using apex and visualforce. are there visualforce components for charting that we can feed data from an apex controller? my few google searches have come up empty

Hi Friends,

 

     I want to develop a email template for email notifications. For that, we developed one visual force email template. We used html file for this template. In preview, page is coming good.

 

    But, verifying the mail by sending to my email (to verify the image), it is not properly coming. I have stored the images of the page in static resources of SFDC. To include those images, i used base url to display the images.

 

    But, in email, it is not coming properly. Alignment is missing.

 

   Pls help in this.

 

  Thanks for advance...

 

Regards,

Phanikumar

I've searched a bit and found some posts about using the IF statement within a VF page, but wasn;t clear about the possibility of using it for a simple display of a html page.

 

The controller is the standard ACCOUNT object.

All I need is something like this:

 

<apex:page standardController="account">
{!IF(isnull(account.JOB__c),"No Job","

<html>

some HTML coding here....

</html>"
)
}
</apex:page>

 The syntax is probably wrong, but I was wondering if this is possible.

 

Thanks in advance!

B

Hi, 

 

I am looking to pass the parameter passed through the URL ../apex/New_Lead?msg=test into a custom field called Web_Lead_Source__c.

 

Below is my code:

<apex:page standardController="contact" extensions="setValfromURL" >
Your page redirected from: {!message}<br/>
<!-- {!$CurrentPage.URL}<br/>-->
<!--{!$CurrentPage.parameters.msg}-->
<apex:sectionHeader title="New Lead"/>
<apex:form >
<apex:pageBlock title="Information" mode="edit">

<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Submit"/>
<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Contact Information">
<apex:inputField id="contactFirstName" value="{!contact.firstName}"/>
<apex:inputField id="contactLastName" value="{!contact.lastName}"/>
<apex:inputField id="contactPhone" value="{!contact.phone}"/>
<apex:inputField id="Source" value="{!contact.Web_Lead_Source__c}"/>
<apex:inputField id="Medium" value="{!contact.Web_Lead_Medium__c}"/>
<apex:inputField id="contactEmail" value="{!contact.email}"/>
<apex:inputText id="Source1" value="{!message}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

public class setValfromURL {
private ApexPages.StandardController controller;
public setValfromURL(ApexPages.StandardController controller) {
this.controller = controller;
}
public String getMessage(){
String a = ApexPages.currentPage().getParameters().get('msg');
return a;
}

 }

 

The first reference to {!message} works fine but the second reference to {!message} gives an error : Error: Read only property '[setValfromURL].message'

 

I am also able to use {!$CurrentPage.parameters.msg} to display the parameter value, but I am not able to pass it into the inputText.

 

Please advice.

Thanks,

Ritu

 

Hi,

 

I need to access Suggested tags(Restricted Tags) and dispaly it on my vf page, so that user will enter only those tags not random tags while uploading a content. I use that VF page to upload content to a Library.

 

 

Thanks,

Hi,

 

In a visualforce I used an autocomplete feature (in JQeury) for an input field and that works great.

It's based on a remote action define in my controller which is called by the javascript.

 

Now, I want to put my visualforce in an apex iframe but when the frame is shown, the warning message : "Javascript proxies were not generated for controller myController : may not use public remoted methods inside an iframe".

And my apex remote action is of course never called.....

 

Do someone has an idea to resolve that ?

 

Thanks in advance for your help.

 

 

  • November 21, 2011
  • Like
  • 0

I am new at coding and am probably way over my head. However I need to get this figured out.

 

Below is the code I have for a current visualforce page. I need to add a trigger that updates the opportunity master-detail lookup field with the id from the custom field opportunity name text.

 

Fields in Custom Object (Project)

Opportunity Name            Opportunity_Name__c      Lookup(Opportunity)

Opportunity name text     Opportunity_name_text__c     Formula (Text)--This formula was setup to pull the Opportunity id that I want the master detail lookup to relate to.

 

 

This visualforce page is setup for a cloning button of a custom object. Thank you for your help on this issue!

 

-->
<apex:page standardController="Milestone1_Project__c"
           extensions="Milestone1_Clone_Project_Controller">
           
    <apex:form >
        <apex:pageBlock title="Project Clone">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save"
                                    action="{!createClone}"/>
                <apex:commandButton value="Cancel"
                                    action="{!cancel}"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockSection columns="1">
                <apex:pageBlockSectionItem > 
                    <apex:outputLabel value="New Project Name"
                                      for="new_name"/> 
                    <apex:inputText id="new_name"
                                    value="{!dummyProj.name}"
                                    required="true"/> 
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            
        </apex:pageBlock>
    </apex:form>
           
</apex:page>

 btw, I received this coding from: Milestones PM - Project Planning and Task Management Application - Force.com Labs. They have a copywrite on the coding as is. However they do allow changes to the coding. I am adding this info because there is copywrite stuff on the visualforce page I pulled it from.

  • November 20, 2011
  • Like
  • 0

I have a Visualforce page which I have two versions of but the only difference is that one renders as a PDF.  On this one, the date does not appear.  I use the same code for the page that does not render as a PDF and the date appears without issue.  Any help would be great!  Thanks!

 

<apex:page renderas="PDF" standardController="Policy__c" showHeader="false" sidebar="false">
<p><b><font size="4">{!Policy__c.Name} - {!Policy__c.Insured__r.Name}</font></b></p>
<p><b><font size="2">Claim Check as of <script>
 var mydate=new Date()
    var year=mydate.getYear()
   
    if (year < 1000)
        year+=1900
   
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
   
    if (month<10)
        month="0"+month
   
    var daym=mydate.getDate()
    if (daym<10)
        daym="0"+daym
   
    document.write(month+"/"+daym+"/"+year)
</script></font></b></p>
<p></p>
<table border="1" cellspacing="2" cellpadding="10">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Policy__c.Claims1__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Assigned_Examiner2__r.Name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 11, 2011
  • Like
  • 0

Hi,

I need a button or link that would be on the contact page and show me all of that contact's Cases and related emails. Anyone have such a thing?

Thanks!

  • November 05, 2011
  • Like
  • 0

Hi

 

I've got a working search page in visualforce using apex controllers. It works fine in Salesforce user environmen, but I now want to make it visible on our website for others to us. 

 

I've got the page displayed in Sites and can see the page and interact ok with teh search filter boxes. My only issue is that the data is not displaying! I have amended the Public Profile so that the Apex code is enabled and the relevant Custom object is enabled for read only access. The data does not display however. It is linked to the Contacts object which has read access enabled as well.

 

Would it help to see the controller code?

 

I hope someone can help.

 

REgards

 

Justyn

  • November 02, 2011
  • Like
  • 0
I have a VF email template that displays the related list great. However, I want to supress the entire section (including the header) if there are no rows returned. How would I go about achieving this?
Here is the existing code.
Thanks
<messaging:emailTemplate subject="New Subscription for {!relatedTo.Account.Name}" recipientType="Contact" relatedToType="ServiceContract">
    <messaging:htmlEmailBody >


        <span class="sectionTitle">SUBSCRiPTION DETAIL</span><br/>
        <apex:panelGrid columns="2">
       
            <apex:outputLabel for="CustomerName" value="End Customer:"/>
            <apex:outputText id="CustomerName" value="{!relatedTo.Account.Name}"/>
            <apex:outputLabel for="CustomerID" value="Account ID:"/>
            <apex:outputText id="CustomerID" value="{!relatedTo.Account.Customer_ID__c}"/>
            <apex:outputLabel for="PONumber" value="PO Number: "/>
            <apex:outputText id="PONumber" value="{!relatedTo.PO__c}"/>
 
         </apex:panelGrid>

        <p>
            &nbsp;
        </p>  
           
<span class="sectionTitle">Support</span><br/>

<table border="0" cellspacing="0" cellpadding="4" class="list">
    <tr>
        <th>Serial Number</th>
        <th>Product</th>
        <th>Type</th>
        <th>Start Date</th>
        <th>End Date</th>
    </tr>
    <apex:repeat var="SN" value="{!relatedTo.ContractLineItems}">
       <apex:outputPanel layout="none" rendered="{!SN.PricebookEntry.Product2.License_Feature__r.Name  == Support'}">    
    <tr>
        <td> {!SN.Asset.Name} </td>
        <td> {!SN.PricebookEntry.Product2.Name} </td>
        <td> {!SN.PricebookEntry.Product2.Level__c} </td>                
        <td> {!month(SN.StartDate)}/{!day(SN.StartDate)}/{!year(SN.StartDate)} </td>
        <td> {!month(SN.EndDate)}/{!day(SN.EndDate)}/{!year(SN.EndDate)} </td>
    </tr>
       </apex:outputPanel>    
    </apex:repeat>
</table>

     
</messaging:htmlEmailBody>
</messaging:emailTemplate>