• Gadilkar Vikas
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hii All
I have 2 objects..1---Account--standard and 2---Transaction---custom object. In the transaction one field is there i.e., Transaction type. So my question is i want to update a field on account object record based on Transaction Type. How can i achieve this using Triggers(Like Roll up  summary fields).

I have many to many relationship  between 3 objects:

User-added image

I want to insert list of sumarry(child) to parent object(accuunt)
Account acc = [Select ID, name,(SELECT id, Name FROM sumarry__r) from Account where name = 'apple'];

sumarry__c one = new sumarry__c();
sumarry__c two = new sumarry__c();
one.name = 'one';
two.name = 'two';
lists.add(one);
lists.add(two);
how to make it properly.
this operation acc.sumarry__r=lists cause 
"Field is not writeable: sumarry__r" 
or acc.sumarry__r.add(one) cause 
'System.QueryException: List has no rows for assignment to SObject'