-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
9Questions
-
3Replies
Compare picklist field value with a text that conatins special characters
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.
- Rahul456
- December 11, 2009
- Like
- 0
- Continue reading or reply
Visualforce Page embedded in a detail page that needs to redirect to other page
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
- Rahul456
- November 11, 2009
- Like
- 0
- Continue reading or reply
save functionality in Custom Component's controller class
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.
- Rahul456
- June 02, 2009
- Like
- 0
- Continue reading or reply
what syntax to use to get a file name,of which I am uploading using Input File,plz suggest ASAP
<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>
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;
}
}
- Rahul456
- September 27, 2008
- Like
- 0
- Continue reading or reply
How to set a input field required in my Page Editor based on some condition
- Rahul456
- September 22, 2008
- Like
- 0
- Continue reading or reply
When I use Input File,How to call other visual force page
- Rahul456
- September 22, 2008
- Like
- 0
- Continue reading or reply
How to upload a file which is in my local drive into Document object
- Rahul456
- September 16, 2008
- Like
- 0
- Continue reading or reply
This JavascriptCode isn't working:
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
<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>
- Rahul456
- July 07, 2008
- Like
- 0
- Continue reading or reply
How to call a function in controller field when onBlur or orChange event fires
When he enters Zipcode(input field) value City field value should be auto populated with respective City value.
- Rahul456
- July 02, 2008
- Like
- 0
- Continue reading or reply
problem with dataTable in visual force page
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..
- ssss
- December 11, 2009
- Like
- 0
- Continue reading or reply
URGENT:On test methods.
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.
- swaran
- February 26, 2009
- Like
- 0
- Continue reading or reply
This JavascriptCode isn't working:
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
<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>
- Rahul456
- July 07, 2008
- Like
- 0
- Continue reading or reply