You need to sign in to do that
Don't have an account?
The Admiral
Before update trigger, updating a field with formula value.
Hi there,
I have on the object factuur__c a field named FS_Dagen_Open__c it is a formula counting day that the invoice is open.
The trigger should update Aantal_Dagen_Openstaan on each record on the object.
It also should fire if field Betaald__c is False.
I am quite new to triggers and it seems that i have some issues here, any suggestions for improvements?
I have on the object factuur__c a field named FS_Dagen_Open__c it is a formula counting day that the invoice is open.
The trigger should update Aantal_Dagen_Openstaan on each record on the object.
It also should fire if field Betaald__c is False.
I am quite new to triggers and it seems that i have some issues here, any suggestions for improvements?
trigger nota Trigger on Factuur__c (before update) { //Create a list to hold the records that we are going to update List<Factuur__c> notaList = new List<Factuur__c>(); Betaald = False //Go through the updated records in the database and update their custom fields //according to the updated Aantal_dagen_openstaand__c in value of FS_Dagen_Open for(Factuur__c nota : Trigger.new) { if(nota. FS_Dagen_open__c = !=null) { nota.FS_Dagen_open__c = Aantal_dagen_openstaand__c; //Put each updated record in the list we created notaList.add(nota); } } //Update the list in the database update notaList; }
I am getting the following error:
Error: Compile Error: Expecting 'ON' but was: 'Trigger' at line 1 column 14