• Karamala Damodar
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 12
    Replies
Hey guys I have a question,

I was about to develop a trigger for my opportunity, that's how I started :

trigger MailTrigger on Opportunity (after insert) {

  List<Opportunity> opportunity = new List<Opportunity>();



basically I want to implement a method that sends an Email to the new opportunity as soon as this one has been added to the list, my question now is, how exactly do I 'reach out' to the object (Opportunity, new added opportunity) in order to create a method (In this case probably an If-method) so that I can implement this trigger? I started off like this, is this the correct way? I would be glad if someone could explain, this is all still a little tricky for me. 
 
Hi folks,
    Can anyone tell me how to get the list of dependent picklist options in apex?

My usecase is:
I have a pair of dependent picklists. In Apex code, how can I determine what options are valid in the dependent field for each option in the controlling field?

I’ve tried using getPicklistValues(), but there doesn’t seem to be any way of getting dependency information.



Thanks in advance
Karthick
Hai every one i am using pageblockenhanver or pageblocktableADV both i tried , for sorting but its not happpening i dont no why just watch what the steps i did
1.first i installed unmanaged pakage for pageblocktableenhancer component
2.i written the follwing code but i didnt get what i want 

<apex:page standardController="contact" recordSetVar="contacts">
  <c:PageBlockTableEnhancerADV targetPbTableIds="mid" paginate="true" defaultPageSize="5" pageSizeOptions="5,10,20,30,40,50,100"/>    
   <apex:pageBlock >   
     <apex:pageBlockTable value="{!contacts}" var="con" id="mid">   
      <apex:column value="{!con.Name}"/>   
     </apex:pageBlockTable>    
    <!-- <apex:pageBlockTable value="{!contacts}" var="con" id="mid2">   
      <apex:column value="{!con.Name}"/>   
     </apex:pageBlockTable>    --> 
   </apex:pageBlock>  
</apex:page>
tell me step by step process what we do first is any settings like that.can any one help how to add picklist values through coding. Iam using metadata but it shows undefined metadata.portnumber like that
 
Hey guys I have a question,

I was about to develop a trigger for my opportunity, that's how I started :

trigger MailTrigger on Opportunity (after insert) {

  List<Opportunity> opportunity = new List<Opportunity>();



basically I want to implement a method that sends an Email to the new opportunity as soon as this one has been added to the list, my question now is, how exactly do I 'reach out' to the object (Opportunity, new added opportunity) in order to create a method (In this case probably an If-method) so that I can implement this trigger? I started off like this, is this the correct way? I would be glad if someone could explain, this is all still a little tricky for me. 
 
I am attempting to add a VisualForce page as a component to the Right Sidebar in the Custom Console Components for a Person Account layout. My VF Page simply has the following:


<apex:page standardController="Account">
    <apex:includeScript value="/support/console/20.0/integration.js"/>
    <p>[PLACEHOLDER] All tasks and activities for person account and opportunities</p>
</apex:page>

There is also a related list of the Person Account's Opportunities in the same sidebar above the VF Page (which renders correctly).

I've verified that the VF Page is accessible by the System Administrator user that I'm logged in as. 
Hi folks,
    Can anyone tell me how to get the list of dependent picklist options in apex?

My usecase is:
I have a pair of dependent picklists. In Apex code, how can I determine what options are valid in the dependent field for each option in the controlling field?

I’ve tried using getPicklistValues(), but there doesn’t seem to be any way of getting dependency information.



Thanks in advance
Karthick
trigger to copy parent field data to child field data 
like i have copy data from class (parent)to subject(child) but by matching the name of both child and parent 
Hi,

I have hardcoded the lead id in my code.Can anyone please tell me how to get the current lead Id.

I have hardcoded the leadid in my code and it works fine.

Below is my code..just need  help in how to  pickup the Lead Id dynamically like :camp.Id

public with sharing class singleListView {
    public Campaign camp {get; set; }
    
    public singleListView(ApexPages.StandardController controller) {
        camp = (Campaign)controller.getRecord();
        
    }
    
   private List<Schema.Lead> CampaignMembers;
    public List<Schema.Lead> getCampaignMembers() {
   CampaignMembers=[Select Id,Name,(Select id, Campaign.Name,Contact.Phone,Lead.FirstName,Lead.LastName,LeadID,Lead.Phone,Lead.Email, Lastmodifieddate,Status,CampaignId,Campign_ID__c,Lead.MobilePhone  From CampaignMembers where CampaignId =:camp.Id and Status != '' and LeadId != null), 
(Select Subject, Id,lastModifiedDate From ActivityHistories  where lastModifiedDate !=null and Subject !=null order by LastModifiedDate desc limit 1) 
From Lead  where Name !=NULL and Id='00Q90000008fA5OEAU'  order by LastModifiedDate desc];

       return CampaignMembers;
       
     
         }     }
         
I created a trigger to prevent the deletion of a parent record if a child record exists. I'm having problems with the test class. It says required field missing "Dept_Code__c". I have it in the test class, so I'm not sure what I'm missing.
Parent Object - Order_Request__c (Quantity, Cost Center (lookup), Order Type (lookup) are required fields.

Child Object - Order_Assignment__c (Order Request, Order Center (lookup) are required fields)

Any help is greatly appreciated.

trigger PreventOrderDeletion on Order_Request__c (before delete) {


    for(Order_Request__c lq : [Select Id, Name, (Select Id from Order_Assignments__r) from Order_Request__c where Id IN :trigger.oldMap.KeySet()]){

            if(lq.Order_Assignments__r != null && lq.Order_Assignments__r.size() > 0){

              lq.addError('The order request cannot be deleted because there is an associated order assignment record');

            }
     } 



@IsTest(SeeAllData=true)
public class PreventOrderDeletionTest{

static testMethod void PreventDeleteTest()
{
    //Create Parent Object
    Order_Request__c lic = new Order_Request__c(Name='Salesforce Testing');
    lic.Quantity__c = Decimal.valueOf('1.0');
    lic.Order_Type__c = 'a6xxxxxxxxxxxx';
    lic.Dep_Code__c = 'a6Oxxxxxxxxxxx';
    insert lic;

    //Start Test & create child object
    test.startTest();

    Order_Assignment__c asgn = new Order_Assignment__c();


    //Relate Child to the Parent from the inserted record above
    asgn.Order_Request__c = lic.Id;
    asgn.Dep_Code__c = lic.Default_Code__c;

    //Insert Child Record
    insert asgn;

    try {
    delete lic;
        } catch (Exception e) {
           system.assertEquals('You cannot delete this record!', e.getMessage());
          }
   //Stop Test
   test.stopTest();
}  
}


Hi everyone,

I'm able to update an existing picklist on Salesforce ,however when creating new value inside this picklist,the picklist appear in Slaesforce as Availlbale value thus not appear in the picklist.

I want them to be automatically accessible in the picklist thus I waqnt the new value created as selected value in the record type.

Any code to do that ?
if not any code to modify the records type ?

Thank you in advance for your answer.

Quentin.