• Jagannatha Reddy Bandaru
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
i have created a button in detailed page that is send email , if i click that button how email will be forward from there,i think it is work out from java script but how??
please share your valuable suggestions .

i have created a button in detailed page that is send email , if i click that button how email will be forward from there,i think it is work out from java script but how??
please let me share your valuable suggestions .





Thanks,
Jagan
i have created a picklist in vf page i.e.,like locations field in that when i select a location i want to display related records regarding locations ok that's fine,

after that one when i load the page i want to display by default particular location records that is also fine but i am not getting the location name in the picklist field

it is displaying none only. how should i get that one with out selecting a location.
hi I am getting this Error Colud you Please Check... Error:System.QueryException: List has no rows for assignment to SObject
Class.Mysecondcontroller.<init>: line 4, column 1


here is My Apex Class and VF Code
public class Mysecondcontroller {
 Public Opportunity opp;
  Public Mysecondcontroller(){
    Opp=[select id, name,CloseDate,StageName from 
          Opportunity where id=:ApexPages.currentpage().getParameters().get('Id')];
          
}
 Public Opportunity getOpportunity(){
   return opp;
  }
       Public pageReference SaveMethod(){
       Update Opp;
         return null;
  } 
}
<apex:page controller="Mysecondcontroller" tabStyle="Opportunity">
<apex:form >
<apex:pageBlock title="Opportunity Detail">
<apex:pageBlockButtons >
<apex:commandButton value="Save The Opportunity" action="{!SaveMethod}"/>
</apex:pageBlockButtons>
<apex:pageblockSection title="Opportunity" Columns="2" collapsible="False">
<apex:inputField value="{!Opportunity.Name}"/>
<apex:inputField value="{!Opportunity.CloseDate}"/>
<apex:inputField value="{!Opportunity.StageName}"/>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


 
This code is giving an error in tabindex.This tabindex is not available in component library.The code snipet is from visualforce guide.Could you please tell if there is any versionong issue or anything?
<apex:page standardController="Account">
    <apex:form>
    <apex:pageBlock title="Edit Account: {!Account.Name}">
        <apex:pageBlockSection title="Account Details" columns="1">
            <apex:inputField value="{!Account.Name}" tabIndex="4"/>
            <apex:inputField value="{!Account.Website}" tabIndex="3"/>
            <apex:inputField value="{!Account.Industry}" tabIndex="2"/>
            <apex:inputField value="{!Account.AnnualRevenue}" tabIndex="1"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Thanks in advance.
Hello folks,

I have a need to improve the way I develop triggers - currently I am using more than one trigger per object with all logic within it. I am aware that it is, probably, the worst way to do it.  I have been analysing all the techniques and during my searches, I have come across with the following article: https://developer.salesforce.com/page/Trigger_Frameworks_and_Apex_Trigger_Best_Practices

It would be important and tremendously welcomed, have your opinion to decide which approach I should adopt.
I'am creating a custom button named "attach file"  on the contact detail page i want to hide the "attach File" button from the "Notes and Attachments" section in he related list
Quesn:How can I hide the Attach File button from Notes & Attachments related list?
Please help me out with this issue
Hi,

When I trying to access standard page eliment from visualforce page component (as HTML componet is obsolate) and I'm getting the below error
"Uncaught SecurityError: Blocked a frame with origin "https://c.cs30.visual.force.com" from accessing a frame with origin "https://cs30.salesforce.com". Protocols, domains, and ports must match".

User-added image
Please any one suggest me how to impliment visualforce area in homepagecomponents.

Thanks,
Shirisha.
Hi folks,
           Can anyone tell me the purpose of scheduler classes and how to use scheduler class?
I need a simple code for scheduling so that I can know process of scheduler class..




Thanks in advance
Karthick
Hi All,
           I want to make a visualforce page and i want to override standard functionality like show related list in visualforce page so how can i achive it ?. And then i want to show this related list in visualforce page similer to standard object related list.

i have created a button in detailed page that is send email , if i click that button how email will be forward from there,i think it is work out from java script but how??
please let me share your valuable suggestions .





Thanks,
Jagan

Hi All, in my custom object I am having a cutom button"convert" when i click this button"convert"it will  create new Account,Contact and Opportunity. But I need to do same as Lead(Ie,. in Lead if click "convert" button it will go to an other page where we can existing Account for that or we can create a new Account. For creating Opportunity it will have a checkbox which will ask us whether we have to new opportunity for that record, after we made all this we again  "convert")

