• Saurabh Smarty
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 6
    Replies
Hi All,

I am trying to get a list of all opportunities who have associated events and the event status is completed, below is the query I made :

SELECT Id,Name,Date_of_Last_Completed_Event__c,(select id, Status__c, EndDateTime from events where Status__c = 'Completed') from Opportunity where Date_of_Last_Completed_Event__c = null

While running the query in query editor its fetching those opportunites as well who have no associated events which is not needed and because of this its fetching more than 1 lac records. I am not sure what is wrong here, any help is greatly appreciated !!!
Hi All,
I have a small query, if a profile has view all and modify all permission on a standard object, will that user be able to delete records of that object
owned by other users even if the owd is set as private?
Hi All,

I have a scenario, wherein I have a custom field thats made of 8 characters- first four being letters and the next four digits. I need to increment the letters part every time a new record of this object is inserted and it has to be unique for every record.
I want to do this using apex triggers.
Any help appreciated !
Hi All,

I created a new custom field, added it to 4 page layouts and its permission was read/editable by all. When i moved this field from DEV to UAT using change set, only the new field was copied, it was not added in the page layouts and its permissions were not there as well, it was hidden from all profiles. What did I miss here??
I have an idea that we can use getdescribeField method of schema class and arranging it in map through getMap() method but not sure how ll it be actually implemented.

Thanks in Advance!
Below is the trigger :
trigger attach on Attachment (after insert) {
public List<opportunity> oppoList = new List<opportunity>();
   public Set<Id> oppIds = new Set<Id>();
    for(Attachment att : trigger.New){
         //Check if added attachment is related to Account or not
         if(att.ParentId.getSobjectType() == Opportunity.SobjectType && att.name ??? ){
              oppIds.add(att.ParentId);
         }
        system.debug('for loop completed');
    }
    oppoList = [select id from Opportunity where id in :oppIds];
    if(oppoList!=null && oppoList.size()>0){
        system.debug('in if condition');
        for(Opportunity op : oppoList){
            op.attach_upload__c = true;
        }
        system.debug('2nd for loop completed');
        
        update oppoList;
        system.debug('update completed');
    }
}
Hello All, I have a scenario where in I need to send a mail alert once an attachment of a specific name is uploaded, I am inclined to write a trigger for this but can I use workflow as well? can trigger compare the attachment name?
Hi All,

I have a scenario, wherein I have a custom field thats made of 8 characters- first four being letters and the next four digits. I need to increment the letters part every time a new record of this object is inserted and it has to be unique for every record.
I want to do this using apex triggers.
Any help appreciated !
Hi All,
I have a small query, if a profile has view all and modify all permission on a standard object, will that user be able to delete records of that object
owned by other users even if the owd is set as private?
Hi All,

I have a scenario, wherein I have a custom field thats made of 8 characters- first four being letters and the next four digits. I need to increment the letters part every time a new record of this object is inserted and it has to be unique for every record.
I want to do this using apex triggers.
Any help appreciated !
Below is the trigger :
trigger attach on Attachment (after insert) {
public List<opportunity> oppoList = new List<opportunity>();
   public Set<Id> oppIds = new Set<Id>();
    for(Attachment att : trigger.New){
         //Check if added attachment is related to Account or not
         if(att.ParentId.getSobjectType() == Opportunity.SobjectType && att.name ??? ){
              oppIds.add(att.ParentId);
         }
        system.debug('for loop completed');
    }
    oppoList = [select id from Opportunity where id in :oppIds];
    if(oppoList!=null && oppoList.size()>0){
        system.debug('in if condition');
        for(Opportunity op : oppoList){
            op.attach_upload__c = true;
        }
        system.debug('2nd for loop completed');
        
        update oppoList;
        system.debug('update completed');
    }
}