• sfdc guy.ax723
  • NEWBIE
  • 75 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 14
    Replies
Does anyone have more insight on the below topic:
-- "Amount" field (Standard field) on opportunity has label name "Amount" but it shows as "Asset" on Opportunity detail page. Similarly "Type" field (Standard field) label shows as "Transition Type" on Opportunity detail page. Why?

Linking a VF page to a custom button on the Case page seems like an easy task. I create a new custom button, created multiple VF pages to link the button to but when I choose "Visualforce Page" for the button's Content Source field none of my vf pages appear in the drop down. I have made sure that the pages are available to everyone (In the security section for your VF page). Is there something that I'm missing? Sorry if this is a really dumb issue but I know I must be overlooking something really basic.

 

 

Other than formulas and a few custom S-Controls, as well as some stuff I've yanked from you superstars on this board, I'm mostly a point-and-click type admin.

 

Few questions, just wondering if it's possible:

 

1) I'll start simple.

 

When I create a quote I have some text fields that I don't need displayed on the page when you "Create New", but want them on the regular layout as well as the Edit layout. Is this pretty easy with an override? Someone have some sample code on how to not include fields? 

 

2) Override Sort Products screen.

 

We often have to list the same product several times (as opposed to changing to Quantity 5, we sometimes actually have to list it 5 times).

 

This makes sorting products difficult because all we can see is the Product Name field -- and in this case, it would all read "Product X" which doesn't help us differentiate.

 

If I could amend the Sort table to include a custom field, or the opp line item description, our problems would be solved. Any ideas? I asked the experts about this at Dreamforce and seemed to have stumped them pretty good.

 

THANKS SFDC!

I have the following page that is called from a Button on a list view.

 

<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity">
    <apex:form >
        <apex:sectionHeader title="Opportunity Management" subtitle="Mass Edit Opportunities (Beta)"/>
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}" immediate="true"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="opp">
                <apex:repeat value="{!$ObjectType.Opportunity.FieldSets.OpportunityMassEditFieldSet}" var="f">
                    <apex:column headerValue="{!$ObjectType.Opportunity.Fields[f].label}"><apex:inputField value="{!opp[f]}" /></apex:column>
                </apex:repeat>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

The page displays properly and when I click save the Opportunities that were displayed save correctly. However it appears that when the save occurs, the records are saved one at a time rather than saving multiples at at time.

 

It looks like the controller executes in the following manner:

 

for (Opportunity x : opportunities){

     update x;

}

 

raher than

 

update opportunities;

 

Can someone confirm if this is the expected behavior?

 

Thanks sfdc guy

 

I am trying to use Dynamic Field Binding with in a datatable.

 

I want to send a List of Tasks from a query to a datatable to be rendered, but be able to add columns to the table using a fieldset defined in Task Field Sets.

 

Here is my code:

 

<apex:dataTable cellspacing="2" value="{!Tasks}" var="ta" rendered="{!HasActivities}" id="Results3" rowClasses="odd,even">
        <apex:column headerValue=""><apex:outputLink value="/{!ta.Id}" target="_blank">View</apex:outputLink></apex:column>
        <apex:column headerValue=""><apex:outputLink value="/{!ta.Id}/e?" target="_blank">Edit</apex:outputLink></apex:column>

        <apex:repeat value="{!$ObjectType.Task.FieldSets.TaskMassEditFieldSet}" var="f">
              <apex:column headerValue=""><apex:inputField value="{!ta.[f]}" /></apex:column>
        </apex:repeat>
</apex:dataTable>

 

!Tasks is my list of Tasks.

 

When I try to save the page I get an "Invalid field for SObject Task" Error


 

Is this possible?

 

Thanks in advance for any help.

I have a standatrd page layout with a visualforce page placed in a section. The page renders fine when I am in "View Detail" mode. I have 2 issues

 

1: When I click "Edit" the embedded visual force page does not render, it disappears. Is this supposed to happen?

2: When in view mode for the page the embedded vf page is in "edit". is there a way to have the embedded vf page follow the view / edit modes?

 

here is my vf page info:

