Horje
Trigger Code Example
Trigger
mysql> SET @sum = 0;
mysql> INSERT INTO account VALUES(137,14.98),(141,1937.50),(97,-100.00);
mysql> SELECT @sum AS 'Total amount inserted';
+-----------------------+
| Total amount inserted |
+-----------------------+
|               1852.48 |
+-----------------------+
Trigger
trigger OppoRecordUpdate on Account (After insert, After update) {
    List<Opportunity> newlist = new List<Opportunity>();
    Set<Id> newset = new Set<Id>();
    for(Account acc : Trigger.new){
         newset.add(acc.Id);
    }
    List<Account> Acclist = [Select Id,Name,(Select Id,Name From Contacts) From Account Where Id =: newset];
    for(Account ac : Acclist){
        for(Opportunity opp : ac.Opportunities){
        opp.Description = ac.Description;
        newlist.add(opp);
        }
    }
    update newlist;
}




Sql

Related
create table in dbms cmds Code Example create table in dbms cmds Code Example
get employees if not contains in sql Code Example get employees if not contains in sql Code Example
sqlite löschen einer tabelle Code Example sqlite löschen einer tabelle Code Example
round border button tkinter Code Example round border button tkinter Code Example
Postgresql connect Code Example Postgresql connect Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7