• vamshi(Nani)
  • NEWBIE
  • 15 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 29
    Replies

Hi Guys,
 

I am trying to bind recordtype pick list values with visualforce page, but I have got following exception.Can any body please help me.

<apex:page standardController="Opportunity">
    <apex:form >
            <apex:selectlist>
            <apex:selectOptions value="{!RecordType}"/>
            </apex:selectList>
    </apex:form>
</apex:page>

Error: Unknown property 'OpportunityStandardController.RecordType'

This is the trigger erroHI  this code makes me hell..
This is the trigger code on my opportunity but throwing above exception can you please help me... Let me give you detail explination.

I am new to triggers..the trigger is when I insert an opportunity a new opportunity should be created automatically on the opportunity  I write the trigger is below..but it is throwing exception as screen shot..

 

trigger new_oppy on Opportunity (after insert)
{  
    
    if(Trigger.isinsert)
    {
        opportunity o=new opportunity();
        o.name = 'vamshi opportunity';
        o.closedate = date.today();
        o.StageName='closedwon';
        insert o;
    }

 

 

ERROR:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger wrehoue.new_oppy caused an unexpected exception, contact your administrator: wrehoue.new_oppy: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, wrehoue.new_oppy: maximum trigger depth exceeded Opportunity trigger event AfterInsert for [0069000000LVsuf] Opportunity trigger event AfterInsert for [0069000000LVsug] Opportunity trigger event AfterInsert for [0069000000LVsuh] Opportunity trigger event AfterInsert for [0069000000LVsui] Opportunity trigger event AfterInsert for [0069000000LVsuj] Opportunity trigger event AfterInsert for [0069000000LVsuk] Opportunity trigger event AfterInsert for [0069000000LVsul] Opportunity trigger event AfterInsert for [0069000000LVsum] Opportunity trigger event AfterInsert for [0069000000LVsun] Opportunity trigger event AfterInsert for [0069000000LVsuo] Opportunity trigger event AfterInsert for [0069000000LVsup] Opportunity trigger event AfterInsert for [0069000000LVsuq] Opportunity trigger event AfterInsert for [0069000000LVsur] Opportunity trigger event AfterInsert for [0069000000LVsus] Opportunity trigger event AfterInsert for [0069000000LVsut] Opportunity trigger event AfterInsert for [0069000000LVsuu]: []: Trigger.wrehoue.new_oppy: line 11, column 1

HI,

Suppose when I click on the Account name it will redirected to detail page.

Now my question is if i click  Account Name [facebook] need to find out how many times the detail page has visited.

can I achieve this with out using visualforce? or using standard functionality of salesforce?

Thanks in advance.

<apex:page controller="SelectList3">
<apex:form >
<apex:selectList value="{!slv}" size="1">
<apex:actionSupport event="onchange" reRender="out" />
<apex:selectOptions value="{!value}">
</apex:selectOptions>
</apex:selectList>
</apex:form>
<apex:outputPanel id="out">
<apex:outputText value="{!slv}">

</apex:outputText>

</apex:outputPanel>

</apex:page>

--------------------------controller------------------------
public with sharing class SelectList3
{
public list<selectoption> getValue()
{
list<SelectOption> ls= new list<SelectOption>();
for(Contact acc:[select id, name from Contact])
{
ls.add(new SelectOption(acc.id,acc.name));
}
return ls;
}

public String slv { get; set; }

}

 

 

 

 

 

 

 

 

 

 

 

 

 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Now my question is how to pass the select value to a method..and fetch the value of record details with that id...Find detailed explination below..

In above code with the slv will return "id" of the selected value... Now using this Id I want to get related values of Account[ name etc..] please help me

 

I have a visual force page, On that page I created a pick list.. I am fetching the values of account. Now when I selected
One record related..Id  should display how can I do that?

The code as follows.

<apex:page controller="selectlist">
<apex:form >
<apex:selectList value="{!sv}" size="1" rendered="true" onselect="output">
<apex:selectOptions value="{!value}">
</apex:selectOptions>
</apex:selectList>
</apex:form>
<apex:outputPanel id="output">
<apex:outputLabel value="{!Iddisplay}">
</apex:outputLabel>
</apex:outputPanel>

</apex:page>

 

 

 

------------------------------------------------ APEX CLASS------------------------------------

public class selectlist
{
public String sv { get; set; }
public String getIddisplay()
{
return null;
}


public List<SelectOption> getValue()
{
List<SelectOption> option = new List<SelectOption>();
option.add(new selectoption('none','---Select--'));
for(Account ac: [Select Id,name From Account limit 5])
{
option.add(new SelectOption(ac.id,ac.name));

}
return option;
}



}

<apex:page controller="Selectpick">
<apex:form >
<apex:selectlist value="{!sv}">
<apex:selectOptions value="{!options}"/>
</apex:selectlist>
</apex:form>
</apex:page>

 

 

-----------------------APEX CLASS------------------------------

public class Selectpick
{

public List<selectoption> getOptions()
{
List<selectoption> option= new List<selectoption>();
option.add(new SelectOption('1','Value 1'));

return option;
}


public String sv { get; set; }
}

 

 

 

 

 

I got this error:

Error: Selectpick Compile Error: Constructor not defined: [Selectoption].<Constructor>(String, String) at line 7 column 20

 

 

 

May be you people will smile at me..but i am not able to do this programme

 

<apex:page controller="testdisplay">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="test" >
<apex:outputText value="{!display}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

public class testdisplay
{

public String display { get; set; }

public static string display()
{
return ('Hi viewers');
}
}

 

 

 

 

I am not getting the output as Hi viewers watz wrong with this programme

Hi All,
I want to auto populate the contact address fileds(Area Name, City n all) by just entering ZipCode

Ex: If i enter Zipcode As :591317 then i want to auto populate following fields..
Mailing City    
Mailing State/Province    
Mailing Zip/Postal Code    
Mailing Country

Some Solution: I thought of creating a custom object to store this info and write a trigger to populate these values..

But Please suggest any other best ideas, like goodle api integration or free apps in apexachage or any other best solutions...
It shold be free ..
 

This is the trigger erroHI  this code makes me hell..
This is the trigger code on my opportunity but throwing above exception can you please help me... Let me give you detail explination.

I am new to triggers..the trigger is when I insert an opportunity a new opportunity should be created automatically on the opportunity  I write the trigger is below..but it is throwing exception as screen shot..

 

trigger new_oppy on Opportunity (after insert)
{  
    
    if(Trigger.isinsert)
    {
        opportunity o=new opportunity();
        o.name = 'vamshi opportunity';
        o.closedate = date.today();
        o.StageName='closedwon';
        insert o;
    }

 

 

ERROR:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger wrehoue.new_oppy caused an unexpected exception, contact your administrator: wrehoue.new_oppy: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, wrehoue.new_oppy: maximum trigger depth exceeded Opportunity trigger event AfterInsert for [0069000000LVsuf] Opportunity trigger event AfterInsert for [0069000000LVsug] Opportunity trigger event AfterInsert for [0069000000LVsuh] Opportunity trigger event AfterInsert for [0069000000LVsui] Opportunity trigger event AfterInsert for [0069000000LVsuj] Opportunity trigger event AfterInsert for [0069000000LVsuk] Opportunity trigger event AfterInsert for [0069000000LVsul] Opportunity trigger event AfterInsert for [0069000000LVsum] Opportunity trigger event AfterInsert for [0069000000LVsun] Opportunity trigger event AfterInsert for [0069000000LVsuo] Opportunity trigger event AfterInsert for [0069000000LVsup] Opportunity trigger event AfterInsert for [0069000000LVsuq] Opportunity trigger event AfterInsert for [0069000000LVsur] Opportunity trigger event AfterInsert for [0069000000LVsus] Opportunity trigger event AfterInsert for [0069000000LVsut] Opportunity trigger event AfterInsert for [0069000000LVsuu]: []: Trigger.wrehoue.new_oppy: line 11, column 1

Hi,

        I have created permission set  its for not working properly.My requirement is two users(like user A,user B) both are having same role and same profile.. I want to give object level premission set that is VF tab.My VF Tab having two option only that is (available and visible) User A  need to be access available only and User B need to be access  available and visible only. Actually this task am trying for both user for accessing same permission,but i given different permission set both users.How can i do this.. please can any one give suggestion..



Thanks,
kathir

hi friends ,
pls help me to write following trigger
here contact is having custom field primary of type checkbox
● Each account may have multiple contacts but only one marked “Primary”
● Each account must have 1 primary contact.
● The account should display the name of its primary contact on the account detail screen (i.e. in a field).
Hello everyone,
     Good Morning,
     Please have a glance on  the code and images .My main target is to add entered text values to an array/list/map.
 {!textarray} ----->But If you look to figure 2 I am getting values in textarray .
But I am getting only last entered value i.e., eeeee. Previously entered values are getting replaced.
I think I need to add these "textArray" values to List.
To acheive that I changed the datatype of textarray as Map<String,String>  Then I got the error as shown below
[EXTERNAL]|System.TypeException: Invalid conversion from runtime type String to MAP<String,String>
....................................

VisualForce Code:
<apex:page controller="repeatandsave" showHeader="false">
  <apex:form >
   <apex:pageBlock >
    <apex:repeat value="{!con}" var="a" id="re">
         <apex:inputtext value="{!textarray}" id="in" >
            <!-- <apex:actionsupport event="onblur" action="{!loopList}"  rerender="re"/>-->
         </apex:inputtext>
         <br/>
    </apex:repeat>
    <apex:commandButton value="Save" action="{!myaction}"/>
   </apex:pageBlock>
  </apex:form>
</apex:page>
Controller/Apex Code:

public class repeatandsave {
    public Map<String,String> strList;
    public String textarray {get; set;}
    Map<Integer, Contact> mapToContact = new Map<Integer, Contact>();
    public list<contact> myconlist{set;get;}
   //Constructor
    public repeatandsave(){
        Integer i = 0;
        for (Contact a :[Select Id, Name From Contact limit 5]) {
            mapToContact.put(i, a);
            i++;
        }
       
    }
    
    public Map<Integer,Contact> getcon (){    
        return mapToContact;
    }
    //save action
    public void myaction(){
      
        system.debug('action invoked::::::::::+textarray'+textarray);
    }
}
ScreenShot:
                           fig 1
First Image
User-added image
                       fig2


Suppose Object Obj__c having 3 fields: Field1__c, Field2__c and Field3__c.
Suppose we do Obj__c obj1=[select Field1__c from Obj1__c where id=:someId]; //Suppose all fields are hainvg value.
obj1.Field2='ABCD';
update obj1;

Now, problem here is Field3__c is nullified.

So, do we have to give all fields in SOQL if we want to update that object (even for 1 field)?
Any solution is there if I don't want to select all fields? Or any other way is there?
You need to create a Custom field on HOA Setting called Default Account Id

you need to create a workflow rule on Contact so that whenever an account is created with blank contact , this Id will be stored in the Account id of the contact.'
I'm trying to render a second pageblock table, when a user clicks on a row with an outputlink in the first page block... Any thoughts on how/if I can do this?  I wrote a custom controller, but I can't get anything to display in the second block and the debug log isn't showing any indication that I'm clicking on a row in the first block.  I'm new to VF and having a tough time getting past this.
I  have a requirement like when the user clicks on a link it returns a download link and user should be able to download that file and stay on the same page.

 The problem is when the DL link is posted or redirected using page reference the page refreshes and gives a blank page.

any suggestion on how this could be done 
Hi;
We have developed an application with salesforce mobile SDK natif android; in the first authentication page there is checkbox "remember user name", but when i check it,  and return to the same page, the systeme don't remember the ancient logins  :

User-added image

So my question is : is there parameter to add to the webview wich contain this login page to store logins and let this checkbox work correctly.

Thanx.
  • June 18, 2014
  • Like
  • 1
I would like to display smiley faces instead of text (very unsatisfied, satisfied...) for a Choice field on a Visual Workflow screen. I tried adding the HTML <img> attribute using the Rich Text Editor for the Label field but it does not seem to work as I get the URL displayed. Any ideas would be greatly appreciated.

Thanks.
I would like a new opportunity created when the product field is modified.  Specifically, when I change a custom product field "Renewal Cost" to a value > 0, I want to trigger code to automatically create an opportunity.

I initially tried to do this using Flows, however, I cannot figure out how to trigger the flow when a Salesforce user modifies the "Renewal Cost" field.  If I manually run the flow, it seems to work fine (although it only works for the first "Renewal Cost" it finds). 

I spent a little time digging into Apex, however, have not been able to find any solutions.  I do not have any Apex coding experience, so if this is possible using Apex, please provide beginner details.  Thanks!

<apex:page controller="SelectList3">
<apex:form >
<apex:selectList value="{!slv}" size="1">
<apex:actionSupport event="onchange" reRender="out" />
<apex:selectOptions value="{!value}">
</apex:selectOptions>
</apex:selectList>
</apex:form>
<apex:outputPanel id="out">
<apex:outputText value="{!slv}">

</apex:outputText>

</apex:outputPanel>

</apex:page>

--------------------------controller------------------------
public with sharing class SelectList3
{
public list<selectoption> getValue()
{
list<SelectOption> ls= new list<SelectOption>();
for(Contact acc:[select id, name from Contact])
{
ls.add(new SelectOption(acc.id,acc.name));
}
return ls;
}

public String slv { get; set; }

}

 

 

 

 

 

 

 

 

 

 

 

 

 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Now my question is how to pass the select value to a method..and fetch the value of record details with that id...Find detailed explination below..

In above code with the slv will return "id" of the selected value... Now using this Id I want to get related values of Account[ name etc..] please help me