• One_Kitchen_Guy
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Hi guys,

Im trying to update opportunities in a list in a map and I'm tearing my hair out trying to figure it out.

So my code looks something like this...

Opportunity[] opps = [SELECT Id, Expiration__c, AccountId FROM Opportunity];

		Map<Id,Opportunity[]> expiredOppsMap = new Map<Id, Opportunity[]>();

		//Some manipulation on the Opportunities in 'opps'...

		for(Integer i=0; i<opps.size(); i++){

			if(expiredOppsMap.ContainsKey(opps[i].AccountId)){

				expiredOppsMap.get(opps[i].AccountId).add(opp[i]);

			}else{

				expiredOppsMap.put(opps[i].AccountId, new List<Opportunity>{opps[i]});

			}
		}

		update expiredOppsMap.values();

The error im getting is:
DML requires SObject or SObject list type: LIST<LIST<Opportunity>>

Can someone please explain how I can update each opportunity in the lists in the map without looping through each list in the map and adding each of the opportunities to another list then updating that new list?

Thank you in advance!!

Hi guys,
For some reason my search buttons are working when generated individually, howver when generated with the <apex:repeat/> method they dont work. Can anyone please advise?

I am trying to modify an "Opportunity Produt Entry Replacement" plugin which I installed from http://www.michaelforce.org/recipeView?id=a0G30000006eVxVEAU .

The problem I am running into is when I try to generate buttons in tabbed groups using the <apex:repeat> method that builds off a list in my controller. The buttons are supposed to pass  its value to the query string and return the products that match the search. The weird thing is that the buttons generated without the repeat method work as intended however the buttons generated via the repeat method do not.

Anybody have any ideas? Thanks in advance!

|------------------------------------Visualforce Page----------------------------------|

<!--These Buttons Work-->
    <apex:tab label="Package" name="package" id="packageTab">
        <apex:commandButton value="Reface Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" RWD "/>
        </apex:commandButton>
        <apex:commandButton value="New Laminate" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" NLAM "/>
        </apex:commandButton>
        <apex:commandButton value="New Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" NWD "/>
        </apex:commandButton>
        <apex:commandButton value="New Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="Wood"/>
        </apex:commandButton>
        <apex:commandButton value="Laminate" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="laminate"/>
        </apex:commandButton>
    </apex:tab>

<!--These buttons do not-->
    <apex:repeat value="{!dDFMatBtns}" var="d">
        <apex:commandButton value="{!d}" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="{!d}"/>
        </apex:commandButton>
    </apex:repeat>


|-------------------------------------Controller------------------------------------------|
if(searchString!=null){
    qString+= ' and (Product2.Name like \'%' + searchString + '%\' or Product2.Description like \'%' + searchString + '%\' or Product2.Keyword__c like \'%' + searchString + '%\' or Product2.Family like \'%' + searchString + '%\' or Product2.Product_Brand__c like \'%' + searchString + '%\')';
}

searchString = null;
system.debug('qString:' +qString);

AvailableProducts = database.query(qString);

// We only display up to 100 results... if there are more than we let the user know (see vf page)
if(AvailableProducts.size()==301){
    AvailableProducts.remove(300);
    overLimit = true;
}else{
    overLimit = false;
}

public List<String> dDFStyleBtns{
    get{
        if(dDFStyleBtns == null){
            dDFStyleBtns = new List<String>();
            dDFStyleBtns.add('Amesbury');
            dDFStyleBtns.add('CRP');
            dDFStyleBtns.add('Elite');
            dDFStyleBtns.add('Euro');
            dDFStyleBtns.add('Lasalle');
            dDFStyleBtns.add('Madison');
            dDFStyleBtns.add('Presidential');
            dDFStyleBtns.add('TW-10');
            dDFStyleBtns.add('Prestige');
            dDFStyleBtns.add('Windham');
            dDFStyleBtns.add('Yardley');
        }
        return dDFStyleBtns;
    }
    private set;
}

Hi All,

 

I think this is an easy fix for someone who knows what they are doing. Unfortunately I do not.

 

Here is the situation...

 

I've created a Visual Flow (at least that's what I think its called) with some basic decisions and input screens to collect information.  The flow is triggered by a button on the "Quote" screen.  At the end of the flow I would like to automatically run a DDP I previously created.  I want the DDP to include values from the quote and from values collected in the flow. I would also like to be able to control the delivery option.

 

I tried using the "Run DDP" element in the visual flow editor but I can't seem to get it to work.

 

PLEASE HELP

 

Thanks in advance!

 

Josh

Hi All!

 

I Hope this makes sense..

 

I am attempting to use Drawloop to generate agreements based off of quotes our sales reps build. The issue I am running into is I want to determine whether the any of the products the reps selected contains "Wood" in the custom "Product Material"  field, and if so add a specific addendum which contains the warranty and disclaimer for our wood doors. 

 

