• DaNae Peterson
  • NEWBIE
  • 70 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 13
    Replies
Hi all, 

We have a 3rd party app that moves all opportunities on a child account to the parent account every hour.  We do not want this to happen so I am trying to write an after update trigger that will move the opportunity back to the previous/child account.  I am running into trouble though with my code.  I am getting the following error: "Incompatible key type Opportunity for Map<Id,Opportunity>".  I am also getting the error "Variable o does not exist" -- I think one of my }s is off (both of these errors are happening on line 13).  Below is my code.  Can someone please look at it and figure out where I went wrong and shed some light on how to fix it? 

Thanks!


trigger SwitchBackAccount on Opportunity (after update) {
    
map<id,Opportunity> changeAcctId = new map<id,Opportunity>();
List<Opportunity> SROpps = new List<Opportunity>();
for(Opportunity o : trigger.new){
if(trigger.oldmap.get(o.id).AccountId != o.AccountId){
changeAcctId.put(o.id,o);
}
}    
List<Opportunity> opps = [select Id, AccountId from Opportunity where Id in :changeAcctId.keyset()];
if(opps <> NULL && changeAcctId.size() > 0){
for(Opportunity op : opps){
op.AccountId = changeAcctId.get(o).AccountId;    
opps.add(op);
}       
update SROpps;
}

}
I have written a trigger that creates a contact when a quote has been accepted.  It is working in Sandbox.  Here is the code:

trigger CreateContract on Quote (before update) {
    
   for(Quote q : trigger.new){
        

        if(q.Status == 'Accepted'){
            
      Account acct = [SELECT Id, Name, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry FROM Account WHERE Id = :q.AccountId];
      Opportunity opp = [SELECT Id, Name, Total_MRC__c FROM Opportunity WHERE Id = :q.OpportunityId];
            
            List <Contract> co = [SELECT Id FROM Contract WHERE Opportunity__c = :opp.Id];
            List <Contract> cont = [SELECT Id FROM Contract WHERE Quote__c = :q.Id];
            if (cont.size() <= 0){

          Contract ct = new Contract();
            
            ct.AccountId = acct.Id;
            ct.Status = 'Draft';
            ct.Opportunity__c = opp.Id;
            ct.Quote__c = q.Id;
            ct.BillingStreet = acct.BillingStreet;
            ct.BillingCity = acct.BillingCity;
            ct.BillingState = acct.BillingState;
            ct.BillingPostalCode = acct.BillingPostalCode;
            ct.BillingCountry = acct.BillingCountry;
            ct.salesReach__Contract_Monthly_Billing__c = opp.Total_MRC__c;
                
            insert ct;
                
                opp.StageName = 'Contract Requested by Client';
                update opp;
            }
        }
                
    }
            
}

I am trying to write the associated test class so I can push to production.  However I keep getting failed statuses when I click "Run Test" such as:

System.DmlException: Update failed. First exception on row 0 with id 0Q01800000008xyCAA; first error:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CreateContract: execution of AfterUpdate
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.CreateContract: line 8, column 1: []

Here is what I have so far for the test class:

@isTest
public class TestCreateContract {
    public static testmethod void TestUpdateChildAccounts(){
        Account a = new Account();
        a.Name = 'Test Account';
        a.salesReach__Agent_Account_Company_Name__c = '001a000001DbY9F';
        a.salesReach__Agent_Contact_Name__c = '003a000001XKLvE';
        a.BillingStreet = '1340 S Market St.';
        a.BillingCity = 'T or C';
        a.BillingState = 'NM';
        a.BillingPostalCode = '87901';
        a.BillingCountry = 'USA';
        a.ShippingStreet = '1340 S Market St.';
        a.ShippingCity = 'T or C';
        a.ShippingState = 'NM';
        a.ShippingPostalCode = '87901';
        a.ShippingCountry = 'USA';
        insert a;  
        
        Opportunity o = new Opportunity();
        o.Name = 'Telecom Potential Sale';
        o.AccountId = a.Id;
        o.salesReach__Agent_Account_Company_Name__c = a.salesReach__Agent_Account_Company_Name__c;
        o.salesReach__Agent_Contact_Name__c = a.salesReach__Agent_Contact_Name__c;
        o.CloseDate = date.today();
        o.StageName = 'Quote Requested By Client';
        o.Opportunity_Type__c = 'Renew Existing Service';
        o.Opportunity_Contact__c = '003a0000028fI7L';
        insert o;
        
        Quote q = new Quote();
        q.Name = 'Telecom Potential Sale - Quote';
        q.ExpirationDate = o.Quote_Expiration_Date__c;
        q.ContactId = o.Opportunity_Contact__c;
        q.Status = 'Draft';
        q.OpportunityId = o.Id;
        insert q;
        
        q.Status = 'Accepted';
        update q;
        
    }

}


