• ram4SFDC
  • 14 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 11

What is the difference between the two statments?


Decimal total = 0;
Decimal amt;


total = total+amt==null?0:amt; // why does this statement throw "argument 1 cannot be null" exception


total = total+(amt = amt==null?0:amt);// why does this statement work



We have created sites in salesforce to login into customer portal. After login, sites redirects the user to customer portal successfully. Once inside customer portal when the user clicks on Logout, the user is logged out and redirected to sites login page.All is fine untill here. After logout the user is redirected to http:// protocol. After this when user tries to login, the page does not react to click of the logon. Why is the user redirected to http:// rather than https:// when the login is via https://.


I'm using the following VF to display a number of fields in two columns on a page layout:

<apex:page standardController="CW_Order_Line__x" extensions="OrderLine_ShipToInfoCtrlExt" readOnly="true">
<apex:pageBlock >
<apex:pageBlockSection columns="2">
<div class="row">
<div class="col-md-6">
<apex:outputField label="Name" value="{!shipToInfo.Name__c}"/>
<apex:outputField label="Address" value="{!shipToInfo.Ship_to_Address__c}"/>
<div class="col-md-6">
<apex:outputField label="Day Phone" value="{!shipToInfo.Ship_to_Day_Phone__c}"/>
<apex:outputField label="Night Phone" value="{!shipToInfo.Ship_to_Night_Phone__c}"/>
<apex:outputField label="Email" value="{!shipToInfo.Ship_to_Email__c}"/> </div>

I am getting the data displayed in two columns but the fields are being rendered aphabetically rather than as specified in the code above.

What I'm getting is:

Column 1: Address, Day Phone, Email
Column 2: Name, Night Phone

What I want is:

Column 1: Name, Address
Column 2: Day Phone, Night Phone, Email

Thanks in advance!
trigger Sales_Invoice_Custom_Trigger on c2g__codaInvoice__c (before insert, before update) {
    // if this SIN is getting inserted
    if( Trigger.isInsert ) {
        for(c2g__codaInvoice__c SIN : Trigger.new)
    // if this SIN is getting updated
    if( Trigger.isUpdate ) {
        for(c2g__codaInvoice__c SIN : Trigger.new)
            //check that it has a Sales Order*
            if(SIN.Sales_Order__c != null)
            //get the SIN Outstanding Value
            decimal SINov = SIN.c2g__OutstandingValue__c;
            //query and update the Sales Order*
            Sales_Order__c SalesO = [SELECT Id FROM Sales_Order__c WHERE Id = :SIN.Sales_Order__r].Id;
            SalesO.Outstanding_Value__c = SINov;

I am having a problem with the acutal update of the Sales_Order__c record.  Any advice is appreciated, still learning APEX.


i have a vf page for my contract object and how do i get sharing button on to this vf page , i have tried the way how i gave edit and save but it does not work . And one more thinng i can see sharing button on my standard page

  • May 10, 2012
  • Like
  • 0

I have created a tab called 'My Tab' that's linked to visualforce page /apex/MyVFPage. I can probably get url to this page using PageReference and partial page logic for /apex/MyVFPage. However, is there any better way to the url, may be using tab name?



It was working fine before but the date fields stopped showing the nice popup calendar on sites now..!!!!!!!!!!!!!!!!!! please help???!!!

I know we can set the content-type header in visualforce using the contenttype attribute for <apex:page>, but can we set Content-Disposition?  E.g.





I have an IF statement that needs to read


"New monthly rate going forward is $1,000.00"


My formula is


IF(ISBLANK( Custom_Description__c ),
"" ,
"New monthly rate going forward is" &""& Opportunity__r.Current_Monthly_Revenue__c)


but the Opportunity__r field is a currency field and the formula Error says "Incorrect parameter for function &(). Expected Text, received Number


Thank you in advance

  • July 12, 2010
  • Like
  • 2

I just want to create a simple VF page that includes logic to message a salesperson when the Opp Stage = Won. The messaging works fine, but when I rerender the pageblock based on a stage update, the forecast category and probability do not update along with the stage. This doesn't make sense to me, I'm using the standard opp controller, and the stage is tied to the forecast category and probabily.


Does anyone know why the forecastcategoryname field and probability field would not update on a visualforce page when the stageName field is updated, and rerenders the pageblock?


<apex:page standardController="Opportunity" sidebar="false" extensions="OppWonExtension"> <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/> The opportunity amount is the sum of the related products. To edit the total amount, you must first delete all of the products from the opportunity. <apex:form > <apex:pageBlock title="Edit Opportunity" id="PageBlock1" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:actionRegion > <apex:pagemessage severity="confirm" strength="3" summary="{!DealsheetMessage}" rendered="{!DealsheetMessage != ''}"> </apex:pagemessage> <apex:pageBlockSection title="Opportunity Information" columns="2" id="OppInfo"> <apex:inputField value="{!opportunity.name}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="Stage"/> <apex:outputPanel > <apex:inputField value="{!opportunity.stageName}"> <apex:actionSupport event="onchange" rerender="PageBlock1" status="status"/> </apex:inputField> <apex:actionStatus startText="applying value..." id="status"/> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:inputField value="{!opportunity.account.name}"/> <apex:inputField value="{!Was_This_Revised__c}"/> <apex:inputField value="{!opportunity.CLA_Type__c}"/> <apex:inputField value="{!opportunity.type}"/> <apex:inputField value="{!opportunity.Parent_Opportunity__c}"/> <apex:inputField value="{!opportunity.House__c}"/> <apex:inputField value="{!opportunity.closedate}"/> <apex:inputField value="{!opportunity.probability}"/> <apex:inputField value="{!opportunity.forecastcategoryname}"/> <apex:inputField value="{!opportunity.amount}"/> </apex:pageBlockSection> </apex:actionRegion> </apex:pageBlock> </apex:form> </apex:page>


Message Edited by SteveOC on 04-21-2009 04:04 PM
Message Edited by SteveOC on 04-22-2009 01:49 PM
Message Edited by SteveOC on 04-22-2009 04:44 PM
Message Edited by SteveOC on 04-22-2009 04:45 PM
Message Edited by SteveOC on 04-22-2009 04:45 PM
Message Edited by SteveOC on 04-22-2009 04:46 PM
Message Edited by SteveOC on 04-23-2009 09:41 AM
Message Edited by SteveOC on 04-23-2009 09:41 AM

Am I allowed to pass a parameter from my visualforce page to a controller method?

I want to create a method which returns boolean TRUE or FALSE depending on if the related list contains any records. I'm trying to avoid creating 15-20 get/set methods.


VisualForce Page Segment:
<apex:page standardController="Account" extensions="AccountHiddenListControllerExtension">
        <apex:relatedList list="contacts" rendered="{!doesRelatedListExist('contacts'}">>
        <apex:relatedList list="ActivityHistories" rendered="{!doesRelatedListExist('ActivityHistories'}">>

Controller class:
    public boolean doesRelatedListExist(String listName)

        if (listName.equals('contacts'))
            return ((this.getContactList().size()) > 0);
        if (listName.equals('ActivityHistories'))
            return ((this.getActivityHistoriesList().size()) > 0);

        // default value
        return true;


The controller saves correctly; however, i get the following error message when saving the visualforce page:
Error: Unknown function doesRelatedListExist. Check spelling. 

Thanks in advance.

Message Edited by wsthesis on 12-25-2008 06:26 PM