• abhinavgupta19
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

Hi,

 

In my use case, I have a Opportunity created for a company to whom I will be selling a bunch of products(Opp Line Items).

 

Lets go thru following example thats close to my use case.

 

For ex. 

Opportunity.Name : Johnson Bros Opp

Opp Close Date : after  10 days from now.

Opp status : Prospecting

 

Opp Line Item:

 

1. Product: Panasonic Plasma  , Quantity: 10, Price : 500 $

2. Product: Dell Vostro Laptop 15"  , Quantity: 20, Price : 600 $

 

Now my real sales figures are as follows:

 

1. Product: Panasonic Plasma  , Quantity Sold: 4

2. Product: Dell Vostro Laptop 15"  , Quantity Sold: 15

 

This sales is done via various ways, like some are thru my online website and some are via direct payment from customer. So how to reflect this sales data into my salesforce org ?

 

 

Thanks,

Ab

 

Hi,

 

I am trying to create a product catalog to sell opportunity line items via a salesforce public site. My point of confusion is how should I mark an OpportunityLineItem as sold and adjust the quantity on each purchase. 

 

Whats the salesforce way to deal with this i.e. How to sell out the opportunity line items and mark the opportunity as closed when done ?

 

 

Regards,

Ab

 

 

My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute

 

 

Another trivial but strange thing thats happening is that, I can't open a component in view mode. On trying to view the component from Setup > Develop > Components. Following salesforce error comes, though we can edit the component :)

 
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 299154357-472 (-607383983)

 

I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".

 

Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.

 

Please help !

 

 Hi All,

 

I want to rerender a dependent picklist as per the value of a master picklist, I am facing a strange behavior here. On re-render all the stuff other than the dependent picklist is updates like text field.

 

Here is the code, on change of "category"picklist I want to rerender "categoryValue". I tried using the Id of dependent picklist but thats not working so, I am rerendering the complete form.

 

 

 

<apex:page controller="RerenderController">



<h1>Select a Category</h1>
<apex:form id="theForm">
<apex:actionFunction name="onCategoryChange" action="{!onCategoryChange}" reRender="theForm" />

<apex:selectList value="{!category}" size="1" onchange="onCategoryChange()">
<apex:selectoptions value="{!categories}"/>

</apex:selectList>
&nbsp; &nbsp; &nbsp;
<apex:selectList value="{!categoryValue}" size="1">
<apex:selectoptions value="{!categoryValues}"/>
</apex:selectList>

&nbsp; &nbsp; &nbsp;
<apex:outputText value="{!categoryValuesAsCSV}" />


</apex:form>

</apex:page>

 

 

public class RerenderController {
private static Map<String, List<SelectOption>> catValueMap = new Map<String, List<SelectOption>> ();

static {
List <Selectoption> fruits = new List<SelectOption>();
fruits.add(new SelectOption('Apple','Apple'));
fruits.add(new SelectOption('Grape', 'Grape'));
fruits.add(new SelectOption('Banana','Banana'));
fruits.add(new SelectOption('Orange','Orange'));
catValueMap.put('Fruits', fruits);

List <Selectoption> animals = new List<SelectOption>();
animals.add(new SelectOption('Dog','Dog'));
animals.add(new SelectOption('Cat', 'Cat'));
animals.add(new SelectOption('Monkey','Monkey'));
animals.add(new SelectOption('Donkey','Donkey'));
catValueMap.put('Animals', animals);

List <Selectoption> computers = new List<SelectOption>();
computers.add(new SelectOption('Dell','Dell'));
computers.add(new SelectOption('Compaq', 'Compaq'));
computers.add(new SelectOption('Acer','Acer'));
computers.add(new SelectOption('Apple','Apple'));
catValueMap.put('Computers', computers);
}

public List<SelectOption> categories {get ; set;}
public String category {get ; set;}
public List<SelectOption> categoryValues {get ; set;}
public String categoryValue {get ; set;}

{
categories = new List<Selectoption>();
categories.add(new Selectoption('Fruits', 'Fruits'));
categories.add(new Selectoption('Animals', 'Animals'));
categories.add(new Selectoption('Computers','Computers'));


}

public String getCategoryValuesAsCSV () {
String csv = '';
if (categoryValues != null) {
for (Selectoption so: categoryValues ){
csv += so.getValue() + ' , ';
}
}
return csv;
}

public void onCategoryChange() {
categoryValues = catValueMap.get(category);
}
}

 

 

 I tried searching on the boards, but people are saying this problem can be because of required fields in the form. But my form is not having any such data. 

 