Can someone please help me fix this?  Thank you!
Hi all, 

I am trying to get my quotes to autosync to the opportunity upon creation.  I have the following controller, trigger, and test class:

controller:
public class QuoteAutoSyncUtil
    {
        @future
        public static void syncQuote(Map<Id, Id> quoteMap)
        {
            List<Opportunity> oppList = new List<Opportunity>();
           
            for(Id currentQuote : quoteMap.keyset())
            {
                Opportunity opp = new Opportunity();
                opp.Id = quoteMap.get(currentQuote);
                opp.SyncedQuoteId = currentQuote;
                oppList.add(opp);
            }

            update oppList;
     
        }
       
    }


Trigger:
trigger QuoteAutoSync on Quote (after insert)
    {
        Map<Id, Id> quoteMap = new Map<Id, Id>();
        for(Quote currentQuote : Trigger.New)
        {
              quoteMap.put(currentQuote.Id, currentQuote.OpportunityId);
        }
       
        QuoteAutoSyncUtil.syncQuote(quoteMap);
    }


Test Class:
@isTest
    private class TestQuoteAutoSync
    {
        static testMethod void insertQuote()
        {
            Opportunity opp = new Opportunity();
            opp.Name = 'Test Opportunity';
            opp.StageName = 'Prospecting';
            opp.CloseDate = system.today();
            insert opp;
           
            Quote quo = new Quote();
            quo.Name = 'Test Quote';
            quo.OpportunityId = opp.Id;        
           
            Test.startTest();
            insert quo;
            Test.stopTest();
           
            Opportunity o = [select SyncedQuoteId from opportunity where id=:opp.Id];
            system.assert(o.SyncedQuoteId != null);
                   
        }
    }

It is functioning properly in Sandbox and clears tests with 100% coverage but when I try to push to Production I get the following error with the test class:

System.AssertException: Assertion Failed
Stack Trace: Class.TestQuoteAutoSync.insertQuote: line 21, column 1

*Line 21 = system.assert(o.SyncedQuoteId != null);


Any ideas what I am missing? 

Thanks!
 
