• danno
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
I have a use case where not all opportunity line items should be copied to a new quote when one is created.

I plan to take manual control of creating quote line items via a trigger after quote insert.

My problem is that I cannot prevent the products from being automagically added and I cannot get the added quote line items in the after quote insert trigger (to remove them) as they have not been created.

This old post discusses the same issue but from my testing the solution will not work because the line items have not been created in the quote after insert trigger.

Is there a way to either;

A. Prevent the auto adding of opp products to new quotes
OR
B. Get the automagically added quotelineitems in the quote insert trigger

Thank you for reading!
  • July 18, 2017
  • Like
  • 0

I would like to have my page select the controller extension for the controller based on a parameter passed in the url, can this be done? If so what is the method?

 

Thanks :)

  • September 22, 2013
  • Like
  • 0

Hi,

 

I have created some custom classes and visualforce pages that work great in my DE. I want to get these into my clients PROFESSIONAL edition environment but I'm a little unsure of the best approach.

 

My understanding is that custom apex can only be added to PE as a managed package, by a salesforce development partner after a code security review.

 

On this basis I have signed up for the partner program and I'm ready to roll...

 

My confusion comes from the nature of my customizations, as I never created a new app, or custom objects. My code extends the standard standardcontrollers, uses redirects to display custom pages from standard buttons and only requires a few custom fields on the standard objects.

 

My question is how do I package this as an app when it is not created as a new app, just a bunch of classes and pages.

 

Daniel

  • August 15, 2013
  • Like
  • 0

I have a custom page for multiline editing of opportunity product line items

 

The code looks a bit like this;

 

apex:page standardController="Opportunity">        
<apex:pageMessages />
<apex:includeScript value="{!URLFOR($Resource.JQuery, '')}"  />
<apex:stylesheet value="{!URLFOR($Resource.customStyle, '')}"  />
<script>
  // some nifty scripts
</script>
<style>
    .accountLink { color: blue; cursor: pointer; cursor: hand; }
</style>
 
  <apex:form id="EditAllProductsLine_Form">
 
    <apex:pageBlock title="Edit Products for {!Opportunity.Name}" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton onclick="message()" action="{!save}" value="Save and move on.."/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons>

        <apex:dataTable value="{!Opportunity.OpportunityLineItems}" var="lines" id="theTable" rowClasses="quoteRow"
                        styleClass="tableClass" cellpadding="3" cellspacing="3">      
            <apex:column headerValue=" Quantity ">
                <apex:inputField value="{!lines.Quantity}" style="width: 30px;" styleClass="qnty"/>
            </apex:column>
            <apex:column headerValue=" Product " style="align: center;">
                <textarea class="prdName" rows="2" style="width: 350px;">{!lines.Product_Name__c}</textarea>
                <apex:inputField value="{!lines.description}" style="visibility:hidden;" styleClass="desc"/>
            </apex:column>
            <apex:column headerValue=" Cost Price " style="width: 70px;">
                <apex:inputField value="{!lines.cost__c}" style="width: 70px;" styleClass="cost"/>
            </apex:column>  
            <apex:column headerValue=" Margin " style="width: 30px;">
                <apex:inputField value="{!lines.Margin__c}" style="width: 35px;" styleClass="marg"/>
            </apex:column>
            <apex:column headerValue=" Sell Price ">
                <apex:inputField value="{!lines.UnitPrice}" style="width: 90px;" styleClass="slPrc rwNum"/>
            </apex:column>
            <apex:column headerValue=" Row Total ">
                <apex:outputText value="{!lines.Subtotal}" style="width: 90px;" styleClass="rowSub rwNum"/>
            </apex:column>
        </apex:dataTable>
        
        <div>
            <p>Total Cost: <span id="totCost"></span></p>
            <p>Total Sale: <span id="totSale"></span></p>
            <p>Quote Margin: <span id="totMrgn"></span></p>
            <p>Gross Profit: <span id="totPrft"></span></p>
        </div>


    </apex:pageBlock>
  </apex:form>
</apex:page>

 

When i hit the save button the browser goes back to the opportunity as expected but the field values are not being saved.

 

I am very new to this platform but from what i have seen from googling around this should be working!

 

Can someone please point me in the right direction.

 

Many thanks :) 

  • August 11, 2013
  • Like
  • 0

Hi,

I have custom Quote object and order custom object and for those two I have child's objects as well.

Quote----------------Order
    |                            |
Quote line Items--Order Items

for this convert, I need some coding references like blogs or pages.
can someone help me how can I do that dynamically?
Thanks In advance!....


 

I have a custom page for multiline editing of opportunity product line items

 

The code looks a bit like this;

 

