• oodsigma
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi developer heroes,

 

I'd love to pick your brain with the following scenario.

 

Standard Object-Master: Opportunity

Custom Object-Child: Produkt_Ressourcen_Forecast__c

Visualforce Page: ProductResourceForecast

Controller Extension: extForecastProducts

 

What I try to accomplish is an "Edit all" VS page for the custom object. When I click on "Edit all" the following error pops up:

 

Error: Id value 006L0000002BRTw is not valid for the Produkt_Ressourcen_Forecast__c standard controller 

 

The interesting part is, when checking the Id mentioned above it matches the Oppty Id the custom object belongs to.

 

I skimmed the boards already but I wasn't able to get this one fixed myself. Since it is day3 of VF for me, help is much appreciated!

 

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

 

The Controller Extension:


public class extForecastProducts{
private final Produkt_Ressourcen_Forecast__c ForecastProducts;

List<Produkt_Ressourcen_Forecast__c> lstForecastProducts;

Opportunity ForecastProductsNew;

public extForecastProducts(ApexPages.StandardController controller) {
this.ForecastProducts= (Produkt_Ressourcen_Forecast__c)controller.getRecord();


// get Oppty Id from custom object where current id matches


Id Opps= [Select OpportunityID__c FROM Produkt_Ressourcen_Forecast__c 
where Id =: ApexPages.currentPage().getParameters().get('id')].OpportunityID__c;
lstForecastProducts = (List<Produkt_Ressourcen_Forecast__c>)[ 

// get fields of custom object


Select Id,
Contact__c, 
Cost__c, Cost_Type__c, 
Forecast_Product__c,
ID__c,
Forecast_Quantity__c,
Forecast_Unit__c, 
Leistung_erbracht__c, 
Mitarbeiter_Rolle__c,
Opportunity_Line_Item_Id__c,
Opportunity_TS_BETA__c,
Product__c,
Product_Code__c,
Profitability__c,
Quantity__c,
Sales_Price__c,
SFDC_Lizenz_Preis__c,
Subunternehmen__c,
To__c,
Total_Cost__c,
Total_Margin__c,
Total_Price__c,
Unit__c, 
OpportunityID__c 

From Produkt_Ressourcen_Forecast__c
where OpportunityID__c =: Opps]; 
ForecastProductsNew = [Select Id, Name From Opportunity Where Id =: Opps];
}
public List<Produkt_Ressourcen_Forecast__c> getlstForecastProducts(){
return lstForecastProducts;
}
public Opportunity getForecastProductsNew(){
return ForecastProductsNew;
}

public PageReference save() {
update lstForecastProducts;
return (new ApexPages.StandardController(ForecastProductsNew)).view();

}

 

The VS Page:

 

<apex:page standardController="Produkt_Ressourcen_Forecast__c" tabStyle="Opportunity" sidebar="false" extensions="extForecastProducts">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>

<apex:pageBlockTable value="{!lstForecastProducts}" var="prod" id="prod_table">
<apex:column value="{!prod.Name}"/>
<apex:column headerValue="Opportunity">
<apex:inputField value="{!prod.Opportunity_TS_BETA__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Product">
<apex:inputField value="{!prod.Forecast_Product__c}"/>
</apex:column> 
<apex:column headerValue="Leistung erbracht">
<apex:inputField value="{!prod.Leistung_erbracht__c}"/>
</apex:column>
<apex:column headerValue="Mitarbeiter Rolle">
<apex:inputField value="{!prod.Mitarbeiter_Rolle__c}"/>
</apex:column>
<apex:column headerValue="From">
<apex:inputField value="{!prod.From__c}"/>
</apex:column> 
<apex:column headerValue="To">
<apex:inputField value="{!prod.To__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Quantity">
<apex:inputField value="{!prod.Forecast_Quantity__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Unit">
<apex:inputField value="{!prod.Forecast_Unit__c}"/>
</apex:column> 
<apex:column headerValue="Kontakt">
<apex:inputField value="{!prod.Contact__c}"/>
</apex:column> 
<apex:column headerValue="Subunternehmen">
<apex:inputField value="{!prod.Subunternehmen__c}"/>
</apex:column> 

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

 

THX

Hi developer heroes,

 

I'd love to pick your brain with the following scenario.

 

Standard Object-Master: Opportunity

Custom Object-Child: Produkt_Ressourcen_Forecast__c

Visualforce Page: ProductResourceForecast

Controller Extension: extForecastProducts

 

What I try to accomplish is an "Edit all" VS page for the custom object. When I click on "Edit all" the following error pops up:

 

Error: Id value 006L0000002BRTw is not valid for the Produkt_Ressourcen_Forecast__c standard controller 

 

The interesting part is, when checking the Id mentioned above it matches the Oppty Id the custom object belongs to.

 

I skimmed the boards already but I wasn't able to get this one fixed myself. Since it is day3 of VF for me, help is much appreciated!

 

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

 

The Controller Extension:


public class extForecastProducts{
private final Produkt_Ressourcen_Forecast__c ForecastProducts;

List<Produkt_Ressourcen_Forecast__c> lstForecastProducts;

Opportunity ForecastProductsNew;

public extForecastProducts(ApexPages.StandardController controller) {
this.ForecastProducts= (Produkt_Ressourcen_Forecast__c)controller.getRecord();


// get Oppty Id from custom object where current id matches


Id Opps= [Select OpportunityID__c FROM Produkt_Ressourcen_Forecast__c 
where Id =: ApexPages.currentPage().getParameters().get('id')].OpportunityID__c;
lstForecastProducts = (List<Produkt_Ressourcen_Forecast__c>)[ 

// get fields of custom object


Select Id,
Contact__c, 
Cost__c, Cost_Type__c, 
Forecast_Product__c,
ID__c,
Forecast_Quantity__c,
Forecast_Unit__c, 
Leistung_erbracht__c, 
Mitarbeiter_Rolle__c,
Opportunity_Line_Item_Id__c,
Opportunity_TS_BETA__c,
Product__c,
Product_Code__c,
Profitability__c,
Quantity__c,
Sales_Price__c,
SFDC_Lizenz_Preis__c,
Subunternehmen__c,
To__c,
Total_Cost__c,
Total_Margin__c,
Total_Price__c,
Unit__c, 
OpportunityID__c 

From Produkt_Ressourcen_Forecast__c
where OpportunityID__c =: Opps]; 
ForecastProductsNew = [Select Id, Name From Opportunity Where Id =: Opps];
}
public List<Produkt_Ressourcen_Forecast__c> getlstForecastProducts(){
return lstForecastProducts;
}
public Opportunity getForecastProductsNew(){
return ForecastProductsNew;
}

public PageReference save() {
update lstForecastProducts;
return (new ApexPages.StandardController(ForecastProductsNew)).view();

}

 

The VS Page:

 

<apex:page standardController="Produkt_Ressourcen_Forecast__c" tabStyle="Opportunity" sidebar="false" extensions="extForecastProducts">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>

<apex:pageBlockTable value="{!lstForecastProducts}" var="prod" id="prod_table">
<apex:column value="{!prod.Name}"/>
<apex:column headerValue="Opportunity">
<apex:inputField value="{!prod.Opportunity_TS_BETA__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Product">
<apex:inputField value="{!prod.Forecast_Product__c}"/>
</apex:column> 
<apex:column headerValue="Leistung erbracht">
<apex:inputField value="{!prod.Leistung_erbracht__c}"/>
</apex:column>
<apex:column headerValue="Mitarbeiter Rolle">
<apex:inputField value="{!prod.Mitarbeiter_Rolle__c}"/>
</apex:column>
<apex:column headerValue="From">
<apex:inputField value="{!prod.From__c}"/>
</apex:column> 
<apex:column headerValue="To">
<apex:inputField value="{!prod.To__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Quantity">
<apex:inputField value="{!prod.Forecast_Quantity__c}"/>
</apex:column> 
<apex:column headerValue="Forecast Unit">
<apex:inputField value="{!prod.Forecast_Unit__c}"/>
</apex:column> 
<apex:column headerValue="Kontakt">
<apex:inputField value="{!prod.Contact__c}"/>
</apex:column> 
<apex:column headerValue="Subunternehmen">
<apex:inputField value="{!prod.Subunternehmen__c}"/>
</apex:column> 

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

 

THX