• vanessen
  • NEWBIE
  • 230 Points
  • Member since 2010

  • Chatter
    Feed
  • 5
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 14
    Questions
  • 118
    Replies
Hi All,
I am getting Parameter_Tampering Issue in my apex code when i submit package for security review.It is coming specifically when i use string.escapeSingleQuotes(variable) to avoid SOQL-SOSL injection.

Do any one have idea about How to get rid of this issue.It ll be more helpful to me.

Thanks,
Rajesh.
  • January 09, 2014
  • Like
  • 0

Hi,

 

I am new to Salesforce programming. Please help me with my problem.

 

I have a code that update the value of Email_Sent__c after clicking a custom button.

=================================================================

{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
var camp= new sforce.SObject("Campaign");
camp.id= "{!Campaign.Id}";
camp.Email_Sent__c ="true";
try {
resultGo = sforce.connection.update([camp]);
if(!resultGo[0].getBoolean("success"))
{
window.alert(resultGo[0]);
}
window.location.href = window.location.href;
} catch (e)
{
window.alert(e);
}

 

 

My problem is, I created a new field Email_Sent_Date__c in a Date/Time type,  I want also this button to supply the current date and time once clicked. I did below code but returned me an error.

===========================================

{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
var camp= new sforce.SObject("Campaign");
camp.id= "{!Campaign.Id}";
camp.Email_Sent__c ="true";

camp.Email_Sent_Date__c=sysdate();
try {
resultGo = sforce.connection.update([camp]);
if(!resultGo[0].getBoolean("success"))
{
window.alert(resultGo[0]);
}
window.location.href = window.location.href;
} catch (e)
{
window.alert(e);
}

 

 

 

 

Thanks in advance.

Del

Hi Guys,


I have a Lead custom field called Country (look up)

When I convert the lead the field is mapped  to the Account Country (look up)

the question is:


I have created a 2nd Country look up, the purpose is when converting  the lead the "Country"  info will go to the Contact too!!

I need a trigger that updates Country2__c with the same info I have in Country__c

 

1 object : LEADS

2 fields : .Country__c & Country2__c

Expected result: get autopopulated Country2__c with the same value as Country__c



I have written this:



trigger UpdateCountry2 on Lead ( before update, after insert) {

  List<String> conList = new List<String>();
  for (Lead n:Trigger.new){
    conList.add(n.Country__c);
  }
  
  List<Lead> leadList= [SELECT Id, Name, Country__r.Id FROM Lead WHERE Id in :conList];
  
  Map<ID, Id> nameToId = new Map<Id, Id>();
  for(Lead c : leadList) {
    nameToId.put(c.id, c.Country__r.Id);
  }
  
  for (Lead n:Trigger.new){
  n.Country2__c = nameToId.get(n.Country__c);
  }
    }

 

 

But it does not work!! any ideas!!! Thank you

  • October 06, 2011
  • Like
  • 0

Hi,

 

Does anyone have some jump-start code for the following requirement.

 

I want to have a VF page that contains two date fields.  The user will select a date range and click ok.


Those two field values must feed a query that will pull all opportunities within that date range.

 

I will do some logic (I can handle this, I hope) to build two lists from the initial results produced from above.

 

I will produce a final number that I want to display on that same VF page below the two fields.

 

The result is that I want to have this VF page on a dashboard so that the user can dynamically get the final number.

 

 

In Summary:

pass to field values on vf page to apex class

include those values in the query dynamically

return a value to the same vf page

 

 

Is this possible and does anyone have any subset of starter code for such a task?

 

 

 

The final number that I want cannot be derived from SFDC reports because I am trying to get the ratio of what two fields that are text fields.  One field is sold and the other is offered.   I am focusing on a single product that is offered but not sold.  These fields are multi-picklists so I figured I would have to do something like I am asking above as a work-around.

 

Hi,

 

I was trying to display the subtotal of product price for each product family.eg:A

A------- Product Family

a1-Product   p1-Price for product1

b1-Product2 p2-Price for product2

-----------------------

                         p3-Subtotal

B-Product family

b1-Product   p1-Price for product1

b2-Product2 p2-Price for product2

-----------------------

                         p3-Subtotal

 

I tried using Group By clause like this

 

for(QuoteLineItem Qli1:[select SUM(SubTotal),ProdFamily__c from QuoteLineItem where QuoteId = :quoteid GROUP BY (ProdFamily__c)])
        {
            amttt= amttt + Qli1.SubTotal;
          
        }  

But It is showing

Loop variable must be an SObject or list of AggregateResult error.please help me in this

  • November 30, 2010
  • Like
  • 0
I created a custom object and activated history tracking on that object. On my page layout, im displaying the history related list, but in salesforce1 it is not showing up. Does anybody know why? I didn't find any restriction on this for salesforce1 version.
Hello,
I am having a problem actually when double tap a field in a visualforce page on salesforce1 running on IOS. The keyboard appear but no characters appear in the textbox. Its like it lose the focus, but the cursor mark still blink. Its very strange but very blocking for my client too. But when i try to simulate this on the standard pages, it work fine. The problem is not css either, because i removed all CSS on my field and try again same result. I tried using javascript to detect double tap and set focus again on the field, but no success.
Does anyone came across this issue?
 
Im actually deserialising a json string and i'm getting this error. Does anyone know how to protect my json string before serialisation ?
On my vf page running in IOS (salesforce1), when I type in a search box, i execute a search and display a list of accounts, but when we moved to winter 15 or new version of salesforce1 for IOS, when i clicked in the search box, it proposes natively some text. I have to click on done to hide the keyboard which take much of my screen. But when i do this, my page become blank. Doest anyone having this issue?
HI all,
The problem i'm facing right now is that i need to go to my created record (publisher action using vf), and the previous screen is not my newly created record. Thus, how can i achieve this with the publisher action ? using the sforce navigation it works, but sforce navigation do not work with publisher action. Does anyone has a solution? Im currently working on salesforce1 app.
Thanks.
When trying to pass security review, I am getting this error, and there is no place where thsi is explained, but the error occur at the folllowing line :
for(Product_Resource_Category__c prc : [select Resource_Category__c,Resource_Category__r.Name,DT__c,OT__c,RT__c,TT__c,Quantity__c,Main_Resource__c
             from Product_Resource_Category__c
             where Product__c =:itemMap.get(ticketLine.Item__c).Product__c])
   {
    ......
    }

I noticed that , rerenderinf do not work, when the field is required , anyone know why is it the case ?

 

<apex:outputPanel id="header01"  layout="block" styleClass="pbHeader">            
                 <table class="detailList" cellspacing="0" cellpadding="0" border="0">                           
                    <tr>
                       <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Name.label}</td>
                        <td class="dataCol" style="width:70%">
                             <div class="requiredInput">
                                <div class="requiredBlock"></div>
                                 <apex:selectList id="dom" value="{!selectedDomaine}" size="1" onchange="RefreshHeader();">
                                      <apex:selectOptions value="{!DomaineList}"/>
                                 </apex:selectList>
                                 <apex:actionFunction name="RefreshHeader" immediate="true" action="{!Refresh}" rerender="header01" status="myStatus" />
                              </div>
                          </td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Type__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Type__c}" /></td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Article__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Article__c}"/></td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Nom__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Nom__c}" required="true"/></td>
                    </tr>  
                </table>          
           </apex:outputPanel>

 

