• firechimp
  • NEWBIE
  • 275 Points
  • Member since 2013
  • firechimp


  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 76
    Replies
Hi, We are just getting started with SalesForce, and I am a developer proficient in .Net & SQL, I am having a hard time finding examples for updating child records of a custom object when it has it's status updated. I believe a trigger are what I am looking for, but the examples I am finding are all very generic. I would like some help in how to reference current the record's ID and how to perform an update of related child records. The two paradiagms I am familiar with are vb.net recordsets & SQL updates. I am literally starting with nothing: trigger trDeleteRelatedRecipients on Report_Package__c (after update) { } Any help would be greatly appreciated!

Hello Everybody ,

 

My requirement is as follows .. plz go through and help me to solve this.

 

--->  I am having one leave object with custom fields leave_from_date and leave_to_Date of Date type .

 

--->  In the trigger which is on other object , i am  have a Set collection of Dates i.e; Set<date>

 

---->  I need to get all leave records using this set collection.

 

Example -- I am having the leave recpord with  leave_from_date = 3-10-2013 and leave_to_ date = 05-10-2013 . And in the Set collection the available dates are (02-10-2013 and 04-10- 2013)

 

then What is the SOQL to get the leave record using this set collection..?

 

Thanx in advance

 

 

I'm trying to use a list o images as options on my <apex:selectRadio>. However, the SelectOption constructor accepts only String as value.

Is there a way to achieve this on Visualforce, or is there really a limitation on this?

Hi there,

 

I am attempting to make it so that some of my PageblockTable rows will remain highlighted after clicking, I have some code, but when I try and insert it into my visualforce page, when I test it out, my Tabbed Visualforce page loses its ability to navigate between the tabs. I know that it works as I have deleted the first few tabs (making the FactFinder object tab the first).

 

I have highlighted in red the code that I have added in which to highlight the rows. I am pretty sure that it is the <apex:includescript tag which affects my tab navigation.

 

<apex:page standardController="Account" showHeader="true" 
tabStyle="account"  >

 <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"/>
    <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/ui-lightness/jquery-ui.css"/>
    <script>
        function highlightElem(elem){
            $('tr').removeClass('ui-state-highlight');
            $(elem).addClass('ui-state-highlight');
        }
    </script>





<style>
.activeTab {background-color: #892034; color:White;
background-image:none}
.inactiveTab { background-color: #00204E; color:white;
background-image:none}
</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail inlineEdit="True" relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying contacts from the {!account.name} account.
Click a contact's name to view his or her details.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:form >
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4"
border="1">
<apex:column >
<apex:commandLink rerender="detail">
{!contact.Name}
<apex:param name="cid" value="{!contact.id}"/>
</apex:commandLink>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="detail">
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="True" inlineEdit="True"
title="false"/>
</apex:outputPanel>
</apex:tab>


<apex:tab label="Fact Finder" rendered="{!$ObjectType.Fact_Finder__c.Accessible}" name="FactFinder" id="tabFactFinder" >

<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying Fact Finders from the {!account.name} account.Click a Fact Finder to view its details.
</apex:pageBlock>
<apex:pageBlock title="Fact Finder" >
<apex:form >
<apex:outputlink value="/a0L/e?CF00N90000007AjAp={!Account.name}&CF00N90000007AjAp_lkid=                                                                                                                           {!Account.id}">Create New Fact Finder</apex:outputlink> 
<apex:pageBlockTable value="{!account.Fact_Finder__r}" var="Fac" cellPadding="4"  border="4"  onRowClick="highlightElem(this)" >
<apex:column headerValue="Fact Finder" >
<apex:commandLink rerender="details"> {!Fac.Name}
<apex:param name="Fid" value="{!Fac.id}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!Fac.Employed_Since__c}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="details">
<apex:detail subject="{!$CurrentPage.parameters.Fid}" relatedList="False" inlineEdit="True" title="false"/>
</apex:outputPanel>
</apex:tab>


 Please help me find a solution to my problem or perhaps an alternative way in which to highlight the rows in my pageblocktable sections.

 

Thank you so much,

 

Mikie

 

P.S. It may help, the rows that I hope to highlight are links which re-render the bottom half of the page, that is why I need the rows highlighted so that the users can tell which record they have last selected.

Hello!

 

I am trying to match commissions based on incentives, and divisions associated.  I have tried the following trigger but am fairly new to apex code when it comes to larger statements such as this one.  Can anyone help me out?  Here is my code

 

