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
jagjitsingh@indivar.comjagjitsingh@indivar.com 

Trigger

Hi

 

  I have created a custom object and i want trigger for this . Where i should write this trigger

 

trigger MileageTrigger on Mileage__c (before insert, before update) {
MileageUtil.areMilesAllowed(Trigger.new);
}

 

There is no option of New in Apex Triggers . Custom object does not appear in Setup->Customise.

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
srikeerthisrikeerthi

Go to Custom object,click on the Custom object

 

In that you will find Triggers then Click on new then you

will be able to create new Trigger.

 

 

Thanks 

All Answers

srikeerthisrikeerthi

Go to Custom object,click on the Custom object

 

In that you will find Triggers then Click on new then you

will be able to create new Trigger.

 

 

Thanks 

This was selected as the best answer
AnjaneyaAnjaneya

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger Returnedtrigger caused an unexpected exception, contact your administrator: Returnedtrigger: execution of BeforeDelete caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.Returnedtrigger: line 11, column 1".

srikeerthisrikeerthi

Hi

 

On the object there are validation rules.Go and check the validation rules.

You are refering the object after you are deleting.

mmednickmmednick

Hi, 

 

I'm trying to create a trigger so that all leads that come in from a company I've already downgraded are automatically downgraded.....anybody able to help?