• RajeevlsHyd
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 37
    Questions
  • 47
    Replies

I am trying to send the input field value to the controller class from VF page and getting error inside the action funciton method :

 

Here I want to pass three parameters to the controller class :

prodcnt, dealcnt and obj.dsObj.NAS_QC__c ... i am getting the error :

 

Error: <apex:actionFunction> may not be used within an iterable component. You can use <apex:param> to define parameters for the function and pass iteration-specific values via the parameters.

 

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

 

<apex:variable var="prodcnt" value="{!0}" />  // To the get the row number of the product table
<apex:pageBlockTable value="{!selectedProducts}" var="product" id="dealSplitsPBTable">
<apex:column >
<div class="columnHeaderBox">
{!product.product.ProductCode}&nbsp; - &nbsp; {!product.product.Name}
</div>
<apex:variable var="dealcnt" value="{!0}" /> // To get the row number of the deal table
<apex:pageBlockTable value="{!product.dealSplits}" var="obj">

<apex:column headerValue="Delete?">
<apex:inputcheckbox value="{!obj.isSelected}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>

<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.NAS_QC__c}" onchange="ChangeTheManager(this, prodcnt, dealcnt);" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.NAS_QC__c}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionFunction name ="setManager" action ="{!selectManager}" rerender = "dealSplitsPBTable">
<apex:param value = "{!obj.dsObj.NAS_QC__c}" assignTo = "{!currentUserId}" />
<apex:param value = "{!prodcnt}" assignTo = "{!currentProdIndex}" />
<apex:param value = "{!dealcnt}" assignTo = "{!currentDealIndex}" />
</apex:actionFunction>
</apex:column>

 

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

I am trying to send the input field value to the controller class from VF page and getting error inside the action funciton method :

 

Here I want to pass three parameters to the controller class :

prodcnt, dealcnt and obj.dsObj.NAS_QC__c ... i am getting the error :

 

Error: <apex:actionFunction> may not be used within an iterable component. You can use <apex:param> to define parameters for the function and pass iteration-specific values via the parameters.

 

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

 

<apex:variable var="prodcnt" value="{!0}" />  // To the get the row number of the product table
<apex:pageBlockTable value="{!selectedProducts}" var="product" id="dealSplitsPBTable">
<apex:column >
<div class="columnHeaderBox">
{!product.product.ProductCode}&nbsp; - &nbsp; {!product.product.Name}
</div>
<apex:variable var="dealcnt" value="{!0}" /> // To get the row number of the deal table
<apex:pageBlockTable value="{!product.dealSplits}" var="obj">

<apex:column headerValue="Delete?">
<apex:inputcheckbox value="{!obj.isSelected}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>

<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.NAS_QC__c}" onchange="ChangeTheManager(this, prodcnt, dealcnt);" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.NAS_QC__c}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionFunction name ="setManager" action ="{!selectManager}" rerender = "dealSplitsPBTable">
<apex:param value = "{!obj.dsObj.NAS_QC__c}" assignTo = "{!currentUserId}" />
<apex:param value = "{!prodcnt}" assignTo = "{!currentProdIndex}" />
<apex:param value = "{!dealcnt}" assignTo = "{!currentDealIndex}" />
</apex:actionFunction>
</apex:column>

 

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

I want to populate Manager's Name for the user selected in a lookup field in VF page ..

When user select EmpName -  Lookup field to user on VF apge,

I want to populate its corresponding manager's name..

 

Kindly suggest

 

 

VF page :

 

<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionsupport event="onchange" action="{!SelectManager}" rerender="!obj.isSummaryRecord, mgrName" status="waitingStatus"/>
<apex:param name="UsrId" value="{!obj.dsObj.EmpName}" assignTo="{!UsrId}"/>
</apex:column>

 

<apex:column headerValue="Manager Name" id="mgrName">
<apex:OutputField value="{!obj.dsObj.Manager__c}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>

 

 

Controller Class :

 

public PageReference SelectManager()
{
String UsrId;
String UsrName ;
User usr = [Select Id, Name , Reports_To__c from User where IsActive = true and Id =: UsrId Limit 1];
UsrName = usr.Reports_To__c ;
return Null;
}