trigger CreateCommission on Commissionable_User__c (after insert ) {

for (Commissionable_User__c CU: trigger.new){

  Incentive_Plan__c[] InP = [Select Id, Spiff__c, of_Commissionable_Price__c, Division__c From Incentive_Plan__c Where Division__c = :CU.Commissionable_User_Division__c limit 1 ];
   Incentive_Product__c[] IPa=[Select Id,Intradivisional_Percentage__c,Interdivisional_Percentage__c,Division__c ,Incentive_Plan__c From Incentive_Product__c Where Product__c= :CU.ProductId__c  limit 1 ];
   
  If(IPa.Id<>CU.ProductId__c&&InP.Division__c==CU.Commissionable_User_Division__c){
     
    
  Commission__c commission = new Commission__c();
  commission.Commission_User_ID__c = CU.Id;
  commission.earn_date__c =date.today();
  commission.Incentive_Plan__c = InP[0].Id;
  commission.Percent__c=InP[0].of_Commissionable_Price__c;
  commission.CommissionSpiff__c=InP[0].Spiff__c;
   
   ||
   
   If(IPa.Id==CU.ProductId__c&&IPa.Division__c<>CU.Commissionable_User_Division__c){
   
   Commission__c commission = new Commission__c();
  commission.Commission_User_ID__c = CU.Id;
  commission.earn_date__c =date.today();
  commission.Incentive_Plan__c = InP[0].Id;
  commission.Percent__c=InP[0].Interdivisional_Percentage__c;
  commission.CommissionSpiff__c=InP[0].Spiff__c;
  
  ||
  
   If(IPa.Id==CU.ProductId__c&&IPa.Division__c==CU.Commissionable_User_Division__c){
   
    Commission__c commission = new Commission__c();
  commission.Commission_User_ID__c = CU.Id;
  commission.earn_date__c =date.today();
  commission.Incentive_Plan__c = InP[0].Id;
  commission.Percent__c=InP[0].Intradivisional_Percentage__c;
  commission.CommissionSpiff__c=InP[0].Spiff__c;
   
   else
   
   Commission__c commission = new Commission__c();
  commission.Commission_User_ID__c = CU.Id;
  commission.earn_date__c =date.today();
  commission.Incentive_Plan__c = InP[0].Id;
  commission.Percent__c=InP[0].of_Commissionable_Price__c;
  commission.CommissionSpiff__c=InP[0].Spiff__c;
  
  insert commission;
    
   
}
}






}

 

 

Dear All,

 

I am using the <chatter:newsfeed/> in Visualforce page and its working Good

 

Requesting for help in

 

1     redirecting the "Name" links (in chatter:newsfeed) to custom visualforce page

 

OR

 

2    removing those hyperlink options (user should not be redirected to profile in standard page)

 

 

Please Help

I have a VF page referencing a controller.  In the page I have a <apex:commandLink> component where I'm trying to use the action attribute to execute a controller method and the onclick attribute to execute some JavaScript (a jquery dialogue that shows a video) - simultaneously.  The purpose:  to track link clicks and store a record in a custom object for reporting purposes.  When I put both attributes (action & onclick) in the <apex:commandLink> component, only the JavaScript executes.  If I take out only the JavaScript the action/controller method works fine and a record is created in my custom object.  Any thoughts as to a workaround or cause?  Thank you in advance!

 

Here's my code

 

VF Page Code:

<apex:pagecontroller="LinkInformationController">

  <script>

  var content2;

var counter2 = 0;

function showDialog(url){

  $ = jQuery.noConflict();

   

  if (counter2 !== 0) {

        content2.appendTo("body");

    }

    $("#divId").dialog({

          autoOpen: false,

          modal: true,

          height: 375,

          width: 500,

          close: function () {

          $(this).dialog('destroy');

                        content2 = $("#divId").remove();

                        counter2 = counter2 +1;

        }

      });

  $("#divId").html('<iframe id="modalIframeId" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="auto" />').dialog("open");

  $("#modalIframeId").attr("src",url);

  return false;

}

  </script>

  <apex:includeScriptvalue="{!$Resource.jquery19}"/>

  <apex:includeScriptvalue="{!$Resource.jquery19ui}"/>

<apex:pageBlocktitle="Training Videos">

        <apex:pageBlockSectiontitle="Click on the link">

<apex:form>

  <table width="100%">

  <tr>

  <td class="lnks">0)<apex:commandLink value="Test Video" action="{!myMethod}" onclick="return showDialog('URL to Video')">

<apex:paramname="myParam"value="Video 1"/>

</apex:commandLink></td>

  </tr>

</table>

</apex:form>

</apex:pageBlockSection>

</apex:pageBlock>

</apex:page>

 

Controller Code:

 

public class LinkInformationController {

 

public LinkInformationController(){

 

}

 

public void myMethod() 

{

  string myParam = apexpages.currentpage().getparameters().get('myParam');

  Link_Information__c newLI = newLink_Information__c

(

Date_Link_Clicked__c = date.today(),

Link_User_Id__c = UserInfo.getUserId(),

Link_Name__c = myParam,

Link_User_Name__c= UserInfo.getName()

);

insert newLI;

}

}

This code works just fine for individual record updates, but I'm trying to get it to work for a mass upload of data.  Any insights?

 

trigger TRG_SurveyFeedback_UpdateParentAccounts on Survey_Feedback__c (before insert, before update) {

	Set<ID> setAcctId = new Set<ID>();						//Holds the Account Id from the Survey Feedback			
	List<Account> currentAccount = new List<Account>();		//Holds Related Account on Survey Feedback
	List<Account> parentAccount = new List<Account>();		//Holds list of Parent Accounts for Related Account
	String relAcctId = '';									//Related Account Id
	Integer topAccount = 0;									//Holds number of top-most account in parentAccount list
	Boolean boolParentAssnd = false;						//Is Parent Account Assigned yet?


	for (Survey_Feedback__c sfb: Trigger.new){
        setAcctId.add(sfb.Account__c);
	}
	
	currentAccount = [SELECT Id, Name FROM Account WHERE Id in :setAcctId];
	relAcctId = currentAccount[0].Id; 
	
	//Get the list of Accounts in the hierarchy for relAcctId.
	parentAccount = getAccountHierarchy(relAcctId);
	
	/**
		getAccountHeirarchy(string)
		
		@description
		The getAccountHierarchy function, which requires an accountId as a paramenter,
		fetches the list of accounts appearing above the accountId in he hierarchy.
		It returns a list (accList) that contains the following information for the Account:
		
		Id, Name, ParentId, and Location_Type__c	
	*/
	List<Account> getAccountHierarchy(String accountId){
		
		List<Account> accList = new List<Account>();		//Holds list of accounts above accountId
        Boolean isTop = false;								//Is this the top-most account?
        
        while (!isTop){
            Account a = [SELECT Id, Name, ParentId, Location_Type__c FROM Account WHERE Id =: accountId limit 1];
            if (a.ParentId != null){
            	accountId = a.ParentId;
            }else{
            	isTop = true;
            }
            accList.add(a);
        }
        return accList;
	}
	
	//Get the index of the top-most account in parentAccount
	topAccount = parentAccount.size() - 1;
	
	for(Survey_Feedback__c sfb: Trigger.new){
	
		//Note: start with index 1, because index 0 is the Related Account.
		for(Integer i = 1; i < parentAccount.size(); i++){
	
			if(parentAccount[i].Location_Type__c == 'Parent' && boolParentAssnd == false){
				sfb.Parent_Account__c = parentAccount[i].Id;
				boolParentAssnd = true;
			}
		}
		if(parentAccount[topAccount].Location_Type__c == 'Ultimate Parent' && parentAccount[topAccount].Id !=  relAcctId){
			sfb.Ultimate_Parent_Account__c = parentAccount[topAccount].Id;
		}		
	}
}

 

Hi all,

The updated SDK rules, but I am having a little issue getting the iOS view controller to initalise my storyboard after the login process has completed (in my AppDelegate), I am trying to just point to my storyboard instead of the rootview provided in the template.

 

Please see my AppDelegate code bellow:

- (void)initializeAppViewState
{
    self.window.rootViewController = [[InitialViewController alloc] initWithNibName:nil bundle:nil];
    [self.window makeKeyAndVisible];
}

- (void)setupRootViewController
{
    NSBundle *bundle = [NSBundle mainBundle];
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"StoryboardiPhone" bundle:bundle];
    RootViewController *rootView = (RootViewController*)[sb instantiateViewControllerWithIdentifier:@"mainPage"];
    self.window.rootViewController = rootView;
}

 Everything else in the AppDelegate remains the same, the two classes referenced here are:

