function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anu2011anu2011 

conditional statements usage

hi i have address custom object ,i am creating a vf page for address-->custom object address have record type billing,shipping,company in different sections separately in a custon vf page,on click a save button only first section i.e billing address is saving shipping and company address not saving can any one help me in conditiions to use.

 

my condition:

   public PageReference save() {

 

if(adresstype=billing)

{

address record type will save;

}

else

if(adresstype=shipping)

{

address record type will save;

}

else

if(adresstype=company)

{

address record type will save;

}

}

 

only address with billing is saving.

i want the three address to save in a button click.

 

HaagenHaagen

Hi Anu,

 

in APEX comparisons are done with double = signs. Try using == in the if-statements instead.

 

Cheers!

 

Martin

anu2011anu2011

can you send me a sample code

Ritesh AswaneyRitesh Aswaney

if(adresstype == billing)

 

Like Martin wrote above, == (double equals) for comparison, single equals (=) for assignment