if i remove the required=true part, the rerendering works fine. Is this a salesforce bug?

I do not know why static resource call via URLFOR seems not to be supported in javascript invoke button, whereas the function is available for use.Have anyone used another method to get the url of a static resource in javascript invoke button?

Does standard functionality allow the configuration of which fields to appear in the dialogue box of the new account section on the search layout of an account page? currently the compulsory Name field and the billing address fields appear.

 i want to display an standard salesforce page in an iframe in my vf page.Im passing a parameter in my link to show only the page without sidebar and header....but the page shows in a different style.


 <apex:iframe src="/{!dossierConcours.Id}?isdtp=mn" scrolling="true" id="theIframe" /> where the isdptp=mn will show the page without sidebar but the problem is not about css, but to render the page in the current version of salesforce

i don't know why..but the parameters i am passing in my apex:outputText are not rendered correctly.

 

here is the code:

 

<apex:outputText value="{!secondPageSection4}" escape="false">
  <apex:param value="{!s.NombreCartePapier}"/>        
         <apex:param value="{!s.NombreCarteElectronique}"/>
         <apex:param value="{!s.salonInfo.DroitInscriptionTTC__c}"/>
         <apex:param value="{!s.salonInfo.FraisAssuranceTTC__c}"/>
         <apex:param value="{!s.totalTTC}"/>   
 </apex:outputText>