Like that when i click my custom button"convert" on my custom tab, it must go to another window from that page we have select Account for that(existing or new) if i select existing account means all Account must be displayed in the listbox, we have to select any from that and we have to  create a new opportunity for that record.

 

Here i have attached my Apex code to create Account, contact and opportunity.Also VF page code.

Apex code:

 

public class Convert
{

public PageReference RedirecttoSite()
{
String currentLead = '/' + siteObj.Id;
PageReference pageRef = new PageReference(currentLead);
return pageRef;
}

private Site__c siteObj;
//public ID Cus_Account_ID, Cus_obj_Record_ID;
// The extension constructor initializes the private member
// variable acct by using the getRecord method from the standard
// controller.
public Convert(ApexPages.StandardController stdController)
{
System.debug('******sai******');
siteObj = (Site__c)stdController.getRecord();
// Cus_obj_Record_ID=siteObj.Id;
}
List<Account> acctList = new List<account>();
public void convertbutton()
{

Account acc = new Account();
acc.Name = siteObj.Company_Name__c;
acctList = [select id from Account where Name = :acc.Name];
if (acctList.size() > 0)
{

ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'Account Name ' + acc.Name + ' already exists,Duplicate Account Name not allowed');
ApexPages.addMessage(errormsg);
return;
}
acc.BillingStreet = siteObj.Company_Address__c;
acc.BillingCity = siteObj.Company_City__c;
acc.BillingState= siteObj.Company_State__c;
acc.BillingPostalCode = siteObj.Company_Postal_Code__c;
acc.Phone = siteObj.Company_Phone__c;
acc.Website = siteObj.Company_Email__c;
acc.Fax = siteObj.Company_Fax__c;
// acc.CurrencyIsoCode = siteObj.CurrencyIsoCode;

try
{
insert acc;
ApexPages.Message successmsg = new ApexPages.Message(ApexPages.severity.confirm,'New Account ' + acc.Name + ' is created, Related Contact and Opporunity also created' );
ApexPages.addMessage(successmsg);
}
Catch (Exception ex1)
{
ex1.getmessage();
}
Contact cc = new Contact();
cc.LastName = siteObj.Contact_Name__c;
cc.Email = siteObj.Contact_Email__c;
cc.Phone = siteObj.Contact_Mobile__c;
cc.AccountId = acc.Id;

try
{
insert cc;
}
Catch (Exception ex2)
{

ex2.getmessage();
}

Opportunity opp = new Opportunity();
opp.Name = siteObj.Opp_Name__c;
opp.AccountId= acc.Id;
opp.CloseDate = siteObj.Opp_CloseDate__c;
opp.StageName = siteObj.Opp_stage__c;
if(opp.StageName == 'Needs Analysis')
opp.Probability= 20;
else if(opp.StageName == 'Prospecting')
opp.Probability= 10;
else if(opp.StageName == 'Negotiation/Review')
opp.Probability= 90;
else if(opp.StageName == 'Closed Won')
opp.Probability= 100;
else if(opp.StageName == 'Closed Lost')
opp.Probability= 0;

try
{
insert opp;
}
Catch (Exception ex3)
{
 ex3.getmessage();
}

}
 }

 

VF page code for "convert"button:

<apex:page standardController="Site__c" cache="true" action="{!convertbutton}" extensions="Convert" >
<br/><br/>
<apex:messages style="color:red; font-weight:bold; text-align:center;"/>
<apex:form >
<center>
<!--<apex:pagemessages />-->
<apex:outputField value="{!Site__c.Company_Name__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_Address__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_City__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_State__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_Postal_Code__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_Phone__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_Email__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Company_Fax__c}" rendered="false"/>

<apex:outputField value="{!Site__c.Contact_Name__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Contact_Email__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Contact_Mobile__c}" rendered="false"/>

<!--<apex:outputField value="{!Site__c.CurrencyIsoCode}" rendered="false"/>-->
<apex:outputField value="{!Site__c.ConvertedSite__c}" rendered="false"/>

<apex:outputField value="{!Site__c.Opp_Name__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Opp_CloseDate__c}" rendered="false"/>
<apex:outputField value="{!Site__c.Opp_stage__c}" rendered="false"/>


<apex:commandLink value="Redirect to Site" style="color:blue; font-weight:bold;" action="{!RedirecttoSite}"/>

</center>

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

 

Any one tell how to do this. kindly give me any idea for this and tell me any sample code for this.Waitng for your reply

 

Regards,

Lavanya.