• AnuSh
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies
Hi Guys,
I'm new to developing

,User-added image


Can anybody help me in writing triggers
I have three objects 
opportunity: object
Service_Offered__C :object 
Product: Object
Same service and same vendor Considered as one.
Regarding above screen shot scenario: Four unique services 
Requirement: I would like to count unique services offered based on opportunity.


Let me know if you have any questions. Thanks in advance .
 
 
  • April 03, 2017
  • Like
  • 0
Subject: I would like to convert Email to case related to recent opportunity ( i have written the code email to case related to opportunity but I would like to assign recent opportunity)

For your reference, i have attached the code

Drawback: My cases assigned to  All related opportunities 

Code:
trigger CasetoAccountInsert on Case (before insert) {

    for(Case record: Trigger.new)
    {
        List<Opportunity> OpportunityList = [SELECT AccountId, Name FROM Opportunity WHERE Contact_Email__c = :record.SuppliedEmail] ;
        if (OpportunityList.size() > 0)
        {
            record.AccountId  = OpportunityList[0].AccountId;                            
        }
    } 
    
}



Thanks in Advance
AnuSh
  • February 24, 2017
  • Like
  • 0
Hi Guys,

Need some help !!

I'm new to Apex Developing. I'm trying to create the opportunities count in the Product object. 
Note: Account object is not Master Details (A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.)

So guide me in other way to create opportunity count in product object field.
  • October 13, 2016
  • Like
  • 0
Subject: I would like to convert Email to case related to recent opportunity ( i have written the code email to case related to opportunity but I would like to assign recent opportunity)

For your reference, i have attached the code

Drawback: My cases assigned to  All related opportunities 

Code:
trigger CasetoAccountInsert on Case (before insert) {

    for(Case record: Trigger.new)
    {
        List<Opportunity> OpportunityList = [SELECT AccountId, Name FROM Opportunity WHERE Contact_Email__c = :record.SuppliedEmail] ;
        if (OpportunityList.size() > 0)
        {
            record.AccountId  = OpportunityList[0].AccountId;                            
        }
    } 
    
}



Thanks in Advance
AnuSh
  • February 24, 2017
  • Like
  • 0
Hi Guys,

Need some help !!

I'm new to Apex Developing. I'm trying to create the opportunities count in the Product object. 
Note: Account object is not Master Details (A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.)

So guide me in other way to create opportunity count in product object field.
  • October 13, 2016
  • Like
  • 0