but it is rendered as this :
Nombre de carte papier 100
Nombre dinvitation {1}
Montant {2} TTC
Montant {3} TTC
Total {4}
the other params are not evaluated.
the content of the outputText is :
<p>
<p>Nombre de carte papier {0}</p>
<p>Nombre dinvitation {1}</p>
<p>Montant {2} TTC</p>
<p>Montant {3} TTC</p>
<p>Total {4}</p>
</p>
Any idea about it?

 

For my case,i have to integrate salesforce with magento which uses a wsdl with format RPC/encoded.

I have the architecture of the wsdl, and i also have the url which end with the extension wsdl.

As salesforce do not understand RPC/encoded , i was skipping the part of wsdl2Apex and i am trying the HTTP callout as suggested but many user, but i do not know where to start.I need to call a method from the wsdl with 3 parameters a username,a pwd and an id ,and expect to get a list of info.

 

 So my questions are:

 

1. which url to use for the endpoint? the same as wsdl soap:address e.g http://192.168.1.31/soap/xx_reservation.php or to the wsdl itself : http://arianetest.smartbox.com/soap/xx_reservation.wsdl??

 

2. How do i call the method from HTTP Callout???

 

3. How do i pass a parameter to the function call??

 

thanks in anticipation for future replies.

I am sending an email from apex using an email template.I can specify the object to use by my email template for the recipientType (by using the setTargetobjectId method) but how can i specifty the object to be used by my emailTemplate for the relatedTo

 

 

 

my code is the following:

 

if (!templateList.isEmpty() && userIds.contains(caseMap.get(t1.WhatId).OwnerId)){

 

 

//there is a template to be used

 

mail.setTargetObjectId(caseMap.get(t1.WhatId).OwnerId);

 

mail.setSaveAsActivity(false);

 

mail.setWhatId(caseMap.get(t1.WhatId).Id);

 

mail.setTemplateId(templateList[0].Id);

 

 

}

Hi all,

I am grouping records by date and on the final i have a list of records...i know how to retrieve the number of total record just by using rowcount but i do not know how to retrieve the number of groups (by date)..i have no COUNT formula available only SUM,AVG ,MAX and MIN is available....why there is no COUNT....and there a way i can get this...

HI all,
The problem i'm facing right now is that i need to go to my created record (publisher action using vf), and the previous screen is not my newly created record. Thus, how can i achieve this with the publisher action ? using the sforce navigation it works, but sforce navigation do not work with publisher action. Does anyone has a solution? Im currently working on salesforce1 app.
Thanks.
I have developed new Modal using lightning desing system.In standard modal new button pop up appears on whole broweser lightning page. But when I desgined using SLDS it will come up but still salesforce header bar is accesible which will display on my modal component

standard way :
User-added image

SLDS Modal :
User-added image