I am trying to create a button to do some url hacking on the quote object (I want to set some default values when you click the standard "Email Quote" button but I am having trouble finding the API names for the fields on the following page, particularly the "To:" and "BCC:" fields.  Does anyone know what these are or where to find them?

Thanks!
Hi all!  I am still fairly new to development and need help writing a test class for a class I have developed (my experience is with triggers).  I am trying to autosync a quote to an opportunity upon creation and after studying some blog posts I came up with the following class:

public class QuoteAutoSyncUtil
    {
        @future
        public static void syncQuote(Map<Id, Id> quoteMap)
        {
            List<Opportunity> oppList = new List<Opportunity>();
           
            for(Id currentQuote : quoteMap.keyset())
            {
                Opportunity opp = new Opportunity();
                opp.Id = quoteMap.get(currentQuote);
                opp.SyncedQuoteId = currentQuote;
                oppList.add(opp);
            }
           
            Integer oppSize = oppList.size();
            update oppList[oppSize -1 ];
     
        }
       
    }

And the following trigger:

trigger QuoteAutoSync on Quote (after insert)
    {
        Map<Id, Id> quoteMap = new Map<Id, Id>();
        for(Quote currentQuote : Trigger.New)
        {
          if(currentQuote.ExpirationDate != NULL)
          {
              quoteMap.put(currentQuote.Id, currentQuote.OpportunityId);
          }
        }
       
        QuoteAutoSyncUtil.syncQuote(quoteMap);
    }

It is working perfectly in Sandbox but I am getting stuck on the test class.  This is what I have so far:

@isTest
public class AutoSyncQuote {

    public static testmethod void TestAutoSyncQuote(){
       Account a = new Account();
        a.Name = 'Test Account';
        a.salesReach__Agent_Account_Company_Name__c = '001a000001DbY9F';
        a.salesReach__Agent_Contact_Name__c = '003a000001iM38p';
        a.Account_Status__c = 'Active';
        a.Diamond_Account__c = True;
        a.Net_One__c = False;
        
        Insert a;
        
       Opportunity opp = new Opportunity();
        opp.Name = 'Telecom Product or Service';
        opp.CloseDate = Date.today();
        opp.StageName = 'Quote Requested By Client';
        opp.Opportunity_Type__c = 'Install New Service';
        opp.AccountId = a.Id;
        
        Insert opp;
        
       Quote q = new Quote();
        q.Name = 'Telecom Product or Service - Quote';
        q.ExpirationDate = opp.Quote_Expiration_Date__c;
        q.OpportunityId = opp.Id;
        
        Map<Id, Id> quoteMap = new Map<Id, Id>();

        QuoteAutoSyncUtil.syncQuote(quoteMap);
        
              
    }
    
}

but so far it is saying none of my lines are covered.  PLEASE HELP!!!  Thank you very much!
I am trying to boost my code coverage so I can delete some classes from a former app I am trying to delete.  I am getting the following error: force.com ide Syntax(error = UnexpectedSyntaxError(loc = RealLoc(StartIndex=9, endIndex = 10, line = 1, column =51), message = missing LCURLY at '('))

Anyone know what that means?

Here is my actual code:

public with sharing class JunkClassForTestCoverage(){
    public class testCoverage(){
        string i1;
        string i2;
        string i3;
        string i4;
        string i5;
        string i6;
        string i7;
        string i8;
        string i9;
        string i10;
        string i11;
        string i12;
        string i13;
        string i14;
        string i15;
        string i16;
        string i17;
        string i18;
        string i19;
        string i20;
        string i21;
        string i22;
        string i23;
        string i24;
        string i25;
}
}

Instead of posting the whole thing this is a sample.  It follows this same patter up until string i822

 
I installed Java, Eclipse, and Force.com IDE on my Windows 7 (32-bit) yesterday and when I tried to pull it up again today, I receive the following error: The Eclipse executable launcher was unable to locate its companion shared library.

I uninstalled Java and Eclipse and re-installed them and am still getting the same error. 

Is there something else I can try?
I need to be able to track the account history as an asset is moved from one account to another.  Since the asset object does not have field-level history, I have created a large text field, Account_History__c, where the information will be stored. 

Once the account changes, i.e. ISCHANGED(AccountId), I want the Account History field to populate with the new account name AND today's date.  This is what I have set up currently:
TODAY() + Account.Name but the "+" is incorrect.  The same goes for when I try TODAY() & Account.Name. 
What else can I try??

ADDITIONALLY, I would like to not overwrite what is in the field already (else the history will be erased).  How can I make the entry go to a new line?

For example:
Account History = 9/13/12 Company A
Account changes to Company X
Account History = 9/13/12 Company A
                           12/3/14 Company X

I would love some feedback.  Or if you have a whole other approach, I am open to suggestions!  Thank you!!!
Hello all, 

In my org, we utilize account hierarchy and I am currently writing a trigger that changes made on the parent account (7 specific fields) should be reflected on all the child accounts (there can be many child accounts to one parent).  Where I am getting stuck is on the account team.  If I change the owner (one of the 7 fields) on the PARENT account the account team changes to the default of the new owner.  However, when the trigger fires all of the CHILD accounts list the new account team (from default) BUT also keeps old account team members.  I am trying to delete old account team members first (one specific role) but every time I test, it does not work. 

Perhaps someone else knows or notices something that I am missing?  Thank you!



trigger UpdateChildAccount on Account (after update){


map<id,Account> owner_change = new map<id,Account>();

List<Account> changeowneraccts = new List<Account>();
for(Account c : trigger.new){
if(trigger.oldmap.get(c.id).OwnerId != c.OwnerId){
owner_change.put(c.id,c);
}
}
List<AccountTeamMember> removeTeam = new List <AccountTeamMember>();
for(AccountTeamMember Ratm : [SELECT Id, UserId, AccountId FROM AccountTeamMember WHERE TeamMemberRole = 'Sales Support' AND AccountId IN :changeowneraccts]){
    if(removeTeam <> NULL && owner_change.size() > 0){
    removeTeam.add(Ratm);
}
}
delete removeTeam;


map<id,Account> acctId_to_acct = new map<id,Account>();
List<Account> updatedchildaccounts = new List<Account>();
for(Account a : trigger.new){
if(trigger.oldmap.get(a.id).OwnerId != a.OwnerId || trigger.oldmap.get(a.id).salesReach__Agent_Account_Company_Name__c != a.salesReach__Agent_Account_Company_Name__c || trigger.oldmap.get(a.id).salesReach__Agent_Contact_Name__c != a.salesReach__Agent_Contact_Name__c || trigger.oldmap.get(a.id).Diamond_Account__c != a.Diamond_Account__c || trigger.oldmap.get(a.id).Net_One__c != a.Net_One__c || trigger.oldmap.get(a.id).Account_Status__c != a.Account_Status__c || trigger.oldmap.get(a.id).Affinity__c != a.Affinity__c){
acctId_to_acct.put(a.id,a);
}
}
List<Account> childAccounts = [select ParentId, OwnerId, salesReach__Agent_Account_Company_Name__c, salesReach__Agent_Contact_Name__c, Diamond_Account__c, Net_One__c, Account_Status__c, Affinity__c from Account where ParentId in :acctId_to_acct.keyset()];
if(childAccounts <> NULL && acctId_to_acct.size() > 0){
for(Account c : childAccounts){
c.Ownerid = acctId_to_acct.get(c.parentid).Ownerid;
c.salesReach__Agent_Account_Company_Name__c = acctId_to_acct.get(c.parentid).salesReach__Agent_Account_Company_Name__c;
c.salesReach__Agent_Contact_Name__c = acctId_to_acct.get(c.parentid).salesReach__Agent_Contact_Name__c;
c.Diamond_Account__c = acctId_to_acct.get(c.parentid).Diamond_Account__c;
c.Net_One__c = acctId_to_acct.get(c.parentid).Net_One__c;
c.Account_Status__c = acctId_to_acct.get(c.parentid).Account_Status__c;
c.Affinity__c = acctId_to_acct.get(c.parentid).Affinity__c;    
updatedchildaccounts.add(c);
}       
update updatedchildaccounts;
}
}
In my org we utilitze account hierarchy with multiple child accounts to one parent account.  I need a way to update all the child accounts when any one of 6 certian fields is changed on the parent (owner, status, and 4 custom fields (2 checkboxes, 2 look up fields)).  I know the best way to approach this is through a trigger but my experience with this is extremely limited... 

Can someone lend a guiding hand?  It sounds like I need to use trigger.oldMap but not sure how to start.  Even just helping me to set it up would be most helpful...  Thank you!
Hi all, 

We have a 3rd party app that moves all opportunities on a child account to the parent account every hour.  We do not want this to happen so I am trying to write an after update trigger that will move the opportunity back to the previous/child account.  I am running into trouble though with my code.  I am getting the following error: "Incompatible key type Opportunity for Map<Id,Opportunity>".  I am also getting the error "Variable o does not exist" -- I think one of my }s is off (both of these errors are happening on line 13).  Below is my code.  Can someone please look at it and figure out where I went wrong and shed some light on how to fix it? 