I want to populate Manager's Name for the user selected in a lookup field in VF page ..

When user select EmpName -  Lookup field to user on VF apge,

I want to populate its corresponding manager's name..

 

Kindly suggest

 

 

VF page :

 

<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionsupport event="onchange" action="{!SelectManager}" rerender="!obj.isSummaryRecord, mgrName" status="waitingStatus"/>
<apex:param name="UsrId" value="{!obj.dsObj.EmpName}" assignTo="{!UsrId}"/>
</apex:column>

 

<apex:column headerValue="Manager Name" id="mgrName">
<apex:OutputField value="{!obj.dsObj.Manager__c}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>

 

 

Controller Class :

 

public PageReference SelectManager()
{
String UsrId;
String UsrName ;
User usr = [Select Id, Name , Reports_To__c from User where IsActive = true and Id =: UsrId Limit 1];
UsrName = usr.Reports_To__c ;
return Null;
}

 

 

 

I am getting this error when I am selecting two items to be inserted from a list . This is working fine when I am inserting a single record, but giving error when multiple items are selected.

 

Please help here :

 

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

 

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.insertFirstProdAndDealSplit();
selectedProds.add(pw);
}
}

//------------------------------------- Opportunity Line Item Insert
String OppId = ApexPages.currentPage().getParameters().get('Id');
For (ProductWrapper p : selectedProds)
{
OpportunityLineItem oppItem = new OpportunityLineItem();
oppItem.OpportunityId = OppId ;
oppItem.PriceBookEntryId = p.product.Id;
oppItem.Roll_Call__c = p.summaryRecord.totalRollCall;
oppItem.UK_Setup__c = p.summaryRecord.totalSetup;
oppItem.ARC__c = p.summaryRecord.totalARC;
mapOppLineItems.put(p, oppItem);
p.firstDealSplit.dsObj.NAS_Opportunity__c = OppId;
lstDealSplitsFirstInsert.add(p.firstDealSplit.dsObj);
}

if(mapOppLineItems.size()>0)
{
Insert mapOppLineItems.values();
}
if(lstDealSplitsFirstInsert.size()>0)
{
Insert lstDealSplitsFirstInsert; /// Giving error on this line of the code
}
return null;
}

 

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

I want to copy the value enetered in one cells to another cell in the same row in a VF page ..

 

I want to copy the value of cell 5 to cell 8 in below code... any idea how this can be acheived :

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

var pCentVal = currentTable.rows[i].cells[4].firstChild.value;
if(pCentVal != undefined){
currentTable.rows[i].cells[5].firstChild.value = (pCentVal * totalRollCall) / 100;
}
I want to copy this cell 5 value to a new cell :

like


if(pCentVal != undefined){
currentTable.rows[i].cells[8].firstChild.value = Cell5 value // How to do it here

}

 

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

I want to make the first row of a list non editable  ..but it has to display  and update value automatically through a logic.. While other rows will be editable.

 

I want to restrict the first row of the dealSplits list(given below) as non- editable while the other rows as editable

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

 

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.addDealSplitAction();
selectedProds.add(pw);
}
}
return null;
}

public PageReference addDealSplitAction(){
DealSplitWrapper dealSplit = new DealSplitWrapper(product);
dealSplits.add(dealSplit);

return null;
}

 

 

 

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

 

 

I want to throw an exception when the list size is more than 5. This code is not working

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

 

public PageReference addDealSplitAction(){

DealSplitWrapper dealSplit = new DealSplitWrapper(product);
try{
if(dealSplits.size()<6){
dealSplits.add(dealSplit);
throw new Exception('Test Common Exception'); // To throw if list size is greater than 5 ..not working
}
}catch(Exception ex) {
System.debug(ex.getMessage());
}
return null;
}

 

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

I have a requirement to have only 5 rows added to a list (dealsplit -  mentioned below).  here is the code . Ho can we implement it

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

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.addDealSplitAction();
selectedProds.add(pw);
}
}
return null;
}

public PageReference addDealSplitAction(){
DealSplitWrapper dealSplit = new DealSplitWrapper(product);
dealSplits.add(dealSplit);

return null;
}

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

 

thanks

I want to insert attachments as a popup in a VF page when a button is clicked.