Component Code :
<aura:component controller="QuickInvestorController" implements="force:appHostable">
   
        <div class="slds-modal slds-fade-in-open" style="display:none;" aria-hidden="false" role="dialog" id="QuickInvestor_modal">
            <div class="slds-modal__container">
                <div class="slds-modal__header">
                    <h2 class="slds-text-heading--medium">Quick Investor</h2>
                    <button class="slds-button slds-button--icon-inverse slds-modal__close" onclick="{!c.showModalBox}">
                        <c:svg class="slds-button__icon slds-button__icon--large"
                               xlinkHref="/resource/SLDS/assets/icons/action-sprite/svg/symbols.svg#close"
                               ariaHidden="true"
                               />
                        <span class="slds-assistive-text">Close</span>
                    </button>
                </div>
                <div class="slds-modal__content slds-p-around--medium">
                    <div class="form-element__group">
                        <div class="slds-form-element__row">
                            <div class="slds-form-element slds-size--1-of-2">
                                <ui:inputText aura:id="newinvestor" label="Investor Contact Role"
                                              labelClass="slds-form-element__label" class="slds-input"/>
                            </div>
                            <div class="slds-form-element slds-size--1-of-2">
                                <ui:inputSelect aura:id="newinvestor" labelClass="slds-form-element__label"
                                                required="false" class="slds-input" label="Default Email">
                                    <ui:inputSelectOption text="Work1" label="Work1"/>
                                    <ui:inputSelectOption text="Work2" label="Work2"/>
                                </ui:inputSelect>
                            </div>
                        </div>
                    </div>
                    <div class="form-element__group">
                        <div class="slds-form-element__row">
                            <div class="slds-form-element slds-size--1-of-2">
                                <ui:inputText aura:id="expname" label="Account Name"
                                              class="slds-input" labelClass="slds-form-element__label"   value="{!v.quickinvestor.Name}"
                                              required="true"/>   
                                
                            </div>
                            <div class="slds-form-element slds-size--1-of-2">
                                <ui:inputNumber aura:id="expname" label="Email Salutation"
                                                class="slds-input"
                                                labelClass="slds-form-element__label"
                                                value="{!v.quickinvestor.Email_Salutation__c}"
                                                required="true"/>       
                            </div>
                        </div>
                    </div>
                    <!-- -----------Fields --------------------------------->
                            </div>
                        </div>
                    </div>
                </div>
                <div class="slds-modal__footer">
                    <button class="slds-button slds-button--neutral">Cancel</button>
                    <button class="slds-button slds-button--neutral slds-button--brand">Save</button>
                </div>
            </div>
        </div>
         <div class="slds-backdrop slds-backdrop--open" id="QuickInvestorBackground" style="display:none;"></div>
   
</aura:component>
I created a custom object and activated history tracking on that object. On my page layout, im displaying the history related list, but in salesforce1 it is not showing up. Does anybody know why? I didn't find any restriction on this for salesforce1 version.
On my vf page running in IOS (salesforce1), when I type in a search box, i execute a search and display a list of accounts, but when we moved to winter 15 or new version of salesforce1 for IOS, when i clicked in the search box, it proposes natively some text. I have to click on done to hide the keyboard which take much of my screen. But when i do this, my page become blank. Doest anyone having this issue?
Hello Everyone,

I am new to salesforce1 and having problem while working with VF pages. I have a VF page that saves some records. When i edit any record and updates the value, the value is changed in the database but doesn't reflect on the standard detail page but when i refresh my page then the updated value appeared. I think old value is displaying from the cookies. I am using salesforce1 mobile browser app. Can anyone tell me how can i get the refreshed value?

Thanks in advanced
Hi All,
I am getting Parameter_Tampering Issue in my apex code when i submit package for security review.It is coming specifically when i use string.escapeSingleQuotes(variable) to avoid SOQL-SOSL injection.

Do any one have idea about How to get rid of this issue.It ll be more helpful to me.

Thanks,
Rajesh.
  • January 09, 2014
  • Like
  • 0

Hi everyone,

 

