• Rahul456
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 3
    Replies

Hello,

 

        I have CASE function in my forumla field where I am checking this picklist field value with a text that contains special characters.Eventhough this picklist is holding the same as text value at salesforce record but the else part in CASE is getting executed.

 

CASE( PricebookEntry.Product2.Product_Category__c ,"KONE Alta & MiniSpace > 3.5 m/s",82,81)

 

In above the formula criteria Product_Category__c holds the "KONE Alta & MiniSpace > 3.5 m/s" value but I am getting 81 as result where I am expecting 82.

 

Hi,

 

I have a Visualforce page embedded on the detail page of a custom object.

 

I have defined a command button in the visualforce page and has its own functionality.

 

As an Administrator, when i click on this Command button it should perform its defined functionlaity and also this detail page should be redirectd to some other page specified in the url.

 

But I click on this, only vf component is being redirected to specified but not entire detail page.

 

I had used javascript code with an onclick event on command button to perform the same but its not functioning consistently.

 

 I am now trying with apex code:

 

 Here is my sample code:

 

public pagereference reactivate(){
        ApproveItems.approveUserRequest(u.Id);
       
        String str='window.parent.location.href("/{!usr.User__r.Id}/e?retURL=%2F{!usr.User__r.Id}&active=1&Profile={!ProfileId}&Title={!URLENCODE(User_Request__c.Title__c)}&00N20000000sJNj={!User_Request__c.Legacy_User_ID__c}")';
        System.debug('######### User Id:'+ usr.User__r.Id);
       
        //PageReference newPage=new PageReference('/' + usr.User__r.Id);
        PageReference newPage=new PageReference(str);
        newPage.setRedirect(true);
        return newPage;
    }

 Regards,

Raj

 

Hi,

 

    I have defined a Custom Component with an associated Custom controller class.The Page Editor for this  

    component will have some input fileds and respective Controller class has code for this input fileds and also

    save method which will save the values provided in the input fields.

 

    I have visualforce page where I invoked the component that I defined.This visualforce page is defined with standard controller and extension class on top of it.This extension class has a save method,where I am invoking save method that I defined in Custom component controller class.

 

So when I give some values in input fileds in Visual force page for component portion and click on save, the values are not getting save but saving with null values.

 

please suggest me in this issue or if any sample code please provide me.

 

 

 

Regards,

Rahul.

 

 

 

 

For suppose path of the file I am uplaoding is the below one:
C:\Documents and Settings\rajnoot\Desktop\login.txt
 
Here Name of the file is login.txt,So how to retrieve this file name,when I am uploading this file.
 
I used below Code:But it is not working::::
 
Page Editor Code:::
 
<apex:page StandardController="Document" extensions="documentExt">
   
    <apex:form >
      <apex:pageBlock >
          <apex:pageBlockSection>
            <apex:inputFile value="{!document.body}" filename="{!document.name}"/>
            <apex:commandButton value="save" action="{!save1}"/>
            <apex:param name="q" value="{!document.name}"/> <!Tried using this -->
                   </apex:pageBlockSection>
       </apex:pageBlock>
    </apex:form>
</apex:page>
 
Controller Code:::
 
public class documentExt {
String path;
ApexPages.StandardController controller;       
public documentExt(ApexPages.StandardController controller)
   {
              this.controller=controller;
               Document d = (Document) controller.getRecord();
               d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents
     }       
// ** Overriding the save method **  
    
public PageReference save1()
{
controller.save();
path=System.currentPageReference().getParameters().get('q');
System.debug('Uplaoded File Name is:::'+ path); /*showing path Value as NULL*/
return page.docsample;
}        
}
 
 
Please Suggest me,How to get file name in path variable
Hi,
 
     I have two input fields in my VF page:
 
     1)1st input field is a Picklist(Which has values like:Text,Pick List,Multi-PickList,Radio Button)
     2)2nd one is Text Area.
 
     So User Selects either of Pick List,Multi-PickList,Radio Button values in 1st input field then Text Area is a Required Field.
 
     If User Selects Text Value in 1st input field then Text Area is not a Required field.
 
  
 
  Please suggest me how to fix this issue.
 
 
 
 
   Raj
Hi,
 
    When I executed Input File Sample Usage given in Reference Document,page is redirecting to Documents object--detail   page layout.How to return to some VF Page(Named XYZ) when this sample Usage Code is executed instead of redirecting document detail page.
 
Please suggest me.
 
Thanks
Raj
 
I have developed a visual force page(Form)  through which I am able to access File existing in my Local Disk.
 
The problem I am facing here is:How to save this File in  Document object of my instance.
 
Please Suggest me
Hi All,

       Plz help me out,why this javascript(colred in red) isn't working.

<apex:page controller="abc" id="UseCaseDisplay">
<apex:form >

<apex:pageBlock  mode="edit" id="thePageBlock">
<apex:pageBlockSection columns="3">
<table width="500px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td  align="left"><input type="radio" name="select" checked="true"  onClick='recentres(1)'/>Country</td>
<td  align="center"><b>OR</b></td>                   
<td  align="left"><input type="radio" name="select" onClick='recentres(2)'/>Other countries</td>
</tr>
</table>  
</apex:pageBlockSection>
</apex:pageBlock>
<br></br>

<div id="selc" style="display:block;">
<apex:pageBlock title="State Selection">

