• priya bhawna shetty
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 45
    Questions
  • 15
    Replies
hello guys

hope all are doing well.pls help with this.
pls check my "if" condition that,how do i write a if codition in such a way that if the current users profile is 'System Administrator' populate phone field and if the profile is 'Standard Platform user' populate the Revenue field.

Error: Compile Error: Expression cannot be assigned at line -1 column -1

public class runasdemo2{

user u1=[select user.profile.name, user.Username from user where profile.name='Standard Platform User' and user.username='aasalesforce.consultant11@gmail.com'];
user u2=[select user.profile.name, user.Username from user where profile.name='System Administrator' and user.username='salesforce.learner999@gmail.com'];

{
  if(u1.contains(profile.name='Standard Platform User'))
  {
   account a1=new account();
   a1.name='testaccount';
   a1.annualrevenue=12345;
   insert a1;
  }else
  {
   account b1=new account();
   b1.name='salesforce';
   b1.phone=2345;
   insert b1;
   }
  
}
}
hi guys 
hope all are doing well.pls help me out with this small issue.
I created a apex class where i fetched query like user u1=standard platform user profile and user u2=system admin profile,so my condition is ,i want to gave user u1 to run Annual revenue field and user u2 to run phone field from account.

heres my code:
public class runasdemo2{

user u1=[select user.profile.name, user.Username from user where profile.name='Standard Platform User' and user.username='aasalesforce.consultant11@gmail.com'];
user u2=[select user.profile.name, user.Username from user where profile.name='System Administrator' and user.username='salesforce.learner999@gmail.com'];

{
  if(u1.contains(profile.name='Standard Platform User'))
  {
   account a1=new account();
   a1.name='testaccount';
   a1.annualrevenue=12345;
   insert a1;
  }else
  {
   account b1=new account();
   b1.name='salesforce';
   b1.phone=1234124;
   insert b1;
   }
   
}
}

pls help me out.
tnks 
hello guys
hope all doing well
pls help me out
i displayed list of opportunity names along with Editable input field stagenames parallelly  so when i enter any stagename and after clicking save ,only modified opportinities should be updated, not all ,
heres the process i did
1.for previous value of stagename i have taken map    i.e with map.  map<id,string> map9=new map<id,string>();  id=opportunity id                   and string=stagename.
2.in for loop i put if condition comparing previous value and current value.
3.now i throwed all map values to list  by declaring new list.
4.i updated opportunity in new list.
5.i did all this in "hitme" button  method

HERES MY PAGE AND CONTROLLER:
<apex:page controller="opportunitydisplaycon9" id="thePage">

<apex:form >
<apex:pageBlock >
                <apex:pageBlockButtons >
                 <apex:commandButton action="{!hitme}" value="hitme"/>
                </apex:pageBlockButtons>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"   styleClass="tableClass">
                <apex:facet name="caption">opportunity Details</apex:facet>
                <apex:column >
                        <apex:facet name="header">opportunity Name</apex:facet>
                         <a href="/{!opp.Id}">{!opp.name}</a>
                </apex:column>
                <apex:column >
                        <apex:facet name="header">opportunity stage</apex:facet>
                        <apex:inputField value="{!opp.stagename}"/>
                </apex:column>
              
        </apex:dataTable> 
</apex:pageBlock>
</apex:form>
</apex:page>