<apex:page standardController="Account">
    <apex:form>
        <apex:pageBlock>
        <apex:pageBlockSection>
            <apex:inputField value="{!account.ShippingStreet}"/>
            <apex:inputField value="{!account.BillingStreet}"/>
            <apex:inputField value="{!account.ShippingCity}"/>
            <apex:inputField value="{!account.BillingCity}"/>
            <apex:inputField value="{!account.ShippingState}"/>
            <apex:inputField value="{!account.BillingState}"/>
            <apex:inputField value="{!account.ShippingPostalCode}"/>
            <apex:inputField value="{!account.BillingPostalCode}"/>
            <apex:inputField value="{!account.Shipping_Country__c}"/>
            <apex:inputField value="{!account.Billing_Country__c}"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Thanks for your help.

 

Does anyone have more insight on the below topic:
-- "Amount" field (Standard field) on opportunity has label name "Amount" but it shows as "Asset" on Opportunity detail page. Similarly "Type" field (Standard field) label shows as "Transition Type" on Opportunity detail page. Why?

Hey there and thank you for reading this.

 

I have a VForce page that uses a standard controller from a detail record.

 

I'm trying to access details of the Master record from this Detail record but I'm having trouble. I've been able to go the other (from master to detail). Here is the code snippet for that:

 

 

<apex:page standardController="Budget__c" showHeader="false" sidebar="false">  
.
.
.
<apex:dataTable value="{!Budget__c.Budget_Products__r}" var="bprod" cellPadding="5" border="1"> 
.
.
.
.


 

 

I can't figure out how to go the other way or whether or not it's even possible:

 

<apex:page standardController="Budget_Product__c" showHeader="false" sidebar="false">
.
.
.
<apex:param value="{!Budget_product__c.Budgets__r.Name}" />
.
.
.

 

This may or may not be clear. Again thank you for your help and any insight you can provide.

 

 

Cheers,

Will

 

 

  • February 04, 2011
  • Like
  • 0

Linking a VF page to a custom button on the Case page seems like an easy task. I create a new custom button, created multiple VF pages to link the button to but when I choose "Visualforce Page" for the button's Content Source field none of my vf pages appear in the drop down. I have made sure that the pages are available to everyone (In the security section for your VF page). Is there something that I'm missing? Sorry if this is a really dumb issue but I know I must be overlooking something really basic.

 

 

Other than formulas and a few custom S-Controls, as well as some stuff I've yanked from you superstars on this board, I'm mostly a point-and-click type admin.

 

Few questions, just wondering if it's possible:

 

1) I'll start simple.

 

When I create a quote I have some text fields that I don't need displayed on the page when you "Create New", but want them on the regular layout as well as the Edit layout. Is this pretty easy with an override? Someone have some sample code on how to not include fields? 

 

2) Override Sort Products screen.

 

We often have to list the same product several times (as opposed to changing to Quantity 5, we sometimes actually have to list it 5 times).

 

This makes sorting products difficult because all we can see is the Product Name field -- and in this case, it would all read "Product X" which doesn't help us differentiate.

 

If I could amend the Sort table to include a custom field, or the opp line item description, our problems would be solved. Any ideas? I asked the experts about this at Dreamforce and seemed to have stumped them pretty good.

 

THANKS SFDC!

I have a dynamic visualforce page where users will develope a list of records from three picklists. Once the user renders a list of records the user needs to open the page up in excel.

 

I have tried to create a extension to transfer the variables from the picklists to the new visualforce page, but have not been able to?

 

From a theoretical point, what do I need to do?

Hi,

 

I have been struggling with this all day. I'm just trying to get the value that was selected in a SelectList, and use it to do some DML stuff. I don't need to do an ajax request and print back to the screen (that seems to be what all of the code snippets out there are doing).

 

Here's the VF page:

 

<apex:page controller="SelectPricebookController" action="{!pageLoad}" showHeader="false" sidebar="false" title="Select Price List">
    <div class="opportunityTab" style="margin:15px;">
        <apex:form id="TheForm">
        <apex:sectionHeader title="Opportunity" subtitle="Select Price List"/>
        <div class="bDescription"></div>
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Price Book" for="ddlPriceBooks"/>
                    <apex:selectList id="ddlPriceList" size="1" multiselect="false" value="{!priceList}" title="Select a Price List">
                    	<apex:selectOptions value="{!lists}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Select" action="{!savePriceList}" immediate="true"/>
            </apex:pageBlockButtons>
        </apex:pageBlock> 
        </apex:form>
    </div>
</apex:page>

 

 

and here's the controller:

 

