• suresh143
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 33
    Replies
<apex:page controller="Boss" >
<apex:form >

   <apex:pageBlock title="Get Accnames" >
   <apex:pageBlockSection >
   <apex:pageBlockSectionItem >
   <apex:outputPanel >AccNames:</apex:outputPanel>
   </apex:pageBlockSectionItem>
  
   <apex:selectList multiselect="FAlse" size="1"></apex:selectList>
   <apex:selectOptions value="{!AccNames}"></apex:selectOptions>
   </apex:pageBlockSection>
   </apex:pageBlock>
</apex:form>
 
</apex:page>


Controller:
public with sharing class Boss {

    public String AccNames { get; set; }
   
   
   
   List<SelectOption>Options=new List<SelectOption>();
   
    public List<SelectOption>getAccNames(){
   
    for(Account Acc:[select id,name From Account])
    
    Options.add(new selectOption(Acc.name,Acc.name));
   
   
   return Options;
    }
   
  
}


The Account name values dosent get that pick list plase share me with answer.

Thank for advance!!
HI all,

I have one object like trasactions tehre is two fields like one purchase date ,points expiry,  and the customer do transaction on purchase 3000 rs get 60 points then  from transaction date  to after one month the points expiry message to appear  in  points expiry field  please how to achive this

please give the 

User-added image


how to create through vf page please give that code 
A Visual Force page needs to be created. I should have a dummy list of Team. When user enter any text in “Team filter” (Text box). The team list should filter based on input.  E.g. If user will type Team A, then starting from Team A all the Team A will appear below the Team Filter.
A Visual Force page needs to be created. I should have a dummy list of Team. When user enter any text in “Team filter” (Text box). The team list should filter based on input.  E.g. If user will type Team A, then starting from Team A all the Team A will appear below the Team Filter.
A Visual Force page needs to be created. I should have a dummy list of Team. When user enter any text in “Team filter” (Text box). The team list should filter based on input.  E.g. If user will type Team A, then starting from Team A all the Team A will appear below the Team Filter.

Once i have created record in account object and automatically created releted list contact  record created how to achive this 

Once i have created record in account object and automatically created releted list contact  record created how to achive this  

Ihave an account object there is one field no of opportunitys.once i had created new record with account and no of opportunitys  count displayed in Account object field like no of opportunitys in detail page  

trigger trgopp2 on Opportunity (before insert,before update) {

for(Opportunity opp:trigger.new){ if(opp.Name != null){ user usr=[select id,name from user where id =: opp.ownerid]; opp.Owner_field__c=usr.name; } } }

 iam an one req once i have created opportunity  the number of opps releted accounts count displayed in account object  and account having field Number of opportunities write trigger asking pls given that one

Hi swetha so you great i think so and one more is there
write trigger account and opp then once created opp how many number of opp is displyed in account object in number of opps field in acc object