#import "InitialViewController.h"

@implementation InitialViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        NSLog(@"HERE: InitialViewController");
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

 

#import "RootViewController.h"

@implementation RootViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        NSLog(@"HERE: RootViewController");
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

 This should direct them into the storyboard with the rootViewController, which should provide a 'UITabBarController' from here they will be able to click a tab to display the original 'UITableViewController' which will return some records from salesforce for display.

 

The ERROR that I recieve is:

2013-09-28 11:15:01.738 Example 1[340:a0b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "yRf-rA-8Y5-view-2PQ-Tj-Ddg" nib but didn't get a UITableView.'

 It appear that the rootViewController is expecting a UITableViewController, but I don't understand why this would be or how to get around it.

Has anyone successfuly redirected to a storyboard from the completion of the login using the template provided? If so how did you get around this issue?

 

Hi All,

I have created vf page which will be rendered as pdf..
I am getting problem in handling table Rows, How to split table as table moves to next page.
I tried with many stye/css but couldnt solve the issue.. Please help
<apex:page standardController="Client_Invoice__c" extensions="arcinvoicepdf" sidebar="false"  cache="false" readOnly="true" renderAs="pdf" docType="html-5.0">


<apex:form >
<apex:pageBlock >

<apex:dataTable value="{!Client_Invoice__c.Attendance_Record__r}" var="a" border="1" cellpadding="5"  styleClass="table" width="15.92cm" style="text-align:center; line-height: 11pt; font-size:11pt; border-spacing: 0;" columns="3">

      <apex:column >
      
        <apex:facet name="header">Name</apex:facet> 
        <apex:outputText >{!a.Client_Attendance_Record__r.Contact__r.name}</apex:outputText> 
            
      </apex:column>
      
      
      <apex:column >
      
        <apex:facet name="header">Description </apex:facet> 
        <apex:outputText >{!a.Description__c }</apex:outputText>
        
      </apex:column>
      
      <apex:column >
      
        <apex:facet name="header">Cost </apex:facet>
        <apex:outputText >{!a.Cost__c}</apex:outputText>
      </apex:column> 

</apex:dataTable>

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

User-added image

from image..once table extends to 2nd page , the last border is breaking..Please help me to manage this table wthout breaking border line..

I have this trigger which will update a child record with values from the parent.

 

For some reason I'm getting a "variable does not exist : trigger" error at the line which I underlined : 

 

trigger ChildTriggerToUpdateChildWithParentValues on Grandchild__c (before insert) {
  

   // Get a list of all Parent Ids
   Set<Id> parentIds = new Set<Id>();
    for (child__c chld : trigger.new) {
      parentIds.add(chld.MyParent__c);
   }

   // Get a map of all Parents with Grandparent field information
Map<Id, Parent__c> parentsById = new Map<Id, Parent__c>();
parentsById.putAll([SELECT Id, MyField2__c FROM Parent__c WHERE Id IN :parentIds]);

 for(child__c chld : trigger.new()){ 
      chld.MyField__c=parentsById.get(chld.MyParent__c).MyField2__c;
      //chld.chldfield2__c=parentsById.get(chld.MyParent__c).MyParentfield2__c;
   }

}

 

Any idea what is causing this ? 

 

Thank you.

  • October 24, 2013
  • Like
  • 0

Hi

 

I have an actionsupport within an inputtext and the entire page is getting refreshed even if I leave out the rerender attribute. What is causing this? The net effect is that the focus is been set to the first control at the top of the page. How do I stop the entire page from ben refreshed?

 

Many thanks

Ross

 

I am trying to override the tab of a custom object to a Visualforce. I am using a Standard Set Controller in the page. All the documentation I've found said it is possible to override a tab with a Standard Set Controller, but the page doesn't show up in the Visualforce page drop down. Is there something I'm missing as to why it's not showing up?

 

Visualforce page code:

 

<apex:page standardController="SVMXC__Installed_Product__c" recordSetVar="installedproducts" extensions="PortalTabRedirectController" action="{!redirect}">
    <apex:enhancedList type="SVMXC__Installed_Product__c" height="700" rowsPerPage="50" customizable="false"/>
</apex:page>

Extension code, in case that's relevant - I purposely wrote it to be not specific to any object, as we are trying to override the tab for multiple objects in the same way. Basically we want the standard tab to show for all users except for our Customer Portal users, who instead will only see the enhancedList just showing all the records, instead of the Recently Viewed list.

 

public with sharing class PortalTabRedirectController {
    public String keyPrefix;
    
    public PortalTabRedirectController(ApexPages.StandardSetController stsc) {
        SObject obj = stsc.getRecord();
        Schema.SObjectType objType = obj.getSObjectType();
        Schema.DescribeSobjectResult result = objType.getDescribe();
        keyPrefix = result.getKeyPrefix();
        system.debug('Variable keyPrefix: ' + keyPrefix);
    }
    
    public String getKeyPrefix() {
        return keyPrefix;
    }
    
    public void setKeyPrefix(String keyPrefix) {
        this.keyPrefix = keyPrefix;
    }
    
    public PageReference redirect() {
        Profile p = [SELECT Name FROM Profile WHERE Id = :UserInfo.getProfileId()];
        system.debug('Profile Name: ' + p.Name);
        
        String tabURL = '/' + keyPrefix + '/o';
        system.debug('Variable tabURL: ' + tabURL);
        
        if('Customer Portal'.equals(p.Name)) {
            return null;
        } else {
            PageReference pageRef = new PageReference(tabURL);
            pageRef.setRedirect(true);
            return pageRef;
        }
    }
}

 Any thoughts would be greatly appreciated!

I have some input text and input fields and a save command button inside a <div> tag in my VF page. This div is made visible as a pop up on a button click(GoToPage button) and some fields are populated already while the pop up is displayed . When I click the Save button in the pop up is where the problem arises. The values in the pop up if changed by the user are not getting saved  even though the prepopulated field is getting saved right.

 

Thanks in Advance!!

  • October 24, 2013
  • Like
  • 0
Hi, We are just getting started with SalesForce, and I am a developer proficient in .Net & SQL, I am having a hard time finding examples for updating child records of a custom object when it has it's status updated. I believe a trigger are what I am looking for, but the examples I am finding are all very generic. I would like some help in how to reference current the record's ID and how to perform an update of related child records. The two paradiagms I am familiar with are vb.net recordsets & SQL updates. I am literally starting with nothing: trigger trDeleteRelatedRecipients on Report_Package__c (after update) { } Any help would be greatly appreciated!

Hello,

 

I developped a visualforce chart and sometimes, datas are garbled.

 

Per example, a 10 is displayed as a 11 :

http://nsa33.casimages.com/img/2013/10/21/131021051400896700.png

 

I tried to change the data type to barSeries and it doesn't work.

 

I tried to change the chart's height from 600px to 950px and it doesn't work and I modified chart's options but it doesn't work too.

 

This is my code :

<apex:chart height="550px" width="100%" data="{!datas}" rendered="{!chartVisible}" resizable="true">
    	<apex:legend position="right"/>
        <apex:axis type="Numeric" position="left" fields="data1" minimum="0" maximum="{!maxNbParticipants}" title="Number of participants" grid="true"/>
        <apex:axis type="Category" position="bottom" fields="name" title="">
            <apex:chartLabel rotate="315"/>
        </apex:axis>
        <apex:lineSeries title="{!mapNames[0]}" fill="true" axis="left" xField="name" yField="data1" markerType="circle" markerSize="4" markerFill="#A44065" strokeColor="#A44065" />
        <apex:lineSeries title="{!mapNames[1]}" fill="false" axis="left" xField="name" yField="data2" markerType="circle" markerSize="4" markerFill="#4051A4" strokeColor="#4051A4" />
        <apex:lineSeries title="{!mapNames[2]}" fill="false" axis="left" xField="name" yField="data3" markerType="circle" markerSize="4" markerFill="#5EA440" strokeColor="#5EA440" />
    </apex:chart>

 

 

Why data are garbled please?

 

Thanks for your answers.

Best regards

HI,

          i want to uplad a csv file into my custom object,, through visualforce page

 after upload is done i want display the csv file records in same visual force page only can any one suggest me how it is possible.

Hi there,

 

when i click a button it will generate the PDF, it is generating pdf,but the problem is I am getting one extra empty page.

content is only 2 page but I am getting one extra  empty page , how to avoid that extra empty page .

 

any an ideas  ?

 

 

Thank you,

Hi,

 

      I have plan to pass the list variable into url.

 

Ex: List<Id> ids = new List<Id>();

 

Ids have some list of Ids.

 

public PageReference method(){

       PageReference pr = new PageReference('/VFPage?IdList='+ids);

       return pr;

}

 

can I use like this. And Can I use these list variable in VFPage page.

 

Regards

Venkat

I'm getting an odd error when trying to set a value in a map from a pageBlockTable.  Here's my Map:

 

prodList = *select some PricebookEntry records*

for(PricebookEntry pe : prodList){
  prodQty.put(pe, 0);
}

 

So I'm querying PricebookEntry records and then creating a map where the PBE is the key and an integer is the value.  This is so I can assign the number of rows of each PricebookEntry that I want.  This is the pageBlockTable I've written:

 

<apex:pageBlockTable value="{!prodQty}" var="p" columns="6">
  <apex:column headerValue="Quantity">
    <apex:inputText value="{!prodQty[p]}" />
  </apex:column>
  <apex:column headerValue="Product Name" value="{!p.Product2.Name}" />
  <apex:column headerValue="Product Code" value="{!p.Product2.ProductCode}" />
  <apex:column headerValue="Product Family" value="{!p.Product2.Family}" />
  <apex:column headerValue="Currency" value="{!p.CurrencyIsoCode}" />
  <apex:column headerValue="Requires Sub Group" value="{!p.Product2.Requires_Sub_Group__c}" />
</apex:pageBlockTable>

 Which displays the table nicely.  The first column is an input text field where I can enter the number of each row I want (They're all defaulted to zero, as per the Map initialisation code) and the rest of the columns display the specified PricebookEntry field.

 

The problem comes when the user tries to progress.  After entering the values they want, they press a "Select" Command Button and this returns errors like this:

 

Value '01uXXXXXXXXXXXXXXX' cannot be converted from core.apexpages.el.adapters.SObjectELAdapter to common.apex.runtime.SObjectRow 

Where the Id is a PricebookEntry Id - this error is repeated for every PricebookEntry that I display in the table.

 

The error is not related to the work I'm doing when the user clicks the Select - even if I call an empty method when the user clicks this button, this error still displays.  It's something to do with the inputText column in the table, ie

<apex:column headerValue="Quantity">
  <apex:inputText value="{!prodQty[p]}" />
</apex:column>

 I know this because the error doesn't display if I don't have this column in my table.

 

I'm sure I've done something like this in the past at a previous company but I can't get it working this time.  All I want to do is update the value assigned to the relevant PricebookEntry's row in the map so I know how many of each row to create.  I've never encountered this error before and it doesn't show up in debug logs so I'm stumped.  Does anyone know what I'm doing wrong?

 

Thanks

HI, I am having invoices object in that field called Balance due when i enter amount in that field and click on save , at that time the record have to move from invoices object to amount object how can i achieve this.

Can we have one component have pageblock section on other component to be rendered

ie. for eg. i have 2 components in a page..

1st with all links -- Account,Contact 2nd with all page block section -- Account section, contact section

If user clicks on Account link ... only account section from 2nd component should be rendered If user clicks on Contact link ... only account section from 2nd component should be rendered

This is what i have tried so far

 

Component code:-

<apex:component ><apex:commandLink value="" reRender="opCustomerDetails">CUSTOMER DETAILS</apex:commandLink><br/><apex:commandLink value="" reRender="opContactDetails">CONTACT DETAILS</apex:commandLink><br/></apex:component>

 

Page Code:-

 

<apex:page extensions="TestPageClass" standardController="Application__c" ><table width="100%" class="mainContentTable"><tr><td width="50%" ><c:OAOASubmissionForms /></td><td width="50%" ><apex:outputPanel id="opCustomerDetails"><apex:pageBlock id="pbCustomerDetails"><apex:outputLabel value="Legal Name of Customer(in English)" /><apex:inputField value="{!account.Name}"/></apex:pageBlock></apex:outputPanel><apex:outputPanel id="opContactDetails">
<apex:pageBlock id="pbContactdetails">
<apex:pageBlockSection columns="1" id="pbAddr1" title="Address1">
    <apex:inputField value="{!applicationaddress1.Contact_Person__c}"/>
    <apex:inputField value="{!applicationaddress1.Contact_Person_Title__c}"/>
    <apex:inputField value="{!applicationaddress1.Address__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1" id="pbAddr2" title="Address2">
    <apex:inputField value="{!applicationaddress2.Contact_Person__c}"/>
    <apex:inputField value="{!applicationaddress2.Contact_Person_Title__c}"/>
    <apex:inputField value="{!applicationaddress2.Address__c}"/>
</apex:pageBlockSection>
</apex:pageBlock></apex:outputPanel></td></tr></table></apex:page>

 

Apex Class Code:-

public with sharing class TestPageClass{
public string applicationId {get;set;}

public Account account{get;set;}
public Application__c application{get; set;}
public Application_Address__c applicationaddress1{get;set;}
public Application_Address__c applicationaddress2{get;set;}


public TestPageClass(ApexPages.StandardController stdCtrl) 
{
    this.application=(Application__c)stdCtrl.getRecord();

    account=[   SELECT Id,Name                            
                FROM Account                             
                WHERE Id= '01Ii0000000tP5Y'];
    if(application != null && application.Id != null)
    {        
        this.application = [SELECT Id, Name, Accept_T_C__c
                    FROM Application__c
                    WHERE Id = : application.Id];

        this.applicationaddress1 =[SELECT Type__c, Name, Contact_Person__c, Contact_Person_Title__c,Application__c, Address__c 
                                    From Application_Address__c
                                    WHERE Application__c = : this.application.id
                                    AND Type__c = 'Address1' LIMIT 1]; 

        this.applicationaddress2 =[SELECT Type__c, Name, Contact_Person__c, Contact_Person_Title__c,Application__c, Address__c 
                                    From Application_Address__c
                                    WHERE Application__c = : this.application.id
                                    AND Type__c = 'Address2' LIMIT 1];
    }
}}

 I want to show the customer output panel when customer Details in component is clicked. Over here i have just used 1 component and rest all details are in the page.

 

I have some batchable apex, in the execute() method, udpates are done to pricebookentry.

 

I'm getting a weird mixed DML error.  Originally I had pricebookentry and a custom table updated in the execute() but to be safe, I took out the other update.  Now the execute() is issueing exactly one DML to pricebookentry for a few hundred rows.  I still get the mixed dml error.  Not sure how I could get a mixed dml error when there is exactly one DML issued.

 

09:23:22.107 (92107648000)|EXCEPTION_THROWN|[68]|System.DmlException: Update failed. First exception on row 0 with id 01u40000002CKwBAAW; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): CustomFieldDefinition, original object: PricebookEntry: []

 

The message doesn't make much sense as it says there's an attempt to update "CustomFieldDefinition".  That sounds like metadata, not data.  And as I mentioned, there is exactly one dml, to pricebookentry.

 

Yes, I did open a case with Tech Support.   I updated the logic to a single DML this morning and added that to the case, still waiting on a response after that update.

 

I thought I'd post here anyway in case anyone else has experienced this anomoly.

Hi all,

The updated SDK rules, but I am having a little issue getting the iOS view controller to initalise my storyboard after the login process has completed (in my AppDelegate), I am trying to just point to my storyboard instead of the rootview provided in the template.

 

Please see my AppDelegate code bellow:

- (void)initializeAppViewState
{
    self.window.rootViewController = [[InitialViewController alloc] initWithNibName:nil bundle:nil];
    [self.window makeKeyAndVisible];
}

- (void)setupRootViewController
{
    NSBundle *bundle = [NSBundle mainBundle];
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"StoryboardiPhone" bundle:bundle];
    RootViewController *rootView = (RootViewController*)[sb instantiateViewControllerWithIdentifier:@"mainPage"];
    self.window.rootViewController = rootView;
}

 Everything else in the AppDelegate remains the same, the two classes referenced here are:

#import "InitialViewController.h"

@implementation InitialViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        NSLog(@"HERE: InitialViewController");
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

 

#import "RootViewController.h"

@implementation RootViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        NSLog(@"HERE: RootViewController");
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

 This should direct them into the storyboard with the rootViewController, which should provide a 'UITabBarController' from here they will be able to click a tab to display the original 'UITableViewController' which will return some records from salesforce for display.

 

The ERROR that I recieve is:

2013-09-28 11:15:01.738 Example 1[340:a0b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "yRf-rA-8Y5-view-2PQ-Tj-Ddg" nib but didn't get a UITableView.'

 It appear that the rootViewController is expecting a UITableViewController, but I don't understand why this would be or how to get around it.

Has anyone successfuly redirected to a storyboard from the completion of the login using the template provided? If so how did you get around this issue?