Skip to main content
edited tags
Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
added 83 characters in body; edited tags
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

Can you please help meWhy Do I get this error in solving "the below code?

expecting right square bracket, found 'in'Error "

expecting right square bracket, found 'in'

Code

trigger ProposalTriggerTest on Proposal__Proposal__c (after update) {
    try{
        list < Proposal__Proposal__c > updateList  =  new list < Proposal__Proposal__c > (); 
        list < Proposal__Proposal__c > currentProposalList  =   [ Select id , (Select LineType__c, NetPrice__c From ProposalSummaryGroups__r where LineType__c = 'Grand Total' ), Quoting_Country__r.Rounding_Method__c  From Proposal__Proposal__c in :trigger.new ];
        system.debug('####Check currentSummaryGroups : '+currentProposalList);
        for (Proposal__Proposal__c proposal : currentProposalList) {
            system.debug('####Check  -  Before Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

            proposal.ProposalSummaryGroups__r[0].NetPrice__c   =  proposal.ProposalSummaryGroups__r[0].NetPrice__c +100; 

            system.debug('####Check  -  After Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

            updateList.add(current);
        }
        if(updateList.size()>0) update updateList;


         }catch(Exception e){} 
 }    }

Thanks

Can you please help me in solving "expecting right square bracket, found 'in' "

trigger ProposalTriggerTest on Proposal__Proposal__c (after update) {
try{
    list < Proposal__Proposal__c > updateList  =  new list < Proposal__Proposal__c > (); 
    list < Proposal__Proposal__c > currentProposalList  =   [ Select id , (Select LineType__c, NetPrice__c From ProposalSummaryGroups__r where LineType__c = 'Grand Total' ), Quoting_Country__r.Rounding_Method__c  From Proposal__Proposal__c in :trigger.new ];
    system.debug('####Check currentSummaryGroups : '+currentProposalList);
    for (Proposal__Proposal__c proposal : currentProposalList) {
        system.debug('####Check  -  Before Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

        proposal.ProposalSummaryGroups__r[0].NetPrice__c   =  proposal.ProposalSummaryGroups__r[0].NetPrice__c +100; 

        system.debug('####Check  -  After Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

        updateList.add(current);
    }
    if(updateList.size()>0) update updateList;


     }catch(Exception e){} 
 } 

Thanks

Why Do I get this error in the below code?

Error

expecting right square bracket, found 'in'

Code

trigger ProposalTriggerTest on Proposal__Proposal__c (after update) {
    try{
        list < Proposal__Proposal__c > updateList  =  new list < Proposal__Proposal__c > (); 
        list < Proposal__Proposal__c > currentProposalList  =   [ Select id , (Select LineType__c, NetPrice__c From ProposalSummaryGroups__r where LineType__c = 'Grand Total' ), Quoting_Country__r.Rounding_Method__c  From Proposal__Proposal__c in :trigger.new ];
        system.debug('####Check currentSummaryGroups : '+currentProposalList);
        for (Proposal__Proposal__c proposal : currentProposalList) {
            system.debug('####Check  -  Before Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

            proposal.ProposalSummaryGroups__r[0].NetPrice__c   =  proposal.ProposalSummaryGroups__r[0].NetPrice__c +100; 

            system.debug('####Check  -  After Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

            updateList.add(current);
        }
        if(updateList.size()>0) update updateList;


         }catch(Exception e){} 
     }
Source Link
Sandeep
  • 103
  • 1

Trigger - Error "expecting right square bracket, found 'in' "

Can you please help me in solving "expecting right square bracket, found 'in' "

trigger ProposalTriggerTest on Proposal__Proposal__c (after update) {
try{
    list < Proposal__Proposal__c > updateList  =  new list < Proposal__Proposal__c > (); 
    list < Proposal__Proposal__c > currentProposalList  =   [ Select id , (Select LineType__c, NetPrice__c From ProposalSummaryGroups__r where LineType__c = 'Grand Total' ), Quoting_Country__r.Rounding_Method__c  From Proposal__Proposal__c in :trigger.new ];
    system.debug('####Check currentSummaryGroups : '+currentProposalList);
    for (Proposal__Proposal__c proposal : currentProposalList) {
        system.debug('####Check  -  Before Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

        proposal.ProposalSummaryGroups__r[0].NetPrice__c   =  proposal.ProposalSummaryGroups__r[0].NetPrice__c +100; 

        system.debug('####Check  -  After Net : '+proposal.ProposalSummaryGroups__r[0].NetPrice__c);           

        updateList.add(current);
    }
    if(updateList.size()>0) update updateList;


     }catch(Exception e){} 
 } 

Thanks