I am fairly new to Visualforce development, so please forgive me if I am asking something obvious here. Somehow I got the feeling I do, because what I am trying to achieve does not seem far-fetched to me or out-of-the-common in any way.

 

So here we go:

I basically need to recreate the default Task Edit page. That's no problem, and I can successfully edit all desired Task fields within my custom edit task page.

However, I am struggling very much with adding the "Attachments" related list, because whenever I edit a task, I also want to be able to add attachments to that task. That by the way is exactly the behavior I find within the standard task edit page: Editing a task allows me to add attachments.

 

In my case however, whenever I turn to my edit task page, I see the list of related attachments, but the button "Add Attachment" does not appear on the list. And I can't seem to figure out what I am doing wrong or even better, how to do it right.

 

So you can better relate to my problem, here's some sample code that visualizes my problem:

 

<apex:page standardController="Task">
    <apex:form>
        <apex:pageblock mode="edit" title="Edit Task">
            <apex:pageblockbuttons>
                <apex:commandbutton value="Save" action="{!Save}"/>
                <apex:commandbutton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockbuttons>
            <apex:outputpanel >
                <apex:pageblocksection showheader="false">
                    <apex:inputfield value="{!Task.Subject}" required="true"/>
                </apex:pageblocksection>
            </apex:outputpanel>
        </apex:pageblock>
    </apex:form>
    <apex:relatedList list="Attachments"  subject="{!$CurrentPage.parameters.id}" />
</apex:page>

 

Using this page as the system-wide task edit page, it allows me to edit the task's Subject (I removed all other fields for brevity of code), but it does not allow me to add attachments to the related list integrated into the edit page.

 

I already tried a few different variations of where to place the apex:relatedList within that Visualforce code, but I can't find the solution. And I would be very thankful if anybody out there could point me into the right direction or point out any obvious mistakes I am making.

 

 

Thank you all for reading, and already thank you for any feedback,

 

        Andy

 

Hi,

 

When I am trying to display the NotesAndAttachments on the visualforce page i am getting the above error

I have used the following tag to display NotesAndAttachments on the page. Kindly do needfull asap.

 

<apex:relatedList  list="NotesAndAttachments"  title="Request For Proposal(RFP)" subject="{!QIF_API__c.id} />

  • September 18, 2013
  • Like
  • 0

Hello , 

 

I have a visualforce page that let a user select many records and then the user should click on a button to go to another page to update records selected (its like the add prodcut in an opportunity). 

 

The problem am facing , is that i'm able to get ids of elements selected , but i dont know how to pass the list of ids to the other page...

 

Here is the visualforce page : 

 

<apex:page controller="CCW_ContactPaginationController2">
 
    <script type="text/javascript">
 
        /*
        *    function to handle checkbox selection
        */
        function doCheckboxChange(cb,itemId){
 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
 
        }
 
    </script>
 
    <apex:form >
 <apex:commandbutton value="Update selected records" action="{!updateselected}"/>
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <apex:pageBlock title="CloudClickware Pagination Sample" id="mpb">
 
            <!-- table of data -->
            <apex:pageBlockTable title="Contacts" value="{!contacts}" var="c">
                <apex:column >
                    <apex:facet name="header">Action</apex:facet>
                    <apex:inputCheckbox value="{!c.IsSelected}" onchange="doCheckboxChange(this,'{!c.tContact.Id}')"/>
                </apex:column>
                <apex:column value="{!c.tContact.FirstName}"/>
                <apex:column value="{!c.tContact.LastName}"/>
                <apex:column value="{!c.tContact.Title}"/>
                <apex:column value="{!c.tContact.Phone}"/>
                <apex:column value="{!c.tContact.Email}"/>
            </apex:pageBlockTable>
 
            <!-- count of selected items -->
            <apex:outputLabel value="[{!selectedCount} records selected]" />
 
            <br/>
 
            <!-- next, previous and page info -->
            <apex:commandLink action="{!doPrevious}" rendered="{!hasPrevious}" value="Previous" />
            <apex:outputLabel rendered="{!NOT(hasPrevious)}" value="Previous" />
 
            <apex:outputLabel value=" (page {!pageNumber} of {!totalPages}) " />
 
            <apex:commandLink action="{!doNext}" rendered="{!hasNext}" value="Next" />
            <apex:outputLabel rendered="{!NOT(hasNext)}" value="Next" />
 
        </apex:pageBlock>
 
    </apex:form>
 