Any ideas , suggestion how to acheive this

I have written a method in controller class to pass two ids in the URL to the next vf page ... but it is not going properly in the URL..

 

public pagereference upload()
{
Id so ;
Id oppId = ApexPages.CurrentPage().getParameters().get('OpId');
for(SOWrap sw :wrapper)
{
so = sw.SOID;
}
return new pagereference('/apex/DocumentUploader?Id=' +so+ '&OppId =' + oppId);

}

 

 

The URL it is passing is :

 

https://cs16.salesforce.com/apex/DocumentUploader?+OppId+=006f0000003aqzUAAQ&Id=a39f00000004IKtAAM

 

I am not able to use OppId in the new page, page not loading .. any help here

When I am redirecting from first VF to Second VF  , it is working fine, but when I am redirecting back(Second To First), it is not displying correct values.. how can I acheive this...

 

I want to set a defalut value of a picklist field in VF page.. Please suggest how to acheive?

There is custom object SO mapped to Opportunity . For every opportunity there are multiple SO .

I am displaying all the SO of an opportunity in an VF page and want to add attachements againgst specific SO records.

 

Controlelr class :

 

Inside COntroller Method - Adding the list in a wrapper

 

SOL = new List<SO__c>([select Id, Processing_Region__c, Company_Code__c, Opportunity__c, Account__c,Company_Name__c,Start_Date__c,Promo_Flyer__c,Parent_Company_Code__c,Pays__c from SO__c where Opportunity__c =: oppID]);

for(SO__c s :SOL)
{
SOWrap sw = new SOWrap();
sw.ProcessingRegion = s.Processing_Region__c;
sw.ParentCoCode = s.Parent_Company_Code__c;
sw.CompanyCode = s.Company_Code__c;
sw.CompanyName = s.Company_Name__c;
sw.Pays = s.Pays__c;
sw.SOID = s.Id;
wrapper.add(sw);
}

 

//Wrapper class inside the controller class

public class SOWrap
{
public String ProcessingRegion {get;set;}
Public String ParentCoCode{get;set;}
Public String CompanyCode{get;set;}
Public String CompanyName{get;set;}
Public Decimal Pays {get;set;}
Public String Product{get;set;}
public string SOID{get;set;}
}

 

On Click on add button on the VF page ...it calls the method upload from the controller :

 

public page reference upload()
{
Id oppId = ApexPages.CurrentPage().getParameters().get('OpId');
PageReference pr = new pagereference('/apex/DocumentUploader?OpId=' +oppId );
return pr;
}

 

Instead of opportunity ID i want to pass the specific SO id.. so that i can use it in next vf page ..

 

Any suggestions?

 

In a controller class i want to write a method to allow users to upload attachment.

Any suggestion.. what to have in the method?

I want to pass standard and custom object's record details from one vf page to another ..how can I acheive this in the controller class.

Any suggestions?

I am getting this error on a VF page :

 

This page is redirected from another controller class : The details are coming on the URL but on the page it is displaying error as :Page DetailController does not exist 

 

External Controller Class : Method :

 

public PageReference SaveChanges()

{
String OppId = ApexPages.currentPage().getParameters().get('Id');
Splits__c LitOrd = new Splits__c();
DSObj = new List<Splits__c>();
LitOrd.Opportunity__c= Opp.id ;
DSObj.add(LitOrd);
insert DSObj;
insert OppTeam;
PageReference pageRef = new PageReference('/apex/DetailController?Id='+opp.Id);
return pageRef;

}

 

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

 

VF page :

<apex:page controller="DetailController" tabstyle="Opportunity">
<apex:form >
<apex:pageBlock title="Region Details">
<apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">
<apex:column headerValue="Ident">
<apex:outputText value="{!wrapper.ident}"/>
</apex:column>
<apex:column headerValue="Region">
<apex:inputField value="{!wrapper.MSalesO.Region__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

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

 

Controller Class :