<apex:panelGrid columns="2">
Country &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<apex:selectList value="{!category}" size="1" id="category">
<apex:selectOptions value="{!categories}"/>
<apex:actionSupport event="onchange" rerender="features"/>
</apex:selectList>

<apex:outputLabel value="State" for="features"/>
<apex:selectList value="{!feature}" size="1" id="features" disabled="{!ISNULL(category)}">
<apex:selectOptions value="{!features}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
</div>

<div id="select" style="display:none;">
<apex:pageBlock title="Others Selection" >
Country*
<apex:inputText id="cntries5" value="{!contry}">
</apex:inputText><br></br>
<br></br>
State*<apex:inputText id="state5" value="{!stat}">
</apex:inputText>
</apex:pageBlock>
</div>
<apex:commandButton value="Save Reseller Account" action="{!save}"/>
</apex:form>
 
<script language="JavaScript">
function recentres(rad)
{

if(rad==1)
{

document.getElementById("selc").style.display='block';
document.getElementById("select").style.display='none';
document.getElementById("{!$Component.state5}").value ='';
document.getElementById("{!$Component.cntries5}").value ='';

}
else
{

document.getElementById("selc").style.display='none';
document.getElementById("select").style.display='block';
}

}

</script>
</apex:page>
 While User is creating an account through visualforce page,in this process he has to fill few input fields.
                                         
When he enters Zipcode(input field) value City field value should be auto populated with respective City value.
This Zipcode vs City value mapping is stored in custom object.We maintain this
Zipcode Vs City mapping for only cities that belongs to US.
 So for rest of the cities, User has to manually enter City field value.
                                             
                                                  
                                              Plz suggest me how to implement this.

Hi every one,

 

I am facing the problem with datatable in visual force with apex.In my application i want to display the table as three fields with coreesponding values.But here i am getting 3 tables.How to make it as single table.

 

Here my code is as follows.

 

VFPage

 

<apex:page standardController="CAF_Charge__c" extensions="popupwindow">
<apex:form >
<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1" >
<apex:column headervalue="Charge header information">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Charges_Head__c}"/>
{!a.Charges_Head__c}</apex:commandLink></apex:column>
</apex:dataTable>
<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1" >
<apex:column headervalue="Description of charge">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Description_Of_Charges__c}"/>
{!a.Description_Of_Charges__c}</apex:commandLink></apex:column>
</apex:dataTable>

<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1">
<apex:column headervalue="Percentage">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Percentage__c}"/>
{!a.Percentage__c}</apex:commandLink></apex:column>
</apex:dataTable>

</apex:form>
</apex:page>

 

Apex Class

 

public class popupwindow
{

    public popupwindow(ApexPages.StandardController controller) {

    }
  

    Public string chargeshead{get;set;}
    Public string doc{get;set;}
    Public string percentage{get;set;}
   

   
    public List<chiranjeevi__CAF_Charge__c> getDesCharge()
    {
     List<chiranjeevi__CAF_Charge__c> descharge=[select chiranjeevi__Charges_Head__c,chiranjeevi__Description_Of_Charges__c,chiranjeevi__Percentage__c  from chiranjeevi__CAF_Charge__c  limit 10];
     return descharge;
    }


    Public void filltextval1()
    {
    chargeshead= apexpages.currentpage().getparameters().get('name1');
    }
   
   
}

 

Thanks,

Manu..

  • December 11, 2009
  • Like
  • 0

In testmethod I inserted a account with Name field.Its showing the following message

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>

 

But I am able to create Account record through tab.

  • February 26, 2009
  • Like
  • 0
Hi All,

       Plz help me out,why this javascript(colred in red) isn't working.

<apex:page controller="abc" id="UseCaseDisplay">
<apex:form >

<apex:pageBlock  mode="edit" id="thePageBlock">
<apex:pageBlockSection columns="3">
<table width="500px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td  align="left"><input type="radio" name="select" checked="true"  onClick='recentres(1)'/>Country</td>
<td  align="center"><b>OR</b></td>                   
<td  align="left"><input type="radio" name="select" onClick='recentres(2)'/>Other countries</td>
</tr>
</table>  
</apex:pageBlockSection>
</apex:pageBlock>
<br></br>

<div id="selc" style="display:block;">
<apex:pageBlock title="State Selection">

<apex:panelGrid columns="2">
Country &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<apex:selectList value="{!category}" size="1" id="category">
<apex:selectOptions value="{!categories}"/>
<apex:actionSupport event="onchange" rerender="features"/>
</apex:selectList>

<apex:outputLabel value="State" for="features"/>
<apex:selectList value="{!feature}" size="1" id="features" disabled="{!ISNULL(category)}">
<apex:selectOptions value="{!features}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
</div>

<div id="select" style="display:none;">
<apex:pageBlock title="Others Selection" >
Country*
<apex:inputText id="cntries5" value="{!contry}">
</apex:inputText><br></br>
<br></br>
State*<apex:inputText id="state5" value="{!stat}">
</apex:inputText>
</apex:pageBlock>
</div>
<apex:commandButton value="Save Reseller Account" action="{!save}"/>
</apex:form>
 
<script language="JavaScript">
function recentres(rad)
{

if(rad==1)
{

document.getElementById("selc").style.display='block';
document.getElementById("select").style.display='none';
document.getElementById("{!$Component.state5}").value ='';
document.getElementById("{!$Component.cntries5}").value ='';

}
else
{

document.getElementById("selc").style.display='none';
document.getElementById("select").style.display='block';
}

}

</script>
</apex:page>