External links
Category:2007 video games
Category:Eidos Interactive games
Category:Video games developed in Canada
Category:Post-apocalyptic video games
Category:Role-playing video games
Category:Video games with alternate endings
Category:Windows games
Category:Windows-only games
Category:Xbox gamesQ:
How to use TransientField inside a simple apex trigger
I'm trying to execute an apex trigger that will add a new Sobject which has a few lookup fields from the parent SObject that I'm updating. This is the trigger code:
trigger UpdateFields on Web__c (before update) {
if(Trigger.isUpdate){
Web__c[] records = Trigger.new;
for(Web__c a : records) {
//a.Balance_Amt__c = a.TransactionalAmount__c + a.TransactionalAmount__c;
}
}
}
I get the error:
Error: Compile Error: A field of type Payroll__c is expected but
Payroll__c was found
If I change the code to:
Web__c a = new Web__c();
a.Balance_Amt__c = a.TransactionalAmount__c + a.TransactionalAmount__c;
insert a;
I get the error:
Error: Compile Error: Attribute not found. The attribute name you
provided: "Gardner_Education_Technology_Training__r.Gardner_Technology_Area__r.Gardner_Career_Focused_Technical_Education__c" is
not valid. Valid attribute names must begin with a letter and only
contain letters, numbers, dollar signs, underscores, periods, and
hyphens.
I don't understand why I'm getting an error with a TransientField. Is there a solution to this?
A:
You'll need to change the code in the trigger to not use a variable reference, but a literal. The reason you're getting the error is that in order for you to use a.TransactionalAmount__c, the class be359ba680
Related links:
Comments