public class DetailController
{

public List<SOWrapper> wrappers {get; set;}

public static Integer addCount {get; set;}
private Integer nextIdent=0;

public DetailController()
{
wrappers=new List<SOWrapper>();
for (Integer idx=0; idx<5; idx++)
{
wrappers.add(new SOWrapper(nextIdent++));
}
}
public void addRows()
{
for (Integer idx=0; idx<addCount; idx++)
{
wrappers.add(new SOWrapper(nextIdent++));
}
}

public PageReference save()
{
List<Order__c> MSO=new List<Order__c>();
for (SOWrapper wrap : wrappers)
{
MSO.add(wrap.MSalesO);
}

insert MSO;

return new PageReference('/' + Schema.getGlobalDescribe().get('Order__c').getDescribe().getKeyPrefix() + '/o');
}

public PageReference SaveDS()

{
return null;
}
public class SOWrapper
{
public Order__c MSalesO {get; private set;}
public Integer ident {get; private set;}

public SOWrapper(Integer inIdent)
{
ident=inIdent;
MSalesO=new Order__c(Opportunity__c='006f0000003afa5' + ident);
}
}

}

I want to pass parameters for contact record in the url through a vf page .. Any idea how to pass .

For ex :  

https://cs15.salesforce.com/apex/SearchForm?contactId=003e000000Aplmn&employees=10 

 

When we pass employees  = 10 , the field should be populated with 10 on the search form... 

Please suggest

I want to extract ownerId and the user related details from Account , so writing the query :

 

SELECT Id,OwnerId,OwnerId__r.DefaultDivision FROM Account where Id in (....

 

Its giving error : 

Didn't understand relationship 'OwnerId__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

 

Please suggest.

I have a class which is used in opportunity insertion ... but when I am running it, it is giving exception error (highlighted)

-----------

 

public static void OppInsert(Opportunity[] newOpportunity)
{
String Record_Type = '0145000000000fdAAA'
TestWeek__c TestWeek;
try
{

TestWeek = [select Wk_Nmbr__c, Year__c from TestWeek__c where Start_Date__c <= TODAY and End_Date__c >= TODAY]; // This is returniong values 

}
catch(System.QueryException e)
{
trigger.new[0].addError(e);
return;
}
if(TestWeek !=null)
{
// loop thru the newly created opportunities
for (Opportunity opportunityLoop : newOpportunity)
{
if (opportunityLoop.RecordTypeId == Record_Type.substring(0, Record_Type.length()-3))
{

 

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

 

It is firing for other record types of opportunity and giving the exceprion on opportunity insertion as  : 

FIELD_CUSTOM_VALIDATION_EXCEPTION, List has no rows for assignment to SObject: []

 

Any suggestions here ?

I am trying to send the input field value to the controller class from VF page and getting error inside the action funciton method :

 

Here I want to pass three parameters to the controller class :

prodcnt, dealcnt and obj.dsObj.NAS_QC__c ... i am getting the error :

 

Error: <apex:actionFunction> may not be used within an iterable component. You can use <apex:param> to define parameters for the function and pass iteration-specific values via the parameters.

 

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

 

<apex:variable var="prodcnt" value="{!0}" />  // To the get the row number of the product table
<apex:pageBlockTable value="{!selectedProducts}" var="product" id="dealSplitsPBTable">
<apex:column >
<div class="columnHeaderBox">
{!product.product.ProductCode}&nbsp; - &nbsp; {!product.product.Name}
</div>
<apex:variable var="dealcnt" value="{!0}" /> // To get the row number of the deal table
<apex:pageBlockTable value="{!product.dealSplits}" var="obj">

<apex:column headerValue="Delete?">
<apex:inputcheckbox value="{!obj.isSelected}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>

<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.NAS_QC__c}" onchange="ChangeTheManager(this, prodcnt, dealcnt);" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.NAS_QC__c}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionFunction name ="setManager" action ="{!selectManager}" rerender = "dealSplitsPBTable">
<apex:param value = "{!obj.dsObj.NAS_QC__c}" assignTo = "{!currentUserId}" />
<apex:param value = "{!prodcnt}" assignTo = "{!currentProdIndex}" />
<apex:param value = "{!dealcnt}" assignTo = "{!currentDealIndex}" />
</apex:actionFunction>
</apex:column>

 

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

I am getting this error when I am selecting two items to be inserted from a list . This is working fine when I am inserting a single record, but giving error when multiple items are selected.

 

Please help here :

 

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

 

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.insertFirstProdAndDealSplit();
selectedProds.add(pw);
}
}

//------------------------------------- Opportunity Line Item Insert
String OppId = ApexPages.currentPage().getParameters().get('Id');
For (ProductWrapper p : selectedProds)
{
OpportunityLineItem oppItem = new OpportunityLineItem();
oppItem.OpportunityId = OppId ;
oppItem.PriceBookEntryId = p.product.Id;
oppItem.Roll_Call__c = p.summaryRecord.totalRollCall;
oppItem.UK_Setup__c = p.summaryRecord.totalSetup;
oppItem.ARC__c = p.summaryRecord.totalARC;
mapOppLineItems.put(p, oppItem);
p.firstDealSplit.dsObj.NAS_Opportunity__c = OppId;
lstDealSplitsFirstInsert.add(p.firstDealSplit.dsObj);
}

if(mapOppLineItems.size()>0)
{
Insert mapOppLineItems.values();
}
if(lstDealSplitsFirstInsert.size()>0)
{
Insert lstDealSplitsFirstInsert; /// Giving error on this line of the code
}
return null;
}

 

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

I want to make the first row of a list non editable  ..but it has to display  and update value automatically through a logic.. While other rows will be editable.

 

I want to restrict the first row of the dealSplits list(given below) as non- editable while the other rows as editable

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

 

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.addDealSplitAction();
selectedProds.add(pw);
}
}
return null;
}

