• new siva
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
While deploying reports, getting error  ---->timeFrameFilter-interval: Invalid value specified: current.  need some help.
Can users with platform License see child of Opportunity, with MD relationship, opportunity on Master side and this custom object being on Detail side?
HI all , please help me with the following.

Suggest how can i fetch opportunities for which Child record 'Invoice' with Status=Approved was created in the last 24 hours without using rollup summary. I'm fetching these in a batch class
Hi 
Can someone help me with this. When case created, depending on the criteria, it should add a milestone when status=new. But it's not showing on case detail page.
Trouble with completing trailhead challenge. Getting the below error even after creating a report
Challenge Not yet complete... here's what's wrong: 
The custom report named 'High Value Opportunities' wasn't found.


 
Can users with platform License see child of Opportunity, with MD relationship, opportunity on Master side and this custom object being on Detail side?
Trouble with completing trailhead challenge. Getting the below error even after creating a report
Challenge Not yet complete... here's what's wrong: 
The custom report named 'High Value Opportunities' wasn't found.


 
I wrote a trigger for updating contact Phone, Title based on Account Ownership == 'Private' (picklist) and Phone, AccountNumber
if(Account Ownership == 'Private')
contact Phone = account phone
contact   Title = account  AccountNumber ...But i am getting error Can anyone explain me the Solution. Just Learning and Practicing based on someones scenarios ...Thank you

Code: trigger updateFieldsOnContact on Account (after insert, after update)
{
    set<id> setAccid = new set<id>();
    for(Account acc:trigger.new){
        if(acc.Ownership =='Private' && acc.AccountNumber !=  Null && acc.Phone !=Null){
            setAccid.add(acc.Id);
        }
    }
    if(setAccid.size()>0)
            {
                map<id, account> mapAccCons = new map<id, account>([select id, (select id, Phone, Title from Contacts) from Account where id in :setAccid]);
               list<Contact> cons = new List<Contact>();
                for(account acc:trigger.new)
                        {
                            if(acc.Ownership == 'Private' && mapAccCons.containsKey(acc.Id).Contacts)
                                {
                                List<Contact> newUpdatingCons = mapAccCons.get(acc.Id).Contacts;
                                for(Contact cont : newUpdatingCons){
                                    cont.Phone = acc.Phone;
                                    cont.Title = acc.AccountNumber;
                                    cons.add(cont);
                                    
                                }
                                
                         }
                   
               }
                if(cons.size()>0){
                    update cons;
                }
        
    }
}
 
I have a trigger that is creating a ton of errors. 

Active Contact Trigger - This trigger counts the number of active contacts (contacts that have been touched by the account owner in the last 14 days) and displays the total number on the Account. 
  • ERRORS THAT I AM GETTING FROM THIS TRIGGER: 
    • ActiveContact: execution of AfterUpdate caused by: System.DmlException: Update failed.
    • ActiveContact: System.LimitException: ApexCPU time limit exceeded
Here is the trigger itself: 
trigger ActiveContact on Contact (after insert, after update) {
    Contact[] cons;
    if (Trigger.isDelete) 
        cons = Trigger.old;
    else
        cons = Trigger.new;
    // get list of accounts
    Set<ID> acctIds = new Set<ID>();
    for (Contact con : cons) {
            acctIds.add(con.AccountId);
    }
    Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
                                                            ,AccountId
                                                            from Contact
                                                            where AccountId in :acctIds
                                                            AND Active_Contacts__c = 1 ]);
    
    Map<ID, Account> acctsToUpdate = new Map<ID, Account>([select Id
                                                                 ,Number_of_Active_Contacts__c
                                                                  from Account
                                                                  where Id in :acctIds]);
                                                                 
    for (Account acct : acctsToUpdate.values()) {
        Set<ID> conIds = new Set<ID>();
        for (Contact con : contactsForAccounts.values()) {
            if (con.AccountId == acct.Id)
                conIds.add(con.Id);
        }
        if (acct.Number_of_Active_Contacts__c != conIds.size())
            acct.Number_of_Active_Contacts__c = conIds.size();
    }
    update acctsToUpdate.values();
}


Can anyone give insight into why I am getting these errors? 
 

Good day.

I am trying to prevent users from deleting files they have uploaded via the Files related list on Cases. I want to add simple code in a trigger that will warn a user that he cannot delete Files linked to Cases. 

These files are stored as FeedItems that points to the ContentVersion and ContentDocument objects.
The issue that I have is that none of the triggers fires when a user deletes a File on cases. When you add a File via the related list upload button, 2 triggers fire (ContentVersion and ContentDocumentLink), but with a delete the before OR after delete events never executes.

Can anyone shed some light on this behaviour?

Thanks,
Rudolf Niehaus