• SFDC _ Corner
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

 

Hi I am finding the same 101 error with the follwoing code. I tried chainging the code by taking the query with in the for loop but still finding the same issue . Please help me in this

 

trigger QuoteRequest_AfterInsertUpdate on GFQuote__c (after insert, after update)
{
List <GFQuote__c> qrList = new List <GFQuote__c>();
List <GFQuote__c> qrList1 = new List <GFQuote__c>();
List <GFQuote__c> qrList2 = new List <GFQuote__c>();
List <Opportunity> oppList = New List<Opportunity>();
if(KeyContactsController.stopTrigger == true)
{
Map <Id, GFQuote__c> qrOldMap = new Map <Id, GFQuote__c>();
Map <Id, String> currMap = new Map <Id, String>();
string qrStatus;
String currentUserID = Userinfo.getUserId();
User current_user=[SELECT Email FROM User WHERE Id = :UserInfo.getUserId()] ;
//Boolean qrFlag = false;
//Force-166

List <GFQuote__c> qr1 = new List <GFQuote__c>();
List <GFQuote__c> qr2= new List<GFQuote__c>();
List <GFQuote__c> qr3= new List<GFQuote__c>();

qr1 = [select Id,Launch_Date__c,Name,Deal__r.Product_Family__c,Error_Message__c,Deal__r.Country__c,Deal_Review_Comments_QR__c,Deal_Review_Date_QR__c, Deal_approved_by_QR1__c, Next_Oppty_To_Quote__c,Closed_Hold_Comments_QR__c,Deal__r.Product__c,Product_Type__c,Sub_Product__c,Deal__c, Quote_Request_Status_Number__c,Quote_Request_Status__c,BDM_Name__c,Deal_name__c from GFQuote__c where id IN :Trigger.newMap.keySet()];
//qrStatus = qr1.Quote_Request_Status__c;
List<Country__c> mcs = Country__c.getall().values();
System.debug('Rakesh'+ mcs);
for(GFQuote__c a : qr1)
{
qrStatus = a.Quote_Request_Status__c;
List <Opportunity> ct = New List<Opportunity>( [select Name, id,CloseDate,StageName, Deal_Review_Date__c, Reason_Closed_Lost__c, Deal_Lost_Description__c, Lost_Comments__c, Next_Opportunity_To_Quote__c from Opportunity where id = :a.Deal__c Limit 1]);
for(Opportunity d : ct)
{
qr2 = [select Id,Launch_Date__c,name from GFQuote__c where Deal__c = : d.id];
qr3 = [select Id,name,Quote_Request_Status__c from GFQuote__c where Deal__c = : d.id AND Quote_Request_Status__c != 'QR Lost'];
//FORCE-246
if (a.Launch_Date__c== NULL)
{
a.Launch_Date__c=d.CloseDate;
oppList.add(d);

}

/>List<Country__c> mcs = Country__c.getall().values();
System.debug('Rakesh'+ mcs);
for(GFQuote__c a : qr1)
{
qrStatus = a.Quote_Request_Status__c;
List <Opportunity> ct = New List<Opportunity>( [select Name, id,CloseDate,StageName, Deal_Review_Date__c, Reason_Closed_Lost__c, Deal_Lost_Description__c, Lost_Comments__c, Next_Opportunity_To_Quote__c from Opportunity where id = :a.Deal__c Limit 1]);
for(Opportunity d : ct)
{
qr2 = [select Id,Launch_Date__c,name from GFQuote__c where Deal__c = : d.id];
qr3 = [select Id,name,Quote_Request_Status__c from GFQuote__c where Deal__c = : d.id AND Quote_Request_Status__c != 'QR Lost'];
//FORCE-246
if (a.Launch_Date__c== NULL)
{
a.Launch_Date__c=d.CloseDate;
oppList.add(d);


 

Hi I am finding the same 101 error with the follwoing code. I tried chainging the code by taking the query with in the for loop but still finding the same issue . Please help me in this

 

trigger QuoteRequest_AfterInsertUpdate on GFQuote__c (after insert, after update)
{
List <GFQuote__c> qrList = new List <GFQuote__c>();
List <GFQuote__c> qrList1 = new List <GFQuote__c>();
List <GFQuote__c> qrList2 = new List <GFQuote__c>();
List <Opportunity> oppList = New List<Opportunity>();
if(KeyContactsController.stopTrigger == true)
{
Map <Id, GFQuote__c> qrOldMap = new Map <Id, GFQuote__c>();
Map <Id, String> currMap = new Map <Id, String>();
string qrStatus;
String currentUserID = Userinfo.getUserId();
User current_user=[SELECT Email FROM User WHERE Id = :UserInfo.getUserId()] ;
//Boolean qrFlag = false;
//Force-166

List <GFQuote__c> qr1 = new List <GFQuote__c>();
List <GFQuote__c> qr2= new List<GFQuote__c>();
List <GFQuote__c> qr3= new List<GFQuote__c>();

qr1 = [select Id,Launch_Date__c,Name,Deal__r.Product_Family__c,Error_Message__c,Deal__r.Country__c,Deal_Review_Comments_QR__c,Deal_Review_Date_QR__c, Deal_approved_by_QR1__c, Next_Oppty_To_Quote__c,Closed_Hold_Comments_QR__c,Deal__r.Product__c,Product_Type__c,Sub_Product__c,Deal__c, Quote_Request_Status_Number__c,Quote_Request_Status__c,BDM_Name__c,Deal_name__c from GFQuote__c where id IN :Trigger.newMap.keySet()];
//qrStatus = qr1.Quote_Request_Status__c;
List<Country__c> mcs = Country__c.getall().values();
System.debug('Rakesh'+ mcs);
for(GFQuote__c a : qr1)
{
qrStatus = a.Quote_Request_Status__c;
List <Opportunity> ct = New List<Opportunity>( [select Name, id,CloseDate,StageName, Deal_Review_Date__c, Reason_Closed_Lost__c, Deal_Lost_Description__c, Lost_Comments__c, Next_Opportunity_To_Quote__c from Opportunity where id = :a.Deal__c Limit 1]);
for(Opportunity d : ct)
{
qr2 = [select Id,Launch_Date__c,name from GFQuote__c where Deal__c = : d.id];
qr3 = [select Id,name,Quote_Request_Status__c from GFQuote__c where Deal__c = : d.id AND Quote_Request_Status__c != 'QR Lost'];
//FORCE-246
if (a.Launch_Date__c== NULL)
{
a.Launch_Date__c=d.CloseDate;
oppList.add(d);

}