</apex:page>

 And the controler class :

 

 

public with sharing class CCW_ContactPaginationController2 {
 
    /*
    *   item in context from the page
    */
    public String contextItem{get;set;}
 
    /*
    *   set controller
    */
    private ApexPages.StandardSetController setCon;
 
    /*
    *   the contact ids selected by the user
    */
    private Set<Id> selectedContactIds;
 
    /*
    *   constructor
    */
    public CCW_ContactPaginationController2 ()
    {
        //init variable
        this.selectedContactIds= new Set<Id>();
 
        //gather data set
        this.setCon= new ApexPages.StandardSetController( [SELECT Id, FirstName, LastName, Title, Phone, Email FROM Contact] );
        this.setCon.setpageNumber(1);
        this.setCon.setPageSize(10);
 
    }
 
    /*
    *   handle item selected
    */
    public void doSelectItem(){
 
        this.selectedContactIds.add(this.contextItem);
 
    }
 
    /*
    *   handle item deselected
    */
    public void doDeselectItem(){
 
        this.selectedContactIds.remove(this.contextItem);
 
    }
 
    /*
    *   return count of selected items
    */
    public Integer getSelectedCount(){
 
        return this.selectedContactIds.size();
 
    }
    public Pagereference updateselected()
    {
    
       return null;
    
    }
 
    /*
    *   advance to next page
    */
    public void doNext(){
 
        if(this.setCon.getHasNext())
            this.setCon.next();
 
    }
 
    /*
    *   advance to previous page
    */
    public void doPrevious(){
 
        if(this.setCon.getHasPrevious())
            this.setCon.previous();
 
    }
 
    /*
    *   return current page of groups
    */
    public List<CCWRowItem> getContacts(){
 
        List<CCWRowItem> rows = new List<CCWRowItem>();
 
        for(sObject r : this.setCon.getRecords()){
            Contact c = (Contact)r;
 
            CCWRowItem row = new CCWRowItem(c,false);
            if(this.selectedContactIds.contains(c.Id)){
                row.IsSelected=true;
            }
            else{
                row.IsSelected=false;
            }
            rows.add(row);
        }
 
        return rows;
 
    }
 
    /*
    *   return whether previous page exists
    */
    public Boolean getHasPrevious(){
 
        return this.setCon.getHasPrevious();
 
    }
 
    /*
    *   return whether next page exists
    */
    public Boolean getHasNext(){
 
        return this.setCon.getHasNext();
 
    }
 
    /*
    *   return page number
    */
    public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
 
    /*
    *    return total pages
    */
    Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }
 
    /*
    *   helper class that represents a row
    */
    public with sharing class CCWRowItem{
 
        public Contact tContact{get;set;}
        public Boolean IsSelected{get;set;}
 
        public CCWRowItem(Contact c, Boolean s){
            this.tContact=c;
            this.IsSelected=s;
        }
 
    }
}

 

So how can i implement this in that method :

 

    public Pagereference updateselected()
    {
    
       return null;
    
    }

So i can pass selected ids in Page2

 

 

I have written test method for some class like it has SOSL search method. It was working in Sanbox and its covered more than 80 percentage.

When i gonna to move production i got issue like "System.UnexpectedException: Search unavailable". can anybody help me.

  • March 24, 2013
  • Like
  • 0

i serialized a list ino JSON String.,

 

I am using HTTP Post to send that json to other end.,

 

I need to handle special characters in my JSON string,

 

Please help me.,

  • December 10, 2012
  • Like
  • 0

