function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sammichelsonsammichelson 

Contact trigger when account is left blank

Hi,

 

I'm trying to make a trigger that updates the contact when created if the account is left blank. I want contact to be assigned a default account is left blank. However right now an account is already automatically created of the contact's last name and assigned to that contact. 

 

Is there a way to get rid of this trigger so I can assign my default account to the contact if blank?

 

Thanks,

Sam

gmb_power_devgmb_power_dev

Yes, you can deactivate or delete the trigger which causes the current behavior and replace it with your own trigger.

GardenwayGardenway

Hi Sam,

 

Let me see if I understand your question:

 

You already have a trigger (Call it "currentTrigger") which will create an account whenever account is left blank.  The currentTrigger  will create an account whose name will be the last name of the contact.  Is that correct?

 

Rather than having a new account created, you always want the contact with a blank account to point to a standard account reserved contacts that originally had a blank account?  Is that correct?

 

So, you want to be able to delete that currentTrigger, is that your question?

 

John

GardenwayGardenway

If I have correctly understood your question and you simply wish to delete the currentTrigger, in your production environment, go to

 

setup->deploy->inbound change sets

 

Then select "Delete" next to the trigger which you wish to PERMANENTLY remove..

 

Hope this helps.

 

John

sammichelsonsammichelson

Hi Gardenway,

 

Yeah that's correct. The thing is I never created the trigger that creates the new account eachtime. It seems to be a preinstalled trigger for contacts. When I tried to look for a delete option or even edit option for the the preinstalled triggers in Contacts there weren't links for those options. There was only links for edit and delete for the trigger I created. 

GardenwayGardenway

Please advise whether the prior post inviting you to look at

 

setup->deploy->inbound change sets

 

will show the trigger which you wish to delete.

 

john

sammichelsonsammichelson

Gardenway wrote:

Please advise whether the prior post inviting you to look at

 

setup->deploy->inbound change sets

 

will show the trigger which you wish to delete.

 

john


 

Hi John,

 

I don't see any triggers in Inbound Change Sets.

 

 

GardenwayGardenway

Did you see gmb_power_dev' s comment?  Can you locate the listing for the trigger?

 

If it is a custom object

 

    create->objects->[select object, not edit]->

 

scroll down to the trigger name.  If it is  part of a "installed package" created by someone else, you may not be able to deactivate it.  Not sure.

sammichelsonsammichelson

Gardenway wrote:

Did you see gmb_power_dev' s comment?  Can you locate the listing for the trigger?

 

If it is a custom object

 

    create->objects->[select object, not edit]->

 

scroll down to the trigger name.  If it is  part of a "installed package" created by someone else, you may not be able to deactivate it.  Not sure.


When I go to create > objects I see there's row with Relationship under Label and Contact under Master Object. When I click on it there's a Trigger called Relationships. When I click on that I see "This Apex Trigger is managed, meaning that you may only edit certain attributes" 

 

Then when I click "Display More Information" it shows 

"Who can delete which Apex Triggers? The developer can delete all triggers."

 

I thought my account was a developer account? 

GardenwayGardenway

There are two ways to develop code:

1. In a sandbox
2. In a developer edition

Which method are you using?


sammichelsonsammichelson

Gardenway wrote:

There are two ways to develop code:

1. In a sandbox
2. In a developer edition

Which method are you using?



I created a test org with the setting Nonprofit CRM.

GardenwayGardenway
I have only worked with sandbox environments. I am surprised there
would be a customer trigger in a developer edition that you could not
deactivate.

I hope someone else has an answer.


John