apex:page standardController="Opportunity">        
<apex:pageMessages />
<apex:includeScript value="{!URLFOR($Resource.JQuery, '')}"  />
<apex:stylesheet value="{!URLFOR($Resource.customStyle, '')}"  />
<script>
  // some nifty scripts
</script>
<style>
    .accountLink { color: blue; cursor: pointer; cursor: hand; }
</style>
 
  <apex:form id="EditAllProductsLine_Form">
 
    <apex:pageBlock title="Edit Products for {!Opportunity.Name}" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton onclick="message()" action="{!save}" value="Save and move on.."/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons>

        <apex:dataTable value="{!Opportunity.OpportunityLineItems}" var="lines" id="theTable" rowClasses="quoteRow"
                        styleClass="tableClass" cellpadding="3" cellspacing="3">      
            <apex:column headerValue=" Quantity ">
                <apex:inputField value="{!lines.Quantity}" style="width: 30px;" styleClass="qnty"/>
            </apex:column>
            <apex:column headerValue=" Product " style="align: center;">
                <textarea class="prdName" rows="2" style="width: 350px;">{!lines.Product_Name__c}</textarea>
                <apex:inputField value="{!lines.description}" style="visibility:hidden;" styleClass="desc"/>
            </apex:column>
            <apex:column headerValue=" Cost Price " style="width: 70px;">
                <apex:inputField value="{!lines.cost__c}" style="width: 70px;" styleClass="cost"/>
            </apex:column>  
            <apex:column headerValue=" Margin " style="width: 30px;">
                <apex:inputField value="{!lines.Margin__c}" style="width: 35px;" styleClass="marg"/>
            </apex:column>
            <apex:column headerValue=" Sell Price ">
                <apex:inputField value="{!lines.UnitPrice}" style="width: 90px;" styleClass="slPrc rwNum"/>
            </apex:column>
            <apex:column headerValue=" Row Total ">
                <apex:outputText value="{!lines.Subtotal}" style="width: 90px;" styleClass="rowSub rwNum"/>
            </apex:column>
        </apex:dataTable>
        
        <div>
            <p>Total Cost: <span id="totCost"></span></p>
            <p>Total Sale: <span id="totSale"></span></p>
            <p>Quote Margin: <span id="totMrgn"></span></p>
            <p>Gross Profit: <span id="totPrft"></span></p>
        </div>


    </apex:pageBlock>
  </apex:form>
</apex:page>

 

When i hit the save button the browser goes back to the opportunity as expected but the field values are not being saved.

 

I am very new to this platform but from what i have seen from googling around this should be working!

 

Can someone please point me in the right direction.

 

Many thanks :) 

  • August 11, 2013
  • Like
  • 0

Hi all,

 

I had this page absoultely working before. I didnt make any changes to the code and it has stopped working.

 

I have a custom object that has this field - ScoringRule_Rule1__c (picklist).

 

On visualforce page, it keeps complaining that it cant bind an inputField to something that is not an object's field.

 

Here is my Controller code:

 

public class newScoreRuleController {

// Declarations
public List<ScoringRule__c> ScoringRule { get; private set;}

// Constructor Method
public newScoreRuleController () {
// Give me blank lines of my Object
ScoringRule = new List<ScoringRule__c>();
for (integer i = 0; i < 5; i++) {
ScoringRule.add( new ScoringRule__c() );
}

}
}

 Here is my Visualforce Code:

 

<apex:page controller="newScoreRuleController" tabStyle="Lead">
<apex:sectionHeader title="Scoring Rule Wizard" subtitle="Step 2 of 2"/>
<apex:form >
<apex:pageBlock title="Choose a scoring rule" mode="edit">
<apex:messages styleClass="error" />
<apex:pageBlockSection title="Choose a scoring rule">
<apex:pageBlockTable value="{!ScoringRule}" var="sr" id="theTable" rowClasses="odd,even"
styleClass="tableClass" rows="5">
<apex:column >
<apex:facet name="header">Field</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!fieldName}"/>
</apex:column>
<apex:column width="25%">
<apex:facet name="header">Operator 1</apex:facet>
<apex:outputPanel layout="block" styleClass="requiredInput">
<apex:outputPanel layout="block" styleClass="requiredBlock"/>
<apex:inputField value="{!sr.ScoringRule_Rule1__c}" required="true"/>
</apex:outputPanel>
</apex:column>
</apex:pageBlockTable>

<!-- Within a pageBlockSection, inputFields always display with their
corresponding output label. -->
</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>
</apex:page>

 

Any help is much appreciated!

 

Regards

Mukul

 

 

 

 

  • July 09, 2009
  • Like
  • 0