I noticed that , rerenderinf do not work, when the field is required , anyone know why is it the case ?

 

<apex:outputPanel id="header01"  layout="block" styleClass="pbHeader">            
                 <table class="detailList" cellspacing="0" cellpadding="0" border="0">                           
                    <tr>
                       <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Name.label}</td>
                        <td class="dataCol" style="width:70%">
                             <div class="requiredInput">
                                <div class="requiredBlock"></div>
                                 <apex:selectList id="dom" value="{!selectedDomaine}" size="1" onchange="RefreshHeader();">
                                      <apex:selectOptions value="{!DomaineList}"/>
                                 </apex:selectList>
                                 <apex:actionFunction name="RefreshHeader" immediate="true" action="{!Refresh}" rerender="header01" status="myStatus" />
                              </div>
                          </td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Type__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Type__c}" /></td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Article__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Article__c}"/></td>
                    </tr>
                    <tr style="display:{!IF(selectedDomaine == 'new','','none')}">
                        <td class="labelCol">{!$ObjectType.DomaineMarque__c.fields.Nom__c.label}</td>
                        <td class="dataCol"><apex:inputfield value="{!domaine.Nom__c}" required="true"/></td>
                    </tr>  
                </table>          
           </apex:outputPanel>

 

if i remove the required=true part, the rerendering works fine. Is this a salesforce bug?

 

This is just some example code, I don't want the focus of what I'm doing to cloud the concept I'm trying to figure out.

 

code:

 

sobject[] something = [SELECT Contact.FirstName, Contact.Account.Name, contact.account.type from Contact];

 

I've used sobject[] here instead of contact[] because in my project the query is dynamic and could be from a different table.

 

My question is, how do I get the relationship field from this? Normally, I know you can do this:

 

string theName = something[0].Account.Name;

 

However, this results in the error: Field expression not allowed for generic SObject

 

How do I get around this?

  • April 29, 2012
  • Like
  • 1

hi,

        I want to close the child window with refreshing parent window. I have used the code.

 

function closePage(){

window.opener.parent.location.replace('/{$CurrentPage.parameters.id}');

window.close();

}

 

it is working in firfox,chrome but not working in internet explorer.

 

can someone suggest for internet explorer what should be the code?

  • March 19, 2012
  • Like
  • 0

I need to display the notes and attachments related list in visual force page.

  • February 02, 2012
  • Like
  • 0

I do not know why static resource call via URLFOR seems not to be supported in javascript invoke button, whereas the function is available for use.Have anyone used another method to get the url of a static resource in javascript invoke button?

Hello,

 

I am creating a visualforce page, and want to set the tabStyle attribute based on Record Type.  However, when open the visualforce page with the following (where MyTabStyle is a string like 'contact', 'account', etc).

 

 

 

 

<apex:page standardController="Opportunity" extensions="myOppExtension" tabStyle="{!MyTabStyle}">

 

 

I get an error "Error: Invalid tabStyle '{!MyTabStyle}' specified. If you are trying to reference a custom Visualforce tab, you must append '__tab'".

 

Is setting the tabStyle this way supported?

 

Thank you

 

I'm trying to create  visual force page that downloads as Excel or CSV . This works fine for English but for UTF 8 characters like Polish etc. some of the characters get replaced with "?" etc. I'm not sure there's a way to specify encoding when using contentTypes.

Hello,

 

I am creating a visualforce page, and want to set the tabStyle attribute based on Record Type.  However, when open the visualforce page with the following (where MyTabStyle is a string like 'contact', 'account', etc).

 

 

 

 

<apex:page standardController="Opportunity" extensions="myOppExtension" tabStyle="{!MyTabStyle}">

 

 

I get an error "Error: Invalid tabStyle '{!MyTabStyle}' specified. If you are trying to reference a custom Visualforce tab, you must append '__tab'".

 

Is setting the tabStyle this way supported?

 

Thank you