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

Apex Trigger
Hi am creating a trigger on child object it will fire on account(parent) when am insert a record in child at
address__c field that text will update in this parent account in billing city.
is it correct this code please help me am getting an Error : Error: "Compile Error: Initial term of field expression must be
a concrete SObject: String at line 17 column 23"
trigger updatingaccount on Work_flow__c (after insert,after update)
{
set<id> xyzset=new set<id>();
for(work_flow__c c:trigger.new)
{
if(c.address__c == null || c.address__c != null)
{
xyzset.add(c.account__c);
}
}
map<id,string> app=new map<id,string>();
for(account a:[select id,Billingcity from account where id in:xyzset limit 50000])
app.put(a.id,a.Billingcity);
for(work_flow__c c:trigger.new)
{
if(c.address__c == null || c.address__c != null)
app.get(c.account__c).Billingcity = c.address__c;
}
}
You put String in map instead of Account. Modify your code:
All Answers
You put String in map instead of Account. Modify your code:
Thank you Mr. Euqune Pozniak