Please help.

Message Edited by abhinavgupta19 on 05-27-2009 06:38 PM

Hi Guys,

 

I want to create sections in page with dynamic ids. These ids might be coming from a List/Set in apex controller.

The goal is to get a partial page refresh for the section represented by dynamic ids.

 

for ex.

 

 

<table>

    <tr id='r1' > <select onchange="rerender(r1)"> <option /> .... </select> </tr>

    <tr id='r2' > <select onchange="rerender(r2)"> <option /> .... </select> </tr>

     ............................

     ............................

     ............................

    <tr id='rN' > <select onchange="rerender(rN)"> <option /> .... </select> </tr>

 </table>

 

I was checking documentation for "Id"  attribute in visualforce tags, we can't put a merge field expression or a value in iteration in the ID. Although rerender attribute supports merge field expressions, so it seems I can have current iteration/loop variables like r1, r2 into the render attribute.

 

We commonly use to do this in HTML with any other language like JSP/ASP to have elements with dynamic ids and perform some operations on them. I was curious to know if this is possible in visual force also.

 

 

 

 

Hi,

 

I am trying to create a product catalog to sell opportunity line items via a salesforce public site. My point of confusion is how should I mark an OpportunityLineItem as sold and adjust the quantity on each purchase. 

 

Whats the salesforce way to deal with this i.e. How to sell out the opportunity line items and mark the opportunity as closed when done ?

 

 

Regards,

Ab

 

 

My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute

 

 

Another trivial but strange thing thats happening is that, I can't open a component in view mode. On trying to view the component from Setup > Develop > Components. Following salesforce error comes, though we can edit the component :)

 
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 299154357-472 (-607383983)

 

I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".

 

Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.

 

Please help !

 

 Hi All,

 

I want to rerender a dependent picklist as per the value of a master picklist, I am facing a strange behavior here. On re-render all the stuff other than the dependent picklist is updates like text field.

 

Here is the code, on change of "category"picklist I want to rerender "categoryValue". I tried using the Id of dependent picklist but thats not working so, I am rerendering the complete form.

 

 

 

<apex:page controller="RerenderController">



<h1>Select a Category</h1>
<apex:form id="theForm">
<apex:actionFunction name="onCategoryChange" action="{!onCategoryChange}" reRender="theForm" />

<apex:selectList value="{!category}" size="1" onchange="onCategoryChange()">
<apex:selectoptions value="{!categories}"/>

</apex:selectList>
&nbsp; &nbsp; &nbsp;
<apex:selectList value="{!categoryValue}" size="1">
<apex:selectoptions value="{!categoryValues}"/>
</apex:selectList>

&nbsp; &nbsp; &nbsp;
<apex:outputText value="{!categoryValuesAsCSV}" />


</apex:form>

</apex:page>

 

 

