• palli
  • NEWBIE
  • -3 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 27
    Replies

Hi ,

 

how to solution this error........

 

 

static void testBookParser()
{
xml2DB1 demo = new Xml2DB1();
String str = '<Books><Book><Name>My Book 1</Name><publisher>Tata</publisher><cost>200</cost></Book>'+
'<Book><Name>My Book 2</Name><publisher>Tata</publisher><cost>300</cost></Book>'+
'<Book><Name>My Book 3</Name><publisher>Tata</publisher><cost>400</cost></Book></Books>';
XmlStreamReader callxml = new XmlStreamReader(str);
System.debug('Callxml .....'+callxml);
List<Book__c> booklist = new List<Book__c>();
for(XmlStreamReader.Book b: callxml.listrecords)
{
Book__c bc = new Book__c();
bc.Publisher__c='Tata';
bc.Name__c=b.name;
booklist.add(bc);
}
System.debug('books .......'+booklist.size());
system.debug('books........'+booklist);
if(booklist.size()>0)
{
insert booklist;
}

}

hi friends,

 please help me ..............

how to write a server side validations on this below page............

i dnt know how to write serverside validations.........

 

 

 

apex page..............

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

 

<apex:page controller="leadcontroller" id="pg">
<script type="text/javascript">
function formValidator()
{
var fname=document.getElementById("{!$Component.fname}");
if(fname==null || fname=="")
{
alert('Please Enter your First name');
return false;
}
return (true);
}
function formValidator1()
{
var lname=document.getElementById("{!$Component.lname}");
if(lname==null || lname=="")
{
alert('Please Enter your Last name');
return false;
}
return (true);
}
function validatePhone()
{
var phone=document.getElementById("{!$Component.phone}");
if(phone==null || phone=="")
{
alert('You must enter Phone number');
return false;
}
return true;
}
function formValidateEmail()
{
var email=document.getElementById("{!$Component.email}");
if(email==null || email=="")
{
alert('Please Enter a valid Email address');
return false;
}
return true;
}
function validateCompany()
{
var cmpny=document.getElementById("{!$Component.cmpny}");
if(cmpny==null || cmpny=="")
{
alert('Enter your Company name');
return false;
}
return true;
}
</script>
<apex:form id="myform">
<apex:pageBlock id="pb">
<apex:pageBlockSection title="Lead Information" id="pbs" >
<apex:pageBlockSectionItem id="pbsifname">
<apex:outputLabel value="First Name" for="fname"/>
<apex:inputtext value="{!FirstName}" id="fname" onclick="formValidator()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsilname">
<apex:outputLabel value="Last Name" for="lname"/>
<apex:inputtext value="{!LastName}" id="lname" required="true" onclick="formValidator1()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsip">
<apex:outputLabel value="Phone" for="phone"/>
<apex:inputtext value="{!phone}" id="phone" onclick="validatePhone()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsie">
<apex:outputLabel value="Email" for="email"/>
<apex:inputtext value="{!Email}" id="email" onclick="formValidateEmail()"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="pbsic">
<apex:outputLabel value="Company" for="cmpny"/>
<apex:inputText value="{!Company}" id="cmpny" required="true" onclick="validateCompany()"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons id="pbb">
<apex:commandButton action="{!save}" value="save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

apex class

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

 

public class leadcontroller
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string phone{get;set;}
public string email{get;set;}
public string Company{get;set;}
public pageReference save()
{
Lead le=new Lead();
le.FirstName=FirstName;
le.LastName=LastName;
le.phone=phone;
le.email=email;
le.company=company;
insert le;

pagereference page = new pagereference('/'+le.id);
return page;

}

}

Hi ,

 

How to change standarad application logo .............

 

like sales application , call center  application , marketing application..............

 

please help me ...........

hi, 

 

 

 
How can I write a SOQL query to find duplicate Account names.................
 
 

Hi,

how to display list of records by using below soql query ,.....

 

it is write code in apex class and the results in system .debug....

 

please help me frnds..........

 

 

using this soql query...

 

Select Id, Name, (Select Id, Name From Contacts) From Account

hi,

 

how print even numbers between 1 to 50 in developer console class......

 

i write a code here ...........

 

An error is generate ... line9:18 no aviable alternaive at character '%'...

 

 

class

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

public class ListEvenNumbers
{
public void evenMethod()
{
Integer limit=50;
System.debug('Printing even numbers between 1 and '+limit);
for(Integer i=1;i<=limit;i++)
{
if(i%2==0)
{
System.debug('Display the even numbers'+i);
}
}
}
}

 

 

please help me

Hi,

 i have a error here  like===   AscDescOrderCls Compile Error: Illegal assignment from String to LIST<String> at line 33 column 16====

 

Please slove this error ..

 

plz help me 

 

public class AscDescOrderCls
{
public Integer i;
public List<String> lastValue{get;set;}
public List<String> fstName{get;set;}
public List<String> Descending{get;set;}
public AscDescOrderCls()
{
fstName=new List<String>();
Descending= new List<String>();
lastValue=new List<string>();

fstName.add('Rama');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
fstName.add('Easu');
fstName.add('Hari');
fstName.sort();

for(i =fstName.size()-1; i>=0;i--)
{
lastValue=fstName.get(fstName.size()-1);
}
system.debug('Descending order'+lastValue);
}
}

Hi,  how to display list of values in Descending order .

 

apex Class :

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

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public SetPrimitiveDatatype()
{
fstName=New set<String>();

fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');
}
}

 

page

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

 

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Please help me friends.............

Hi , how to display ascending order and descending order set of values in visualforce page......

apex class

===========

public class SetPrimitiveDatatype
{
public set<String> fstName{get;set;}
public set<String> lstName{get;set;}

public SetPrimitiveDatatype()
{
fstName=New set<String>();


fstName.add('Rama');
fstName.add('Anil');
fstName.add('Srinu');
fstName.add('Kumar');
fstName.add('Prasad');
fstName.add('Devaraju');
fstName.add('Murali');
fstName.add('Balu');
fstName.add('Chaitu');
fstName.add('Tanuja');

}
}

 

page

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

<apex:page controller="SetPrimitiveDatatype">
<apex:form >
<apex:pageBlock title="Display The Set of values">
<apex:pageBlockSection title="FirstName">
<apex:pageblockTable value="{!fstName}" var="fn">
<apex:column value="{!fn}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

please help me .............