public with sharing class SelectPricebookController {


    private Opportunity opp;
    private Account acc;
    private Boolean isDirect = true;
    private String[] optionsToAdd;

    public String pList;
    
    
    public String getPriceList() {
        return pList;
    }

   public void setPriceList(String p) {
       System.Debug('================================== Set priceList: ' + p);
        this.pList = p;
    }
    
    public PageReference pageLoad(){
        //Get the Opportunity based on the query param
        String OppID;
        if (ApexPages.currentPage().getParameters().get('OppID') != null){
            OppID = ApexPages.currentPage().getParameters().get('OppID');
            
            opp = [Select Purchase_Channel_Account__c, Name, AccountId, Price_List__c from Opportunity where ID = :OppID Limit 1];
            
            //Gets the correct account. If the Purchase Channel account is null,
            //it will get the primary account.
            //If not, it will get Purchase Channel Account
            if (opp.Purchase_Channel_Account__c != null){
                acc = [Select NAME, Available_Direct_Price_Lists__c, Available_Channel_Price_Lists__c from Account where ID = :opp.Purchase_Channel_Account__c  Limit 1];
                isDirect = false;
            }
            else{
                acc = [Select NAME, Available_Direct_Price_Lists__c, Available_Channel_Price_Lists__c from Account where ID = :opp.AccountId  Limit 1];
            }

            System.debug('Opportunity ID======================================================> ' + opp.id);
            System.debug('Accout ID======================================================> ' + acc.id);
            
            //Gets the available price lists from the account
            String[] lists;
        
            if(isDirect){
                lists = acc.Available_Direct_Price_Lists__c.split(';');
            }
            else{
                lists = acc.Available_Channel_Price_Lists__c.split(';');
            }
                        
            //If there is only one option, just update the opp and redirect
            //Else, show the user a list to pick from
            if(lists.size() == 1){
                optionsToAdd = lists;
                return updateOpp(lists[0]);
            }
            else{
                optionsToAdd = lists;
                return null;
            }
        }
        else{
            //TODO: Handle Exception
            return null;
        }
    }
    
    public List<SelectOption> getLists(){
        List<SelectOption> options = new List<SelectOption>();
        
        for (Integer i = 0; i < optionsToAdd.size(); i++){
            System.debug('Options======================================================> ' + optionsToAdd[i]);
            options.add(new SelectOption(optionsToAdd[i],optionsToAdd[i]));
        }
        
        return options;
    }
    
    public PageReference savePriceList(){
        System.debug('============== pricelist: ' + pList);
        return updateOpp(pList);
    }
    
    private PageReference updateOpp(String p){
        opp.Price_List__c = p;
        System.debug('====================== Updated pricelist to: ' + p);
        update opp;
        
        PageReference pageRef = new PageReference('/' + opp.Id);
        pageRef.setRedirect(true);
        return pageRef;
    }
}

 

 

As you can see, I have a public string variable to hold the value, a getter and a setter. Then I try to use the variable in the savePriceList method. However, it's always null.

 

Thanks for the help!

Hi All,

 

I am facing some problem on new RTF field feature provided on Spring 11 upgrade.

 

So I created a Text Area (Rich) field on one of our custom objects. Lets say object name is cusomtObject__c and field name is RTFTest__c,

 

I tried binding this text area field on the visual force page with input field tag. However whatever I am entering on it, while submitting the form that value doesn't get passed to the server and on the record empty string ("") gets saved as value of RTFTest__c field.

 

Does anyone have any idea why is this happening ?

 

Thanks & Regards,

Anand Agrawal.

Hi All,

 

I am new to VisualForce and I am still going through some testing with it to get more familiar. I am making a simple page where the user will enter a contact name and a list of all contacts that match the criteria will be displayed (in a dataTable). I setup my custom controller and wrote some VF markup for the page but I am getting the following error: 
Error: Could not resolve the entity from <apex:inputField> value binding '{!accountName}'. inputField can only be used with SObject fields.

 

I'm not sure what this means. My sample code is below. Does anyone have any suggestions?

 

 

Custom Controller

 

public class CardholderVfController {
    private String accountName;
    private List<String> accountList;
    private String contactName;
    private List<String> contactList;
    private final Case c;  
    
    //public CardholderVfController(ApexPages.StandardController stdController)
    //{
        //this.c = (Case)stdController.getRecord();
        //accountList = new List<String>(new String[] {'Test1', 'Test2'});
    //}
    
    public List<String> getAccounts()
    {
        accountList = new List<String>(new String[] {'TestAccountText1', 'TestAccountText2'});
        return this.accountList;
    }   
    
