You need to sign in to do that
Don't have an account?
RainerRichter
Need Support with an apex trigger
Hello all,
I'm trying to build a trigger which updates field in a ralted custom object.
The objects are:
- EDWPM__ITRQ_Positions__c
-field: EDWPM__EmpID__c
should be inserted in
- EDWPM__Hardware_CI__c
-field: EDWPM__ci_employee__c
after Update.
The trigger shows no syntax errors in developer console, but doesn't do anything. Maybe someone has an idea and can help?
Here is my code so far:
Thx! Rainer
I'm trying to build a trigger which updates field in a ralted custom object.
The objects are:
- EDWPM__ITRQ_Positions__c
-field: EDWPM__EmpID__c
should be inserted in
- EDWPM__Hardware_CI__c
-field: EDWPM__ci_employee__c
after Update.
The trigger shows no syntax errors in developer console, but doesn't do anything. Maybe someone has an idea and can help?
Here is my code so far:
Thx! Rainer
trigger HardwareassignProcess on EDWPM__ITRQ_Positions__c (after update) { List<EDWPM__ITRQ_Positions__c> posList = new List<EDWPM__ITRQ_Positions__c>(); for(EDWPM__ITRQ_Positions__c pos : posList){ if(trigger.newMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c != trigger.oldMap.get(pos.Id).EDWPM__Hardware_CI_dispatching__c){ EDWPM__Hardware_CI__c CI = [SELECT ID from EDWPM__Hardware_CI__c where ID=:pos.EDWPM__Hardware_CI_dispatching__c]; CI.EDWPM__ci_employee__c = pos.EDWPM__EmpID__c ; update CI; } } }
Let us know if this will help you
All Answers
Let us know if this will help you