trigger ValidateAmountValueAndTotalamount on Opportunity ( before insert, before update ) {    

for ( Opportunity opp : Trigger.new )        

{       

  if(opp.name!=null)        

{       

user usr=[select id,name from user where id =: opp.ownerid];

              opp.Owner_field__c=usr.name;

               String CSDRid= [Select Id from RecordType where RecordType.Name='Sales Opportunity-CSD'].Id;

              if(opp.Stagename == 'New Opportunity' && opp.Probability == 10 && opp.RecordTypeId==CSDRid)    

   {      

  if(opp.Amount == null)      

  {           

opp.Amount.addError('****enter something yar****');     

}       

if ( opp.Total_Amount__c == null )    

{            

opp.Total_Amount__c.addError( 'Please enter a value Total Amount.' );       

  }

}

 

.The creator(Owner of the opportunity) will get copied to Initial Owner field. for trigger pls give that code

Create an Opportunity.
2. Select an Account which have Restricted Account Sharing = TRUE.
3. Enter any other mandetory information in Opportunity.
4. Click on Save to save the Opportunity

 

test script

 The BU information got populated on Opportunty. bu profile
. Opportunity's Legally Restricted value was set to True.
3 Opportunity was not shaerd.

Hi Account object is there one button is creted called download click that button account detail page data converted into excel format pls give that code And kindely share that one

Pls record type creation and add page layouts pls see the information

 Set the Stage = “New Opportunity” , Probablity = “10%”  3. Do NOT put values in OEM or Total fields.

 

test script:

 

Please enter "OEM" field!
2. Please enter "Total Value" field!

How  to get the current page date in pdf format once click download button in object  

 

 

Kindely Share that Code fully pls

<apex:page controller="Boss" >
<apex:form >

   <apex:pageBlock title="Get Accnames" >
   <apex:pageBlockSection >
   <apex:pageBlockSectionItem >
   <apex:outputPanel >AccNames:</apex:outputPanel>
   </apex:pageBlockSectionItem>
  
   <apex:selectList multiselect="FAlse" size="1"></apex:selectList>
   <apex:selectOptions value="{!AccNames}"></apex:selectOptions>
   </apex:pageBlockSection>
   </apex:pageBlock>
</apex:form>
 
</apex:page>


Controller:
public with sharing class Boss {

    public String AccNames { get; set; }
   
   
   
   List<SelectOption>Options=new List<SelectOption>();
   
    public List<SelectOption>getAccNames(){
   
    for(Account Acc:[select id,name From Account])
    
    Options.add(new selectOption(Acc.name,Acc.name));
   
   
   return Options;
    }
   
  
}


The Account name values dosent get that pick list plase share me with answer.

Thank for advance!!
HI all,

I have one object like trasactions tehre is two fields like one purchase date ,points expiry,  and the customer do transaction on purchase 3000 rs get 60 points then  from transaction date  to after one month the points expiry message to appear  in  points expiry field  please how to achive this

please give the 

hello :) i searched this code to prevent duplication of records in an object.

trigger PreventFuelDuplication on Fuel__c (before insert, before update) {
    Map<String, Fuel__c> leadMap = new Map<String, Fuel__c>();
    for (Fuel__c lead : System.Trigger.new) {
           
        if ((lead.Name != null) && (System.Trigger.isInsert || (lead.Name != System.Trigger.oldMap.get(lead.Id).Name))) {
            if (leadMap.containsKey(lead.Name)) {
                lead.Name.addError('This Fuel already exists.');
            } else {
                leadMap.put(lead.Name, lead);
            }
       }
    }
   
    for (Fuel__c lead : [SELECT Name FROM Fuel__c WHERE Name IN :leadMap.KeySet()]) {
        Fuel__c newLead = leadMap.get(lead.Name);
        newLead.Name.addError('This Fuel already exists.');
    }
}

i need to create a test class for this and i have no idea how. can anyone help me please?

 

  • December 24, 2013
  • Like
  • 0

Ihave an account object there is one field no of opportunitys.once i had created new record with account and no of opportunitys  count displayed in Account object field like no of opportunitys in detail page  

trigger trgopp2 on Opportunity (before insert,before update) {

for(Opportunity opp:trigger.new){ if(opp.Name != null){ user usr=[select id,name from user where id =: opp.ownerid]; opp.Owner_field__c=usr.name; } } }

 iam an one req once i have created opportunity  the number of opps releted accounts count displayed in account object  and account having field Number of opportunities write trigger asking pls given that one

Hi swetha so you great i think so and one more is there
write trigger account and opp then once created opp how many number of opp is displyed in account object in number of opps field in acc object

trigger ValidateAmountValueAndTotalamount on Opportunity ( before insert, before update ) {    

for ( Opportunity opp : Trigger.new )        

{       

  if(opp.name!=null)        

{       

user usr=[select id,name from user where id =: opp.ownerid];

              opp.Owner_field__c=usr.name;

               String CSDRid= [Select Id from RecordType where RecordType.Name='Sales Opportunity-CSD'].Id;

              if(opp.Stagename == 'New Opportunity' && opp.Probability == 10 && opp.RecordTypeId==CSDRid)    

   {      

  if(opp.Amount == null)      

  {           

opp.Amount.addError('****enter something yar****');     

}       

if ( opp.Total_Amount__c == null )    

{            

opp.Total_Amount__c.addError( 'Please enter a value Total Amount.' );       

  }

}

 

.The creator(Owner of the opportunity) will get copied to Initial Owner field. for trigger pls give that code

Hi,

 

I am trying to write the  Trigger code when the status of the case is changed and any other changes in fields with conditional loops for changing the Mail subject.

 

The issue was on trigger that send the same mail subject when i changed the status or changed the iother fields in the case.

 

The following is my code,

trigger caseUpdationMailNotification on Case ( after update) {
    contact relatedCaseContact;
    CaseComment Cscmnt;
    for(case Cases :trigger.new){
    relatedCaseContact = [SELECT Email FROM Contact WHERE Id = :Cases.ContactId];
      Messaging.reserveSingleEmailCapacity(1);
               //Fetch the related case contact.
       Messaging.SingleEmailMessage CaseNotificationmail = new Messaging.SingleEmailMessage();  
       CaseNotificationmail.setToAddresses(new List<String> { relatedCaseContact.Email });
       CaseNotificationmail.setReplyTo('ambigaraman@gmail.com');
       CaseNotificationmail.setSenderDisplayName('Salesforce Support');            
      
	  If(Cases.Status =='Working'){      
       CaseNotificationmail.setSubject(' Case Status updation : ' +'Changed to working. '+'Case Number:' + Cases.CaseNumber);
       CaseNotificationmail.setPlainTextBody('Your case Status: ' + Cases.CaseNumber +'To view your case <a href=https://na1.salesforce.com/'+Cases.Id);}
       
  If(Cases.Status =='Escalated'){          
   
    CaseNotificationmail.setSubject(' Case Status updation : ' +'Changed to Escalated. '+ 'Case Number:' +Cases.CaseNumber);
    CaseNotificationmail.setPlainTextBody('Your case Status: ' + Cases.CaseNumber +' has been updated.'+'To view your case <a href=https://na1.salesforce.com/'+Cases.Id);
    }   
    
 If(Cases.Status =='closed'){           
    
    CaseNotificationmail.setSubject(' Case Status updation : ' +'Changed to closed. '+ 'Case Number:' +Cases.CaseNumber);
    CaseNotificationmail.setPlainTextBody('Your case Status:' + Cases.CaseNumber +' has been updated.'+'To view your case <a href=https://na1.salesforce.com/'+Cases.Id);
    }     
else{  
    CaseNotificationmail.setSubject(' Case  updation : ' + 'Case Number:'+ Cases.CaseNumber);
    CaseNotificationmail.setPlainTextBody('Your case : ' + ' has been updated.'+'To view your case <a href=https://na1.salesforce.com/'+Cases.Id);
    } 
	
	
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { CaseNotificationmail });
 }
}

 If i use 'elseif', It again send the email with subject for status changed,

 

Can anyone help me to write the trigger that send the mail that send when we change the status only. or there is only changes in other fields(not in status) of the case?

 

Thanks & Regards.,

Ambiga