public class opportunitydisplaycon9 {
public List<opportunity> opp9;
map<id,string> map9=new map<id,string>();
    public PageReference hitme() {
     opportunity opp;
      for(opportunity opp:opp9)
      {
       if(opp.stagename!=map9.get(opp.id).stagename)
        {
         list<opportunity> list9=new list<opportunity>();
         list9.addall(map9);
        update opp9;
        return null;
    }

 
   public List<opportunity> getopp9()
   {

        opp9 = [select name,stagename from opportunity limit 10];

        return opp9;

   }

}
hello guys
hope all doing well
heres my problem again
 i displayed list of opportunity names along with Editable input field stagenames parallelly  so when i enter any stagename and after clicking save ,only modified opportinities should be updated, not all ,
heres the process i did
1.for previous value of stagename i have taken map    i.e with map.  map<id,string> map9=new map<id,string>();  id=opportunity id                   and string=stagename.
2.in for loop i put if condition comparing previous value and current value.
3.now i throwed all map values to list  by declaring new list.
4.i updated opportunity in new list.
5.i did all this in "hitme" button  method

HERES MY PAGE AND CONTROLLER:
<apex:page controller="opportunitydisplaycon9" id="thePage">

<apex:form >
<apex:pageBlock >
                <apex:pageBlockButtons >
                 <apex:commandButton action="{!hitme}" value="hitme"/>
                </apex:pageBlockButtons>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"   styleClass="tableClass">
                <apex:facet name="caption">opportunity Details</apex:facet>
                <apex:column >
                        <apex:facet name="header">opportunity Name</apex:facet>
                         <a href="/{!opp.Id}">{!opp.name}</a>
                </apex:column>
                <apex:column >
                        <apex:facet name="header">opportunity stage</apex:facet>
                        <apex:inputField value="{!opp.stagename}"/>
                </apex:column>
               
        </apex:dataTable>  
</apex:pageBlock> 
</apex:form>
</apex:page>

public class opportunitydisplaycon9 {
public List<opportunity> opp9;
map<id,string> map9=new map<id,string>();
    public PageReference hitme() {
     opportunity opp;
      for(opportunity opp:opp9)
      {
       if(opp.stagename!=map9.get(opp.id).stagename)
        {
         list<opportunity> list9=new list<opportunity>();
         list9.addall(map9);
        update opp9;
        return null;
    }

  
   public List<opportunity> getopp9()
   {

        opp9 = [select name,stagename from opportunity limit 10];

        return opp9;

   }

}


THANKS
“hi guys
please help me out with this  requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it i want it to open in new tab.
heres my code.
please tell me how do i do this by using javascript or by command link:

PAGE:
<apex:page controller="opportunitydisplaycon9" id="thePage">

<apex:form >
<script>
  function functioncall(){
   window.open("");
   actionfuncall();
</script>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"   styleClass="tableClass">
                <apex:facet name="caption">opportunity Details</apex:facet>
                <apex:column id="columnid">
                        <apex:facet name="header">opportunity Name</apex:facet>
                         <a href="javascript:functioncall()">{!opp.name}</a>
                         <apex:actionFunction name="actionfuncall" action="{!actionfuncall1}" reRender="columnid"/>
                </apex:column>
                <apex:column >
                        <apex:facet name="header">opportunity stage</apex:facet>
                        <apex:outputText value="{!opp.stagename}"/>
                </apex:column>
        </apex:dataTable>    
</apex:form>

</apex:page>

CONTROLLER;

public class opportunitydisplaycon9 {

    public String getOpp() {
        return null;
    }
   
    public pagereference actionfuncall1(){
     return null;
     }


public List<opportunity> opportunity;
    public PageReference hitme() {
        update opportunity;
        return null;
    }

  
   public List<opportunity> getopportunity()
   {

        opportunity = [select name,stagename from opportunity limit 10];

        return opportunity;

   }

}
hello guys
please answer me this requirement
i displayed list of opportunity names along with Editable input field stagenames parallelly  so when i enter any stagename and after clicking save ,all stagenames has to be updated at once.

tnks  
hi guys
please help me out with this  requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it.
heres my code.
please tell me how do i do this by using javascript or by command link

PAGE:
<apex:page controller="opportunitydisplaycon" id="thePage">
<apex:form >
<script>
function generatedjs(){
gotodetail();
</script>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"
                        styleClass="tableClass">

                <apex:facet name="caption">opportunity Details</apex:facet>

                <apex:column >
               
                                       
                        <apex:facet name="header">opportunity Name</apex:facet>

                         <a rerender="commandlink1" href="javascript:generatedJs();">{!opp.name}</a>
                                           
                        <apex:commandLink action="{!gotodetail}" id="commnadlink1"/>
                       
                       

                </apex:column>

                <apex:column >

                        <apex:facet name="header">opportunity stage</apex:facet>

                        <apex:outputText value="{!opp.stagename}"/>

                </apex:column>

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

CONTROLLER:
public class opportunitydisplaycon {

   public List<opportunity> opportunity;
   public List<opportunity> getopportunity()
   {

        opportunity = [select name,stagename from opportunity limit 10];

        return opportunity;

   }
   public PageReference gotodetail() {
        pageReference p=new pageReference('/'+'recordID');
        p.setredirect(true);
        return p;
       
    }

}
Hello guys
can u guys help me with this requirement.

i have a visualforce page with 4 empty account  inputfields with 2 custom buttons save and clear .
so my question is
1.save button must insert , as well as it should give the ability to edit the previous data to insert new values as different data in vf page .
2.clear button must clear the data,allowing as to enter new data in vf page.

thanks in advance

hi guys

i want to write a trigger on opportunity object,i.e we have Amount field in opportunity,so i want to display the maximum Amount of all the amounts i get from opportunity in Account object,having custom field as max amount in Acount object...

thnks

hi friends

i got this requirement.

please help

In Account object i created one custom field called " COUNT" so the question is ,whenever i created a contact related to that account ,COUNT custom field has to show the number,how many contacts has been created so far....

one important thing is ,pls consider all events in trigger...like before insert,after update and delete also come into the existence...

how do i write trigger for this..

Thanks

hello guys

pls help me out with this trigger...

my requirement is simple i.e after creating any account and saving that account i want to display Fax,Industry fields to the value that is specified in my trigger and want to create contact related to that account automatically....

trigger mysecondtrigger on Account (before insert,after insert)
{
if(trigger.isBefore)
{
for(Account acc:trigger.new)
{
acc.Fax='asdf';
acc.Industry='Tcs';
}
}
else{
for(Account acc:trigger.new)
{
contact c=new contact(LastName=' anynamehere');
c.AccountId=acc.Id;

}
}
}

 

 

 

hi friends

can anyone tell me...

what is the error we get when we use soql quiry in any for loop?

thnks

hi all

can anyone tell me the

Best practices for Test coverage and for writing test classes...pls

Hello guys

hope all doing well

i have a small scenario pls help me out.

I have 10000 Accounts in my organisation and my question is , i want to update country field to 'USA'  to all my 10000 Accounts at a time..how do i achieve this...

Thanks

hi 

how many drop down lists can we do in visualforce....

thanks

hi guys

theres a special thing in service cloud with connection to junction object...whats that....

thanks

hello friends

can u pls tell me how many fields can we track thru audit trails.....

thanks

hello guys

hope all doing good.....

theres two users in organisation.user u1 with profile p1 and user u2 with profile p2.

user u1 with profile p1 is holding 20 records and user u2 with proflle  p2 is holding 20 records.

so the question is , how do i restrict user u2 to view,edit,del the user u1 records and vice versa..

thanks

hi guys

need help with this..

theres an user u1 with profile p1 in orgnanisation,suddenly he left out ,so the question is how an admin will reaasign the records of user u1 to any other user...what will be the approach of admin in this scenaro...

thanks

hello guys
hope all doing well
heres my problem again
 i displayed list of opportunity names along with Editable input field stagenames parallelly  so when i enter any stagename and after clicking save ,only modified opportinities should be updated, not all ,
heres the process i did
1.for previous value of stagename i have taken map    i.e with map.  map<id,string> map9=new map<id,string>();  id=opportunity id                   and string=stagename.
2.in for loop i put if condition comparing previous value and current value.
3.now i throwed all map values to list  by declaring new list.
4.i updated opportunity in new list.
5.i did all this in "hitme" button  method

HERES MY PAGE AND CONTROLLER:
<apex:page controller="opportunitydisplaycon9" id="thePage">

<apex:form >
<apex:pageBlock >
                <apex:pageBlockButtons >
                 <apex:commandButton action="{!hitme}" value="hitme"/>
                </apex:pageBlockButtons>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"   styleClass="tableClass">
                <apex:facet name="caption">opportunity Details</apex:facet>
                <apex:column >
                        <apex:facet name="header">opportunity Name</apex:facet>
                         <a href="/{!opp.Id}">{!opp.name}</a>
                </apex:column>
                <apex:column >
                        <apex:facet name="header">opportunity stage</apex:facet>
                        <apex:inputField value="{!opp.stagename}"/>
                </apex:column>
               
        </apex:dataTable>  
</apex:pageBlock> 
</apex:form>
</apex:page>

public class opportunitydisplaycon9 {
public List<opportunity> opp9;
map<id,string> map9=new map<id,string>();
    public PageReference hitme() {
     opportunity opp;
      for(opportunity opp:opp9)
      {
       if(opp.stagename!=map9.get(opp.id).stagename)
        {
         list<opportunity> list9=new list<opportunity>();
         list9.addall(map9);
        update opp9;
        return null;
    }

  
   public List<opportunity> getopp9()
   {

        opp9 = [select name,stagename from opportunity limit 10];

        return opp9;

   }

}


THANKS

hello guys

pls help me out with this questions

1.what is a crono trigger? when and how do we use.

2.what is soql injection.

3.what r the winter 2013 special features did we notice so far as a salesforce developer..

4.if i write a soql quires without specifying LIMIT keyword ..how many records r iam going to retrieve thru database..

50 thousand records     ..          True or false

5.Does modify all and modify all data belongs to profiles?

6.what datatype is trigger.new,trigger.old,trigger.newmap and trigger.oldmap?

7.what is a user object?

8.whats the main use of @future annotation..

Ans.@future annotation is used to bypass governor limits            true or false

Thanks

Regards

hi guys 
hope all are doing well.pls help me out with this small issue.
I created a apex class where i fetched query like user u1=standard platform user profile and user u2=system admin profile,so my condition is ,i want to gave user u1 to run Annual revenue field and user u2 to run phone field from account.

heres my code:
public class runasdemo2{

user u1=[select user.profile.name, user.Username from user where profile.name='Standard Platform User' and user.username='aasalesforce.consultant11@gmail.com'];
user u2=[select user.profile.name, user.Username from user where profile.name='System Administrator' and user.username='salesforce.learner999@gmail.com'];

{
  if(u1.contains(profile.name='Standard Platform User'))
  {
   account a1=new account();
   a1.name='testaccount';
   a1.annualrevenue=12345;
   insert a1;
  }else
  {
   account b1=new account();
   b1.name='salesforce';
   b1.phone=1234124;
   insert b1;
   }
   
}
}

pls help me out.
tnks 
“hi guys
please help me out with this  requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it i want it to open in new tab.
heres my code.
please tell me how do i do this by using javascript or by command link:

PAGE:
<apex:page controller="opportunitydisplaycon9" id="thePage">

<apex:form >
<script>
  function functioncall(){
   window.open("");
   actionfuncall();
</script>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"   styleClass="tableClass">
                <apex:facet name="caption">opportunity Details</apex:facet>
                <apex:column id="columnid">
                        <apex:facet name="header">opportunity Name</apex:facet>
                         <a href="javascript:functioncall()">{!opp.name}</a>
                         <apex:actionFunction name="actionfuncall" action="{!actionfuncall1}" reRender="columnid"/>
                </apex:column>
                <apex:column >
                        <apex:facet name="header">opportunity stage</apex:facet>
                        <apex:outputText value="{!opp.stagename}"/>
                </apex:column>
        </apex:dataTable>    
</apex:form>

</apex:page>

CONTROLLER;

public class opportunitydisplaycon9 {

    public String getOpp() {
        return null;
    }
   
    public pagereference actionfuncall1(){
     return null;
     }


public List<opportunity> opportunity;
    public PageReference hitme() {
        update opportunity;
        return null;
    }

  
   public List<opportunity> getopportunity()
   {

        opportunity = [select name,stagename from opportunity limit 10];

        return opportunity;

   }

}
hello guys
please answer me this requirement
i displayed list of opportunity names along with Editable input field stagenames parallelly  so when i enter any stagename and after clicking save ,all stagenames has to be updated at once.

tnks  
hi guys
please help me out with this  requiment
1.i displayed list of opportunity names&related stagenames in visualforce development mode,so now i want to navigate to detail page of that particular opportunity name ,when i clicked on it.
heres my code.
please tell me how do i do this by using javascript or by command link

PAGE:
<apex:page controller="opportunitydisplaycon" id="thePage">
<apex:form >
<script>
function generatedjs(){
gotodetail();
</script>
        <apex:dataTable value="{!opportunity}" var="opp" id="theTable"
                        styleClass="tableClass">

                <apex:facet name="caption">opportunity Details</apex:facet>

                <apex:column >
               
                                       
                        <apex:facet name="header">opportunity Name</apex:facet>

                         <a rerender="commandlink1" href="javascript:generatedJs();">{!opp.name}</a>
                                           
                        <apex:commandLink action="{!gotodetail}" id="commnadlink1"/>
                       
                       

                </apex:column>

                <apex:column >

                        <apex:facet name="header">opportunity stage</apex:facet>

                        <apex:outputText value="{!opp.stagename}"/>

                </apex:column>

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

CONTROLLER:
public class opportunitydisplaycon {

   public List<opportunity> opportunity;
   public List<opportunity> getopportunity()
   {

        opportunity = [select name,stagename from opportunity limit 10];

        return opportunity;

   }
   public PageReference gotodetail() {
        pageReference p=new pageReference('/'+'recordID');
        p.setredirect(true);
        return p;
       
    }

}

hi guys

i want to write a trigger on opportunity object,i.e we have Amount field in opportunity,so i want to display the maximum Amount of all the amounts i get from opportunity in Account object,having custom field as max amount in Acount object...

thnks

hello guys

pls help me out with this trigger...

my requirement is simple i.e after creating any account and saving that account i want to display Fax,Industry fields to the value that is specified in my trigger and want to create contact related to that account automatically....

trigger mysecondtrigger on Account (before insert,after insert)
{
if(trigger.isBefore)
{
for(Account acc:trigger.new)
{
acc.Fax='asdf';
acc.Industry='Tcs';
}
}
else{
for(Account acc:trigger.new)
{
contact c=new contact(LastName=' anynamehere');
c.AccountId=acc.Id;

}
}
}

 

 

 

Hello guys

hope all doing well

i have a small scenario pls help me out.

I have 10000 Accounts in my organisation and my question is , i want to update country field to 'USA'  to all my 10000 Accounts at a time..how do i achieve this...

Thanks

hi friends

pls help me with this simple scenario

I have 200 users ,in that i want to restrict "user 1" to view ,edit, or delete oppurtunity standard object only...how do i do this ..?

 

thanks

hello guys

pls help me out with this questions

1.what is a crono trigger? when and how do we use.

2.what is soql injection.

3.what r the winter 2013 special features did we notice so far as a salesforce developer..

4.if i write a soql quires without specifying LIMIT keyword ..how many records r iam going to retrieve thru database..

50 thousand records     ..          True or false

5.Does modify all and modify all data belongs to profiles?

6.what datatype is trigger.new,trigger.old,trigger.newmap and trigger.oldmap?

7.what is a user object?

8.whats the main use of @future annotation..

Ans.@future annotation is used to bypass governor limits            true or false

Thanks

Regards

hello guys

can u pls help me out with this small scenario...

In Account standard object,i created one picklist field name status i.e active and inactive.so, my question is if i selected active in status picklist,an email has to be generated automatically..how do i approach this...pls help me out..

Thanks

hello guys

pls tell me 

what r the limitations of rollup summary and how to overcome rollup summary.

pls answer me

hi guys

pls tell me how to share a record by using apex sharing practically.

 

thanks

hi guys

what r the permissions we have to give to any external java user in REST API CALL.

hi guys

1.can u pls tell me , is there any way to create contact and oppurtunity with out having account into consideration.