Thanks!


trigger SwitchBackAccount on Opportunity (after update) {
    
map<id,Opportunity> changeAcctId = new map<id,Opportunity>();
List<Opportunity> SROpps = new List<Opportunity>();
for(Opportunity o : trigger.new){
if(trigger.oldmap.get(o.id).AccountId != o.AccountId){
changeAcctId.put(o.id,o);
}
}    
List<Opportunity> opps = [select Id, AccountId from Opportunity where Id in :changeAcctId.keyset()];
if(opps <> NULL && changeAcctId.size() > 0){
for(Opportunity op : opps){
op.AccountId = changeAcctId.get(o).AccountId;    
opps.add(op);
}       
update SROpps;
}

}
I have written a trigger that creates a contact when a quote has been accepted.  It is working in Sandbox.  Here is the code:

trigger CreateContract on Quote (before update) {
    
   for(Quote q : trigger.new){
        

        if(q.Status == 'Accepted'){
            
      Account acct = [SELECT Id, Name, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry FROM Account WHERE Id = :q.AccountId];
      Opportunity opp = [SELECT Id, Name, Total_MRC__c FROM Opportunity WHERE Id = :q.OpportunityId];
            
            List <Contract> co = [SELECT Id FROM Contract WHERE Opportunity__c = :opp.Id];
            List <Contract> cont = [SELECT Id FROM Contract WHERE Quote__c = :q.Id];
            if (cont.size() <= 0){

          Contract ct = new Contract();
            
            ct.AccountId = acct.Id;
            ct.Status = 'Draft';
            ct.Opportunity__c = opp.Id;
            ct.Quote__c = q.Id;
            ct.BillingStreet = acct.BillingStreet;
            ct.BillingCity = acct.BillingCity;
            ct.BillingState = acct.BillingState;
            ct.BillingPostalCode = acct.BillingPostalCode;
            ct.BillingCountry = acct.BillingCountry;
            ct.salesReach__Contract_Monthly_Billing__c = opp.Total_MRC__c;
                
            insert ct;
                
                opp.StageName = 'Contract Requested by Client';
                update opp;
            }
        }
                
    }
            
}