public PageReference addDealSplitAction(){
DealSplitWrapper dealSplit = new DealSplitWrapper(product);
dealSplits.add(dealSplit);

return null;
}

 

 

 

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

 

 

I want to throw an exception when the list size is more than 5. This code is not working

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

 

public PageReference addDealSplitAction(){

DealSplitWrapper dealSplit = new DealSplitWrapper(product);
try{
if(dealSplits.size()<6){
dealSplits.add(dealSplit);
throw new Exception('Test Common Exception'); // To throw if list size is greater than 5 ..not working
}
}catch(Exception ex) {
System.debug(ex.getMessage());
}
return null;
}

 

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

I have a requirement to have only 5 rows added to a list (dealsplit -  mentioned below).  here is the code . Ho can we implement it

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

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.addDealSplitAction();
selectedProds.add(pw);
}
}
return null;
}

public PageReference addDealSplitAction(){
DealSplitWrapper dealSplit = new DealSplitWrapper(product);
dealSplits.add(dealSplit);

return null;
}

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

 

thanks

I have written a method in controller class to pass two ids in the URL to the next vf page ... but it is not going properly in the URL..

 

public pagereference upload()
{
Id so ;
Id oppId = ApexPages.CurrentPage().getParameters().get('OpId');
for(SOWrap sw :wrapper)
{
so = sw.SOID;
}
return new pagereference('/apex/DocumentUploader?Id=' +so+ '&OppId =' + oppId);

}

 

 

The URL it is passing is :

 

https://cs16.salesforce.com/apex/DocumentUploader?+OppId+=006f0000003aqzUAAQ&Id=a39f00000004IKtAAM

 

I am not able to use OppId in the new page, page not loading .. any help here

When I am redirecting from first VF to Second VF  , it is working fine, but when I am redirecting back(Second To First), it is not displying correct values.. how can I acheive this...

 

There is custom object SO mapped to Opportunity . For every opportunity there are multiple SO .

I am displaying all the SO of an opportunity in an VF page and want to add attachements againgst specific SO records.

 

Controlelr class :

 

Inside COntroller Method - Adding the list in a wrapper

 

SOL = new List<SO__c>([select Id, Processing_Region__c, Company_Code__c, Opportunity__c, Account__c,Company_Name__c,Start_Date__c,Promo_Flyer__c,Parent_Company_Code__c,Pays__c from SO__c where Opportunity__c =: oppID]);

for(SO__c s :SOL)
{
SOWrap sw = new SOWrap();
sw.ProcessingRegion = s.Processing_Region__c;
sw.ParentCoCode = s.Parent_Company_Code__c;
sw.CompanyCode = s.Company_Code__c;
sw.CompanyName = s.Company_Name__c;
sw.Pays = s.Pays__c;
sw.SOID = s.Id;
wrapper.add(sw);
}

 