The approach I am taking is as follows

-----------------------------------------------------------------------------------------------------

Create a custom "Quote Line-item" formula field called "IsWood"..

IF(ISPICKVAL( Product2.Product_Material__c ,"Wood"),1,0)

Create a "Quote" Roll-Up Summary field called "TotalWood" which adds all of the "IsWoods"

 

Then in Drawloop > DDP > Select Files > Options (cog icon) > Section: choose advanced and set the filter condition to

Included if <<Quote_TotalWood>> is Greater Than 0.

-----------------------------------------------------------------------------------------------------

 

 

Where im getting hung up is the "Quote" Roll-Up Summary wont let me aggrigate "IsWood" because it is a formula field and not a number field, even though its return type is "Number".

 

 

Please help!!!

Thanks in advance

Hi guys,
For some reason my search buttons are working when generated individually, howver when generated with the <apex:repeat/> method they dont work. Can anyone please advise?

I am trying to modify an "Opportunity Produt Entry Replacement" plugin which I installed from http://www.michaelforce.org/recipeView?id=a0G30000006eVxVEAU .

The problem I am running into is when I try to generate buttons in tabbed groups using the <apex:repeat> method that builds off a list in my controller. The buttons are supposed to pass  its value to the query string and return the products that match the search. The weird thing is that the buttons generated without the repeat method work as intended however the buttons generated via the repeat method do not.

Anybody have any ideas? Thanks in advance!

|------------------------------------Visualforce Page----------------------------------|

<!--These Buttons Work-->
    <apex:tab label="Package" name="package" id="packageTab">
        <apex:commandButton value="Reface Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" RWD "/>
        </apex:commandButton>
        <apex:commandButton value="New Laminate" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" NLAM "/>
        </apex:commandButton>
        <apex:commandButton value="New Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value=" NWD "/>
        </apex:commandButton>
        <apex:commandButton value="New Wood" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="Wood"/>
        </apex:commandButton>
        <apex:commandButton value="Laminate" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="laminate"/>
        </apex:commandButton>
    </apex:tab>

<!--These buttons do not-->
    <apex:repeat value="{!dDFMatBtns}" var="d">
        <apex:commandButton value="{!d}" reRender="searchResults" action="{!updateAvailableList}">
            <apex:param assignTo="{!searchString}" value="{!d}"/>
        </apex:commandButton>
    </apex:repeat>


|-------------------------------------Controller------------------------------------------|
if(searchString!=null){
    qString+= ' and (Product2.Name like \'%' + searchString + '%\' or Product2.Description like \'%' + searchString + '%\' or Product2.Keyword__c like \'%' + searchString + '%\' or Product2.Family like \'%' + searchString + '%\' or Product2.Product_Brand__c like \'%' + searchString + '%\')';
}

searchString = null;
system.debug('qString:' +qString);

AvailableProducts = database.query(qString);

// We only display up to 100 results... if there are more than we let the user know (see vf page)
if(AvailableProducts.size()==301){
    AvailableProducts.remove(300);
    overLimit = true;
}else{
    overLimit = false;
}

public List<String> dDFStyleBtns{
    get{
        if(dDFStyleBtns == null){
            dDFStyleBtns = new List<String>();
            dDFStyleBtns.add('Amesbury');
            dDFStyleBtns.add('CRP');
            dDFStyleBtns.add('Elite');
            dDFStyleBtns.add('Euro');
            dDFStyleBtns.add('Lasalle');
            dDFStyleBtns.add('Madison');
            dDFStyleBtns.add('Presidential');
            dDFStyleBtns.add('TW-10');
            dDFStyleBtns.add('Prestige');
            dDFStyleBtns.add('Windham');
            dDFStyleBtns.add('Yardley');
        }
        return dDFStyleBtns;
    }
    private set;
}

Hi All!

 

I Hope this makes sense..

 

I am attempting to use Drawloop to generate agreements based off of quotes our sales reps build. The issue I am running into is I want to determine whether the any of the products the reps selected contains "Wood" in the custom "Product Material"  field, and if so add a specific addendum which contains the warranty and disclaimer for our wood doors. 

 

The approach I am taking is as follows

-----------------------------------------------------------------------------------------------------

Create a custom "Quote Line-item" formula field called "IsWood"..

IF(ISPICKVAL( Product2.Product_Material__c ,"Wood"),1,0)

Create a "Quote" Roll-Up Summary field called "TotalWood" which adds all of the "IsWoods"

 

Then in Drawloop > DDP > Select Files > Options (cog icon) > Section: choose advanced and set the filter condition to

Included if <<Quote_TotalWood>> is Greater Than 0.

-----------------------------------------------------------------------------------------------------

 

 

Where im getting hung up is the "Quote" Roll-Up Summary wont let me aggrigate "IsWood" because it is a formula field and not a number field, even though its return type is "Number".

 

 

Please help!!!

Thanks in advance