I am trying to write the associated test class so I can push to production.  However I keep getting failed statuses when I click "Run Test" such as:

System.DmlException: Update failed. First exception on row 0 with id 0Q01800000008xyCAA; first error:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CreateContract: execution of AfterUpdate
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.CreateContract: line 8, column 1: []

Here is what I have so far for the test class:

@isTest
public class TestCreateContract {
    public static testmethod void TestUpdateChildAccounts(){
        Account a = new Account();
        a.Name = 'Test Account';
        a.salesReach__Agent_Account_Company_Name__c = '001a000001DbY9F';
        a.salesReach__Agent_Contact_Name__c = '003a000001XKLvE';
        a.BillingStreet = '1340 S Market St.';
        a.BillingCity = 'T or C';
        a.BillingState = 'NM';
        a.BillingPostalCode = '87901';
        a.BillingCountry = 'USA';
        a.ShippingStreet = '1340 S Market St.';
        a.ShippingCity = 'T or C';
        a.ShippingState = 'NM';
        a.ShippingPostalCode = '87901';
        a.ShippingCountry = 'USA';
        insert a;  
        
        Opportunity o = new Opportunity();
        o.Name = 'Telecom Potential Sale';
        o.AccountId = a.Id;
        o.salesReach__Agent_Account_Company_Name__c = a.salesReach__Agent_Account_Company_Name__c;
        o.salesReach__Agent_Contact_Name__c = a.salesReach__Agent_Contact_Name__c;
        o.CloseDate = date.today();
        o.StageName = 'Quote Requested By Client';
        o.Opportunity_Type__c = 'Renew Existing Service';
        o.Opportunity_Contact__c = '003a0000028fI7L';
        insert o;
        
        Quote q = new Quote();
        q.Name = 'Telecom Potential Sale - Quote';
        q.ExpirationDate = o.Quote_Expiration_Date__c;
        q.ContactId = o.Opportunity_Contact__c;
        q.Status = 'Draft';
        q.OpportunityId = o.Id;
        insert q;
        
        q.Status = 'Accepted';
        update q;
        
    }

}


Can someone please help me fix this?  Thank you!
Hi all, 

I am trying to get my quotes to autosync to the opportunity upon creation.  I have the following controller, trigger, and test class:

controller:
public class QuoteAutoSyncUtil
    {
        @future
        public static void syncQuote(Map<Id, Id> quoteMap)
        {
            List<Opportunity> oppList = new List<Opportunity>();
           
            for(Id currentQuote : quoteMap.keyset())
            {
                Opportunity opp = new Opportunity();
                opp.Id = quoteMap.get(currentQuote);
                opp.SyncedQuoteId = currentQuote;
                oppList.add(opp);
            }

            update oppList;
     
        }
       
    }


Trigger:
trigger QuoteAutoSync on Quote (after insert)
    {
        Map<Id, Id> quoteMap = new Map<Id, Id>();
        for(Quote currentQuote : Trigger.New)
        {
              quoteMap.put(currentQuote.Id, currentQuote.OpportunityId);
        }
       
        QuoteAutoSyncUtil.syncQuote(quoteMap);
    }