    public List<String> getContacts()
    {
        return this.contactList;
    }
    
    public void setAccountName(String s)
    {
        accountName = s;
    }
    
    public String getAccountName()
    {
        return this.accountName;
    }
    
    

}

 Page Markup

 

<apex:page controller="CardholderVfController">
<apex:form >
    <apex:pageBlock > 
    <apex:pageBlockSection >
        <apex:inputField id="accountNameField" value="{!accountName}"/>
        <apex:commandButton id="findAccount" title="Search"/>
    </apex:pageBlockSection>
    <apex:pageBlockSection >
            <apex:dataTable align="center" value="{!accounts}" var="a" >
                <apex:column value="{!a}"/>
            </apex:dataTable> 
    </apex:pageBlockSection>            
    </apex:pageBlock>
    {!accounts[0]}
</apex:form>
</apex:page>

 

 

 

We are looking to create a force.com app for my company but we have one very important requirement.  We have projects that are related to tasks.  Those two objects each contain data that is needed to fill out a PDF form. 

 

We have data on the following objects that would be used to automatically fill out the form:

Accounts

Contacts

Projects (Custom Object)

Tasks (Custom Object)

Each of the above are linked in VF.

 

Any ideas on how to do this?

Hi,

 

I have created a VF page that has Standard Contoller="Account" and a controller extension.

I have a button called "New Contact" on that page and when clicked should take them to the New Contact creation page with "Account Name" populated in it.

 

This is how the URL would look like:

https://na7.salesforce.com/003/e?retURL=%2F001A00000083F5b&accid=001A00000083F5b

 

The coloured part being the ID of account.

 

For the same to happen from my visualforce page i have created and passed the query parameters, but its not behaving the way it should.

Can anybody help me with where i am going wrong?

 

VF Page:

<apex:page standardController="Account" extensions="contactRelatedList" >
    <apex:form >
        <apex:PageBlock title="Contacts">
            <div style="Position:Relative;Left:400px">
                <apex:CommandButton Value="New Contact" Title="Create a New Contact" action="{!newContact}" /> 
                <apex:CommandButton Value="Merge Contacts" Title="Merge Duplicate Contacts"/>
            </div>
            
        </apex:PageBlock>  
    </apex:form>
</apex:page>

 

Controller Extension:

public class contactRelatedList {
    
    List<Contact> activeContacts=New List<Contact>();
    String AcctId;
    String returnurl;
    public contactRelatedList(ApexPages.StandardController controller) {
         
         AcctId= Apexpages.CurrentPage().getParameters().get('Id'); 
        // returnurl= '%2F'+AcctId+'&accid='+AcctId;
           returnurl=AcctId+'&accid='+AcctId; 
         activeContacts=[Select Name,Title, Email, Phone From Contact Where 
                                                                       AccountId=:Apexpages.CurrentPage().getParameters().get('Id')];
                                                                       

    }
    
    Public List<Contact> getactiveContacts(){
    
        return activeContacts;
    }
    
    Public PageReference newContact(){
        System.Debug('Return URL=='+returnurl);
        PageReference newcontactref=New pageReference('https://na7.salesforce.com/003/e');
        newcontactref.getParameters().Put('retURL',returnurl);
       return newcontactref;
    }

}

 

 

In the debug log i get the value as expected, but when passing it as query parameter i get it this way:

https://na7.salesforce.com/003/e?retURL=001A00000083F5b%26accid%3D001A00000083F5b

 

I see that Characters "&" and "=" are having those values that are coloured in red.

 

Thanks,

Sales4ce

Just trying out the new Spring 11 functionality, and had a question I am hoping someone might know..

 

I can get field sets to work as input or output fields.

 

I can get Inline editing to work as advertised.

 

But is it possible to output a set of fields from a field set and have those fields enabled to use inline editing? I have tried to combine the various examples but with no success - is it possible and if so, can someone give me an example?

 

For instance, it looks from the Spring Webinar that this should work if I pass in a Contact Id into the page...

 

 

<apex:page standardController="Contact" >
<apex:sectionHeader title="Inline for {!contact.Name}"/>
<apex:form>
 
<apex:pageMessages/>
<apex:pageBlock>
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:repeat value="{!$ObjectType.Contact.FieldSets.TestFS1}" var="f">
<apex:outputField value="{!Contact[f]}">
<apex:inlineEditSupport event="ondblclick"/>
</apex:outputField> 
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

Many thanks