public class RerenderController {
private static Map<String, List<SelectOption>> catValueMap = new Map<String, List<SelectOption>> ();

static {
List <Selectoption> fruits = new List<SelectOption>();
fruits.add(new SelectOption('Apple','Apple'));
fruits.add(new SelectOption('Grape', 'Grape'));
fruits.add(new SelectOption('Banana','Banana'));
fruits.add(new SelectOption('Orange','Orange'));
catValueMap.put('Fruits', fruits);

List <Selectoption> animals = new List<SelectOption>();
animals.add(new SelectOption('Dog','Dog'));
animals.add(new SelectOption('Cat', 'Cat'));
animals.add(new SelectOption('Monkey','Monkey'));
animals.add(new SelectOption('Donkey','Donkey'));
catValueMap.put('Animals', animals);

List <Selectoption> computers = new List<SelectOption>();
computers.add(new SelectOption('Dell','Dell'));
computers.add(new SelectOption('Compaq', 'Compaq'));
computers.add(new SelectOption('Acer','Acer'));
computers.add(new SelectOption('Apple','Apple'));
catValueMap.put('Computers', computers);
}

public List<SelectOption> categories {get ; set;}
public String category {get ; set;}
public List<SelectOption> categoryValues {get ; set;}
public String categoryValue {get ; set;}

{
categories = new List<Selectoption>();
categories.add(new Selectoption('Fruits', 'Fruits'));
categories.add(new Selectoption('Animals', 'Animals'));
categories.add(new Selectoption('Computers','Computers'));


}

public String getCategoryValuesAsCSV () {
String csv = '';
if (categoryValues != null) {
for (Selectoption so: categoryValues ){
csv += so.getValue() + ' , ';
}
}
return csv;
}

public void onCategoryChange() {
categoryValues = catValueMap.get(category);
}
}

 

 

 I tried searching on the boards, but people are saying this problem can be because of required fields in the form. But my form is not having any such data. 

 

Please help.

Message Edited by abhinavgupta19 on 05-27-2009 06:38 PM

Hello.

 

i am a beginner with VisualForce programming.

 

I am trying to change some control status (chooseOperation and aquoteNumber) after changing the values of the controlling picklists.

 

However the ReRender attribute seems never working.

 

Can someone help me understand what I am doing wrong?

 

 

Visualforce code:

 

 

<apex:page standardController="Opportunity" extensions="QuoteToolRequestController">
<apex:sectionHeader title="New Quote Request"/>

<apex:form >
<apex:pageBlock mode="edit">
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:outputText value="{!opportunity.OPPORTUNITYCODE_MK__c}" rendered="false"/>


<apex:pageBlockSection title="Quote Request Information" columns="2">

<apex:outputLabel value="Choose Operation " for="chooseOperation"/>
<apex:selectList id="chooseOperation" value="{!selectedOperation}" size="1">
<apex:selectOptions value="{!operationList}"/>
<apex:actionSupport event="onchange" reRender="quoteNumber,chooseCode" />
</apex:selectList>


<apex:outputLabel value="Choose Code to revision" for="chooseCode"/>
<apex:selectList id="chooseCode" value="{!selectedCode}" size="1" disabled="{!codeSelectionDisabled}">
<apex:selectOptions value="{!codeList}"/>
<apex:actionSupport event="onchange" reRender="quoteNumber" />
</apex:selectList>

<apex:outputLabel value="Quote Number" for="quoteNumber"/>
<apex:outputText id="quoteNumber" value="{!quotationName}" />
</apex:pageBlockSection>

<apex:pageBlockSection title="Quote Information" columns="1">

<apex:pageBlockSectionItem >
<apex:outputLabel value="Assignee" for="assignee"/>
<apex:inputField id="assignee" value="{!quotation.assignee__c}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<apex:outputLabel value="Due date" for="dueDate"/>
<apex:inputField id="dueDate" value="{!quotation.due_date__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:pageBlockSection title="Technical Information" columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Requirements" for="requirements"/>
<apex:inputField id="requirements" value="{!quotation.requirements__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageMessages showDetail="true"></apex:pageMessages>
</apex:pageBlock>

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

 

 Controller:

 

 