Test Class:
@isTest
    private class TestQuoteAutoSync
    {
        static testMethod void insertQuote()
        {
            Opportunity opp = new Opportunity();
            opp.Name = 'Test Opportunity';
            opp.StageName = 'Prospecting';
            opp.CloseDate = system.today();
            insert opp;
           
            Quote quo = new Quote();
            quo.Name = 'Test Quote';
            quo.OpportunityId = opp.Id;        
           
            Test.startTest();
            insert quo;
            Test.stopTest();
           
            Opportunity o = [select SyncedQuoteId from opportunity where id=:opp.Id];
            system.assert(o.SyncedQuoteId != null);
                   
        }
    }

It is functioning properly in Sandbox and clears tests with 100% coverage but when I try to push to Production I get the following error with the test class:

System.AssertException: Assertion Failed
Stack Trace: Class.TestQuoteAutoSync.insertQuote: line 21, column 1

*Line 21 = system.assert(o.SyncedQuoteId != null);


Any ideas what I am missing? 

Thanks!
 
I am trying to create a button to do some url hacking on the quote object (I want to set some default values when you click the standard "Email Quote" button but I am having trouble finding the API names for the fields on the following page, particularly the "To:" and "BCC:" fields.  Does anyone know what these are or where to find them?

Thanks!
Hi all!  I am still fairly new to development and need help writing a test class for a class I have developed (my experience is with triggers).  I am trying to autosync a quote to an opportunity upon creation and after studying some blog posts I came up with the following class:

public class QuoteAutoSyncUtil
    {
        @future
        public static void syncQuote(Map<Id, Id> quoteMap)
        {
            List<Opportunity> oppList = new List<Opportunity>();
           
            for(Id currentQuote : quoteMap.keyset())
            {
                Opportunity opp = new Opportunity();
                opp.Id = quoteMap.get(currentQuote);
                opp.SyncedQuoteId = currentQuote;
                oppList.add(opp);
            }
           
            Integer oppSize = oppList.size();
            update oppList[oppSize -1 ];
     
        }
       
    }

And the following trigger:

trigger QuoteAutoSync on Quote (after insert)
    {
        Map<Id, Id> quoteMap = new Map<Id, Id>();
        for(Quote currentQuote : Trigger.New)
        {
          if(currentQuote.ExpirationDate != NULL)
          {
              quoteMap.put(currentQuote.Id, currentQuote.OpportunityId);
          }
        }
       
        QuoteAutoSyncUtil.syncQuote(quoteMap);
    }

It is working perfectly in Sandbox but I am getting stuck on the test class.  This is what I have so far:

@isTest
public class AutoSyncQuote {

    public static testmethod void TestAutoSyncQuote(){
       Account a = new Account();
        a.Name = 'Test Account';
        a.salesReach__Agent_Account_Company_Name__c = '001a000001DbY9F';
        a.salesReach__Agent_Contact_Name__c = '003a000001iM38p';
        a.Account_Status__c = 'Active';
        a.Diamond_Account__c = True;
        a.Net_One__c = False;
        
        Insert a;
        
       Opportunity opp = new Opportunity();
        opp.Name = 'Telecom Product or Service';
        opp.CloseDate = Date.today();
        opp.StageName = 'Quote Requested By Client';
        opp.Opportunity_Type__c = 'Install New Service';
        opp.AccountId = a.Id;
        
        Insert opp;
        
       Quote q = new Quote();
        q.Name = 'Telecom Product or Service - Quote';
        q.ExpirationDate = opp.Quote_Expiration_Date__c;
        q.OpportunityId = opp.Id;
        
        Map<Id, Id> quoteMap = new Map<Id, Id>();

        QuoteAutoSyncUtil.syncQuote(quoteMap);
        
              
    }
    
}

but so far it is saying none of my lines are covered.  PLEASE HELP!!!  Thank you very much!
In my org we utilitze account hierarchy with multiple child accounts to one parent account.  I need a way to update all the child accounts when any one of 6 certian fields is changed on the parent (owner, status, and 4 custom fields (2 checkboxes, 2 look up fields)).  I know the best way to approach this is through a trigger but my experience with this is extremely limited... 

Can someone lend a guiding hand?  It sounds like I need to use trigger.oldMap but not sure how to start.  Even just helping me to set it up would be most helpful...  Thank you!