• Marcelo Tudisco
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hi, i have just created a new developer sandbox, on that sandbox I create a before delete trigger on CampaignMember, i create a test class and do the tests to get code coverage. After that i create a new outbound change set with the trigger to upload it to production. If i just add the trigger to the change set (no dependencies), when i go to production and in the inboud change set try to validate it, it fails because i do not satisfy code coverage. If on the sandbox i add the trigger and add all dependencies then i can deploy it on production. In those dependencies it adds a custom field and a global value set.

Can anyone explain me why it adds that custom field and that global value set as dependant when they are already on production? Why does the validate on production fails if i dont add the dependencies to the change set, even though those depencies already exists on production?

thanks
 
Hi, I have in Contacts a custom field "Almanaques__c" that is a picklist with "SI", "NO", "N/C"
we want that every time we add members to a campaing of type "Calendar" we mark that field in "SI", we made it with process builder.

The problem is on delete, we want that when we remove a contact from a campaign of type "Calendar" we want to set that field in "NO". For that i created an apex trigger, but when i remove the campaign member i get the following error:
"There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help."

I'm doing the test with user in profile system administrator.
Heres is my trigger:
trigger CM_delete on CampaignMember (before delete) {
   List<Contact> ConList = new LIst<Contact>();

    for(CampaignMember cm : Trigger.Old) {
       Contact c = cm.Contact;
       c.Almanaques__c='NO';
       ConList.add(c);
    }   
 
    if (ConList.size() > 0) {
        update (ConLIst);
    }
}

Any Idea?
thanks
Hi, i have a custom object Propuesta__c that has 2 custom fields: 
Account__c           Lookup(Account)
Opportunity__c     Master-Detail(Opportunity)

When we are working in an opportunitry and in related records we create the Propuesta__c the popup window already has the Opportunity filled, however the account is not and we have to fill it up, we could even select a different account than the one in the Opportunity. We want the Account__c to be read only and only show the same account that the opportunity, and we still need the account__c to be a lookup because we want from the account page to have the Propuesta__c in the related lists.

Is there any way to implement this? Dont know if an appex trigger would help? I'm not into appex so apreciate if anyone can give an example or suggest something else.

regards
Hi, i have just created a new developer sandbox, on that sandbox I create a before delete trigger on CampaignMember, i create a test class and do the tests to get code coverage. After that i create a new outbound change set with the trigger to upload it to production. If i just add the trigger to the change set (no dependencies), when i go to production and in the inboud change set try to validate it, it fails because i do not satisfy code coverage. If on the sandbox i add the trigger and add all dependencies then i can deploy it on production. In those dependencies it adds a custom field and a global value set.

Can anyone explain me why it adds that custom field and that global value set as dependant when they are already on production? Why does the validate on production fails if i dont add the dependencies to the change set, even though those depencies already exists on production?

thanks
 
Hi, I have in Contacts a custom field "Almanaques__c" that is a picklist with "SI", "NO", "N/C"
we want that every time we add members to a campaing of type "Calendar" we mark that field in "SI", we made it with process builder.

The problem is on delete, we want that when we remove a contact from a campaign of type "Calendar" we want to set that field in "NO". For that i created an apex trigger, but when i remove the campaign member i get the following error:
"There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help."

I'm doing the test with user in profile system administrator.
Heres is my trigger:
trigger CM_delete on CampaignMember (before delete) {
   List<Contact> ConList = new LIst<Contact>();

    for(CampaignMember cm : Trigger.Old) {
       Contact c = cm.Contact;
       c.Almanaques__c='NO';
       ConList.add(c);
    }   
 
    if (ConList.size() > 0) {
        update (ConLIst);
    }
}

Any Idea?
thanks
I have a custom object Called TL which has a lookup field to Opportunity and to Account. If I create a TL record from within an Opportunity record I would like to auto populated the Account Lookup field with the same details that are on the Opportunity Account Field.

The Salesforce Edition that I am working on is a Professional Edition. 

Can this be achieved on Professional?