public class QuoteToolRequestController {

// FIELDS
private Opportunity parentOpportunity;
private Quotation__c quotation = new Quotation__c();
private List<SelectOption> operationList = new List<SelectOption>();
private List<SelectOption> codeList = new List<SelectOption>();
private Map<Integer,Integer> codeMap = new Map<Integer,Integer>(); // MAPPA DEI CODICI (Key = Quotation__c.code__c, Value = Quotation__c.version__c)
private Integer selectedOperation = 0; // selected Operation type for Quote Revision
private Integer selectedCode = 1; // selected Code for Quote Revision
private Integer maxCode = 0; // highest Code in all existing Quotes
// FIELDS


// PROPERTIES
public void setSelectedOperation(Integer value) {
this.selectedOperation = value;
}
public Integer getSelectedOperation() {
return this.selectedOperation;
}

public void setSelectedCode(Integer value) {
this.selectedCode = value;
}
public Integer getSelectedCode() {
return this.selectedCode;
}

public Quotation__c getQuotation() {
return this.quotation;
}

public List<SelectOption> getOperationList() {
return this.operationList;
}

public List<SelectOption> getCodeList() {
return this.codeList;
}

public boolean getCodeSelectionDisabled() {
return (this.selectedOperation <> 1);
}

public Integer getCode() {
if (this.selectedOperation == 0) {
return this.maxCode+1;
} else {
return this.selectedCode;
}
}

public Integer getVersion() {
if (this.selectedOperation == 0) {
return 1;
} else {
return (this.codeMap.get(selectedCode)+1);
}
}

public String getQuotationName() {
String quotationName = this.parentOpportunity.OPPORTUNITYCODE_MK__c;
Integer code = this.getCode();
Integer version = this.getVersion();

if (code < 10) {
quotationName = quotationName + '.0' + code;
} else {
quotationName = quotationName + '.' + code;
}
if (version < 10) {
quotationName = quotationName + '.0' + version;
} else {
quotationName = quotationName + '.' + version;
}
return quotationName;
}
// PROPERTIES


// CONSTRUCTOR
public QuoteToolRequestController(ApexPages.StandardController myController) {
parentOpportunity=(Opportunity)myController.getrecord();
operationList.add(new SelectOption('0','New Quote Code'));

initialize();

if (!codeList.isEmpty()) {
operationList.add(new SelectOption('1','New Quote Revision'));
//selectedCode = Integer.valueof(codeList.get(0).getValue());
}
}
// CONSTRUCTOR


public void initialize()
{
// VETTORE DELLE QUOTE DELL'OPPORTUNITÀ
List<Quotation__c> quoteVector = new List<Quotation__c>();
quoteVector = [select code__c, version__c
from Quotation__c
where Opportunity__r.ID = :parentOpportunity.ID];

for(Quotation__c quote: quoteVector) {
Integer quoteCode = quote.CODE__C.intValue();
Integer quoteVersion = quote.VERSION__C.intValue();

if (quoteCode > maxCode) {
maxCode = quoteCode;
}

if (codeMap.containsKey(quoteCode)) {
if (quoteVersion > codeMap.get(quoteCode))
codeMap.put(quoteCode,quoteVersion);
} else {
codeMap.put(quoteCode,quoteVersion);
codeList.add(new SelectOption(quoteCode.format(),quoteCode.format()));
}
}

// A QUESTO PUNTO SONO VALORIZZATE LE SEGUENTI VARIABILI:
// maxCode = MAX(code)
// codeMap = MAP(Code,MAX(version))
}

public PageReference save() {
quotation.name = getQuotationName();
quotation.opportunity__c = parentOpportunity.ID;
quotation.recordTypeID = '012200000000yEaAAI'; // Tool
quotation.status__c = 'Requested';
quotation.code__c = getCode();
quotation.version__c = getVersion();
insert(quotation);

// Redirect to Opportunity Page
PageReference opportunityPage = new PageReference('/'+parentOpportunity.ID);
opportunityPage.setRedirect(true);
return opportunityPage;
}
}