You need to sign in to do that
Don't have an account?

variable not exist
trigger calcyforsas on Location_Cal__c (after insert , after update ) { set<id> tst = new set <id>(); if(trigger.isinsert || trigger.isupdate){ for(Location_Cal__c ls : trigger.new ) { if(ls.testeTop_X_Designation__c != null){ tst.add(ls.testeTop_X_Designation__c); system.debug('-----55'+tst); } } for (testeTop_X_Designation__c ty :[select id ,Hello__c from testeTop_X_Designation__c where id in : tst ]){ system.debug('------88'+ty.Hello__c); string fx = ty.Hello__c; system.debug('-----55'+fx); Location_Cal__c cj = new Location_Cal__c(); cj.Id = ls.id; cj.sas__c = fx; update cj; } } }
If it solves the query then please mark it as best answer!
All Answers
This is what the picture sets in mind right now:
Parent obj : testeTop_X_Designation__c
Fields: Id, Hello__c
Child Obj: Location_Cal__c
Fields: testeTop_X_Designation__c, sas__c
Are you trying to update Hello__c as a sas__c? Means whenever there is child record with value in sas__c field then parent should be updated as the same value in Hello__c field. Let us know.
sas__c = testeTop_X_Designation__r.Hello__c
If it solves the query then please mark it as best answer!