//Wrapper class inside the controller class

public class SOWrap
{
public String ProcessingRegion {get;set;}
Public String ParentCoCode{get;set;}
Public String CompanyCode{get;set;}
Public String CompanyName{get;set;}
Public Decimal Pays {get;set;}
Public String Product{get;set;}
public string SOID{get;set;}
}

 

On Click on add button on the VF page ...it calls the method upload from the controller :

 

public page reference upload()
{
Id oppId = ApexPages.CurrentPage().getParameters().get('OpId');
PageReference pr = new pagereference('/apex/DocumentUploader?OpId=' +oppId );
return pr;
}

 

Instead of opportunity ID i want to pass the specific SO id.. so that i can use it in next vf page ..

 

Any suggestions?

 

I am getting this error on a VF page :

 

This page is redirected from another controller class : The details are coming on the URL but on the page it is displaying error as :Page DetailController does not exist 

 

External Controller Class : Method :

 

public PageReference SaveChanges()

{
String OppId = ApexPages.currentPage().getParameters().get('Id');
Splits__c LitOrd = new Splits__c();
DSObj = new List<Splits__c>();
LitOrd.Opportunity__c= Opp.id ;
DSObj.add(LitOrd);
insert DSObj;
insert OppTeam;
PageReference pageRef = new PageReference('/apex/DetailController?Id='+opp.Id);
return pageRef;

}

 

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

 

VF page :

<apex:page controller="DetailController" tabstyle="Opportunity">
<apex:form >
<apex:pageBlock title="Region Details">
<apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">
<apex:column headerValue="Ident">
<apex:outputText value="{!wrapper.ident}"/>
</apex:column>
<apex:column headerValue="Region">
<apex:inputField value="{!wrapper.MSalesO.Region__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

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

 

Controller Class :

public class DetailController
{

public List<SOWrapper> wrappers {get; set;}

public static Integer addCount {get; set;}
private Integer nextIdent=0;

public DetailController()
{
wrappers=new List<SOWrapper>();
for (Integer idx=0; idx<5; idx++)
{
wrappers.add(new SOWrapper(nextIdent++));
}
}
public void addRows()
{
for (Integer idx=0; idx<addCount; idx++)
{
wrappers.add(new SOWrapper(nextIdent++));
}
}

public PageReference save()
{
List<Order__c> MSO=new List<Order__c>();
for (SOWrapper wrap : wrappers)
{
MSO.add(wrap.MSalesO);
}

insert MSO;

return new PageReference('/' + Schema.getGlobalDescribe().get('Order__c').getDescribe().getKeyPrefix() + '/o');
}

public PageReference SaveDS()

{
return null;
}
public class SOWrapper
{
public Order__c MSalesO {get; private set;}
public Integer ident {get; private set;}

public SOWrapper(Integer inIdent)
{
ident=inIdent;
MSalesO=new Order__c(Opportunity__c='006f0000003afa5' + ident);
}
}

}

I want to extract ownerId and the user related details from Account , so writing the query :

 

SELECT Id,OwnerId,OwnerId__r.DefaultDivision FROM Account where Id in (....

 

Its giving error : 

Didn't understand relationship 'OwnerId__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

 

Please suggest.

I have a class which is used in opportunity insertion ... but when I am running it, it is giving exception error (highlighted)

-----------

 

public static void OppInsert(Opportunity[] newOpportunity)
{
String Record_Type = '0145000000000fdAAA'
TestWeek__c TestWeek;
try
{

TestWeek = [select Wk_Nmbr__c, Year__c from TestWeek__c where Start_Date__c <= TODAY and End_Date__c >= TODAY]; // This is returniong values 

}
catch(System.QueryException e)
{
trigger.new[0].addError(e);
return;
}
if(TestWeek !=null)
{
// loop thru the newly created opportunities
for (Opportunity opportunityLoop : newOpportunity)
{
if (opportunityLoop.RecordTypeId == Record_Type.substring(0, Record_Type.length()-3))
{

 

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

 

It is firing for other record types of opportunity and giving the exceprion on opportunity insertion as  : 

FIELD_CUSTOM_VALIDATION_EXCEPTION, List has no rows for assignment to SObject: []

 

Any suggestions here ?