• sfrers
  • NEWBIE
  • 25 Points
  • Member since 2010

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

Hi Folks,  I am stumped and have been looking at this too long.  Any help is very much appreciated.

 

I would like to compare the numeric portion of a string to the numeric portion of another string in a VF page.  I am able to use the replaceAll method in APEX without an issue, like this...

 

 

if(integer.valueOf(Custom_Textfield_A__c.replaceAll('\\D','')) > integer.valueOf(Custom_Textfield_B__c.replaceAll('\\D','')))
	//TODO some field updates here;

 

 

I am attempting to compare the same two fields in a VF page to determine whether to highlight a row or not.  This is what I was attempting, but without success...

 

 

<apex:repeat rows="5" value="{!getLines}" var="l">
	<tr>
	<div style="{!if(value(l.Custom_Textfield_A__c) > value(l.Custom_Textfield_B__c),'background-color:#F3F781','')};">		<td valign="center" width="220px">
			<apex:outputText value="{!l.Name}" />
		</td>
		<td valign="center" align="center">
			<apex:outputText value="{0}">
				<apex:param value="{!Left(l.Line_Type__c,1)}" />
			</apex:outputText>
		</td>
		<td class="tdv">
			<apex:outputField value="{!l.Custom_Textfield_A__c}" />
		</td>
	</div>
	</tr>
</apex:repeat>

 

 

The issue arises in the VF page because I cannot determine how to remove the non-numeric characters from the text field and it fails with a java.lang.NumberFormatException.  I am not able to switch these fields to numeric due to business requirements, so I am hoping there is an equivalent solution in VF to what I was able to do in APEX.

 

 

Steven

 

 

  • September 22, 2010
  • Like
  • 0

Hi Folks,  APEX newbie here.  I am attempting to create an After Update trigger on a custom object that updates Child records when the Parent record is approved in an Approval process.  I have listed the code and debug output below.  I have highlighted the lines in the debug log that show the array items with Value__c populated, yet when I get into the loop the Value__c field in the array is suddenly null.  The reason the Value__c and Control_Value__c fields are Text is due to a business requirement that may have a single letter after the number value in the field.  Any help or guidance is much appreciated.

 

Trigger:

 

trigger LabActAddAdjAmtFromCalcApproval on LA__c (after update) {

	set<Id> laIds = new set<Id>();
	
	for(Integer i = 0; i < trigger.new.size(); i++){
		if(trigger.old[i].IsApproved__c != trigger.new[i].IsApproved__c){
			if(trigger.new[i].Status__c == 'Calc Approved' && trigger.new[i].IsApproved__c == 'Yes'){
				laIds.add(trigger.new[i].Id);
			}
		}
	}

	for (Integer i = 0; i < laIds.size(); i++)
		system.debug(laIds);

	LAL__c[] lalines = [select Id, Line_Type__c, Value__c, Adjustment_Amount__c, Lab_Activity__r.A_Value__c, Lab_Activity__r.M_Value__c,
							Lab_Activity__r.Control_Value__c from LAL__c where Lab_Activity__c in :laIds];
	
	for (Integer i = 0; i < lalines.size(); i++)
		system.debug(lalines[i]);
		
	system.debug(lalines.size()+'-----------------------------------------');

	for(Integer i = 0; i < lalines.size(); i++){
		system.debug(integer.valueOf(lalines[i].Value__c) + '****************************************');
		if(integer.valueOf(lalines[i].Value__c) > integer.valueOf(lalines[i].Lab_Activity__r.Control_Value__c)){
			if(lalines[i].Line_Type__c == 'Airborne'){
				lalines[i].Adjustment_Amount__c = lalines[i].Lab_Activity__r.A_Value__c;
			}
			else if(lalines[i].Line_Type__c == 'Mold'){
				lalines[i].Adjustment_Amount__c = lalines[i].Lab_Activity__r.M_Value__c;
			}
		}
	}
	update lalines;
}

 Debug Log:

 

19.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO
13:8:36.504|EXECUTION_STARTED
13:8:36.504|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:ApprovalProcessActions
13:8:36.516|WF_APPROVAL|Approve|[Lab Activity: LA-3171 a1bT00000004IaL]|Step 1(Approval based on first response)
13:8:36.516|WF_SPOOL_ACTION_BEGIN|Approve
13:8:36.516|WF_SPOOL_ACTION_BEGIN|Approve
13:8:36.707|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: AppRejDate|Value:Fri Sep 10 00:00:00 GMT 2010|Id=04YT00000008kdP
13:8:36.709|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: IsApproved|Value:Yes|Id=04YT00000008keS
13:8:36.711|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: Status|Value:Calc Approved|Id=04YT00000008kYP
...
13:8:38.451|CODE_UNIT_STARTED|[EXTERNAL]|01qT00000004Uom|LabActAddAdjAmtFromCalcApproval on LA trigger event AfterUpdate for [a1bT00000004IaL] 13:8:38.451|METHOD_ENTRY|[5,25]|LIST<LA__c>.size() 13:8:38.451|METHOD_EXIT|[5,25]|LIST<LA__c>.size() 13:8:38.451|METHOD_ENTRY|[8,5]|SET<Id>.add(Id) 13:8:38.452|METHOD_EXIT|[8,5]|SET<Id>.add(Id) 13:8:38.452|METHOD_ENTRY|[5,25]|LIST<LA__c>.size() 13:8:38.452|METHOD_EXIT|[5,25]|LIST<LA__c>.size() 13:8:38.452|METHOD_ENTRY|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_EXIT|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_ENTRY|[14,3]|system.debug(SET<Id>) 13:8:38.452|USER_DEBUG|[14,3]|DEBUG|{a1bT00000004IaLIAU} 13:8:38.452|METHOD_EXIT|[14,3]|system.debug(SET<Id>) 13:8:38.452|METHOD_ENTRY|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_EXIT|[13,26]|SET<Id>.size() 13:8:38.452|SOQL_EXECUTE_BEGIN|[16,21]|Aggregations:0|select Id, Line_Type__c, Value__c, Adjustment_Amount__c, Lab_Activity__r.A_Value__c, Lab_Activity__r.M_Value__c, Lab_Activity__r.Control_Value__c from LAL__c where Lab_Activity__c in :laIds 13:8:38.474|SOQL_EXECUTE_END|[16,21]|Rows:68 13:8:38.474|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.474|METHOD_EXIT|[19,26]|LIST<LAL__c>.size()
...repetative records removed to cut down on the posting length...

13:8:38.478|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.478|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Histamine, Value__c=5, Id=a1gT0000000D49MIAS} 13:8:38.478|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.478|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.478|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.478|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Value__c=8, Id=a1gT0000000D49NIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=2, Id=a1gT0000000D49OIAS} 13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=1, Id=a1gT0000000D49PIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=11, Id=a1gT0000000D49QIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Id=a1gT0000000D49RIAS}13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Id=a1gT0000000D49SIAS} 13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Id=a1gT0000000D49TIAS} 13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Value__c=10, Id=a1gT0000000D49UIAS}13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c)
...repetative records removed to cut down on posting length...

13:8:38.489|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.489|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Neg.Control, Value__c=2, Id=a1gT0000000D4A9IAK} 13:8:38.489|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.489|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.490|METHOD_ENTRY|[22,2]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[22,15]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[22,15]|LIST<LAL__c>.size() 13:8:38.490|USER_DEBUG|[22,2]|DEBUG|68----------------------------------------- 13:8:38.490|METHOD_EXIT|[22,2]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[24,25]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[24,25]|LIST<LAL__c>.size() 13:8:38.490|METHOD_ENTRY|[25,3]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[25,16]|integer.valueOf(String) 13:8:38.490|EXCEPTION_THROWN|[25,43]|System.NullPointerException: Argument 1 cannot be null 13:8:38.490|METHOD_EXIT|[25,16]|integer.valueOf(String) 13:8:38.490|METHOD_EXIT|[25,3]|system.debug(String) 13:8:38.490|FATAL_ERROR|System.NullPointerException: Argument 1 cannot be null Trigger.LabActAddAdjAmtFromCalcApproval: line 25, column 43 13:8:38.490|CUMULATIVE_LIMIT_USAGE 13:8:38.490|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 1 out of 20 Number of query rows: 68 out of 1000 Number of SOSL queries: 0 out of 0 Number of DML statements: 0 out of 20 Number of DML rows: 0 out of 100 Number of script statements: 78 out of 10200 Maximum heap size: 0 out of 300000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 0 Number of System.runAs() invocations: 0 out of 20 13:8:38.490|CUMULATIVE_LIMIT_USAGE_END 13:8:38.490|CODE_UNIT_FINISHED|LabActAddAdjAmtFromCalcApproval on LA trigger event AfterUpdate for [a1bT00000004IaL]

 

Steven

 

 

 

 

 

  • September 10, 2010
  • Like
  • 0

I am having difficulty referencing the values of my controller query in a VF page.  The scenario is looking up two different single child records from a single parent record.  When I run the SELECT query below by itself in the AJAX debug shell it returns the correct results.  However, when I attempt to reference in the VF page I see no results.  The APEX and VF syntax are both new to me.  I am stumped, any assistance is very much appreciated.

 

APEX:

 

public with sharing class VisitCtlr
{
	public gii__Product2Add__c giiPR;
	
	public VisitCtlr()
	{
		giiPR = [select Name, (select Name from Accounts__r where id='001A000000Jpj5QIAR'), (select gii__KitProduct__r.Name from gii__KitProductReference__r where gii__ProductReference__c='a0XA0000000oviFMAQ' and gii__Required__c=True) from gii__Product2Add__c where id='a0XA0000000oviFMAQ'];
	}
	
	public gii__Product2Add__c getgiiPR()
	{
		return giiPR;
	}
}

 

 

VF:

 

<apex:page controller="VisitCtlr">
  <apex:pageBlock >
    <apex:pageblocktable value="{!giiPR}" var="pr">
      <apex:pageblocktable value="{!pr.Accounts__r}" var="ac">
        <apex:pageblocktable value="{!pr.gii__KitProductReference__r}" var="kp">
           <apex:column headerValue="Kit Name">
              <apex:outputText value="{!pr.Name}"/>
           </apex:column>
           <apex:column headerValue="Account Name">
              <apex:outputText value="{!ac.Name}"/>
           </apex:column>
           <apex:column headerValue="Product">
              <apex:outputText value="{!kp.Name}"/>
           </apex:column>
        </apex:pageblocktable>
      </apex:pageblocktable>
    </apex:pageblocktable>
  </apex:pageBlock>
</apex:page>

 

 

All the best,

Steven

  • August 24, 2010
  • Like
  • 0

Hi Folks,  I am stumped and have been looking at this too long.  Any help is very much appreciated.

 

I would like to compare the numeric portion of a string to the numeric portion of another string in a VF page.  I am able to use the replaceAll method in APEX without an issue, like this...

 

 

if(integer.valueOf(Custom_Textfield_A__c.replaceAll('\\D','')) > integer.valueOf(Custom_Textfield_B__c.replaceAll('\\D','')))
	//TODO some field updates here;

 

 

I am attempting to compare the same two fields in a VF page to determine whether to highlight a row or not.  This is what I was attempting, but without success...

 

 

<apex:repeat rows="5" value="{!getLines}" var="l">
	<tr>
	<div style="{!if(value(l.Custom_Textfield_A__c) > value(l.Custom_Textfield_B__c),'background-color:#F3F781','')};">		<td valign="center" width="220px">
			<apex:outputText value="{!l.Name}" />
		</td>
		<td valign="center" align="center">
			<apex:outputText value="{0}">
				<apex:param value="{!Left(l.Line_Type__c,1)}" />
			</apex:outputText>
		</td>
		<td class="tdv">
			<apex:outputField value="{!l.Custom_Textfield_A__c}" />
		</td>
	</div>
	</tr>
</apex:repeat>

 

 

The issue arises in the VF page because I cannot determine how to remove the non-numeric characters from the text field and it fails with a java.lang.NumberFormatException.  I am not able to switch these fields to numeric due to business requirements, so I am hoping there is an equivalent solution in VF to what I was able to do in APEX.

 

 

Steven

 

 

  • September 22, 2010
  • Like
  • 0

Hi Folks,  APEX newbie here.  I am attempting to create an After Update trigger on a custom object that updates Child records when the Parent record is approved in an Approval process.  I have listed the code and debug output below.  I have highlighted the lines in the debug log that show the array items with Value__c populated, yet when I get into the loop the Value__c field in the array is suddenly null.  The reason the Value__c and Control_Value__c fields are Text is due to a business requirement that may have a single letter after the number value in the field.  Any help or guidance is much appreciated.

 

Trigger:

 

trigger LabActAddAdjAmtFromCalcApproval on LA__c (after update) {

	set<Id> laIds = new set<Id>();
	
	for(Integer i = 0; i < trigger.new.size(); i++){
		if(trigger.old[i].IsApproved__c != trigger.new[i].IsApproved__c){
			if(trigger.new[i].Status__c == 'Calc Approved' && trigger.new[i].IsApproved__c == 'Yes'){
				laIds.add(trigger.new[i].Id);
			}
		}
	}

	for (Integer i = 0; i < laIds.size(); i++)
		system.debug(laIds);

	LAL__c[] lalines = [select Id, Line_Type__c, Value__c, Adjustment_Amount__c, Lab_Activity__r.A_Value__c, Lab_Activity__r.M_Value__c,
							Lab_Activity__r.Control_Value__c from LAL__c where Lab_Activity__c in :laIds];
	
	for (Integer i = 0; i < lalines.size(); i++)
		system.debug(lalines[i]);
		
	system.debug(lalines.size()+'-----------------------------------------');

	for(Integer i = 0; i < lalines.size(); i++){
		system.debug(integer.valueOf(lalines[i].Value__c) + '****************************************');
		if(integer.valueOf(lalines[i].Value__c) > integer.valueOf(lalines[i].Lab_Activity__r.Control_Value__c)){
			if(lalines[i].Line_Type__c == 'Airborne'){
				lalines[i].Adjustment_Amount__c = lalines[i].Lab_Activity__r.A_Value__c;
			}
			else if(lalines[i].Line_Type__c == 'Mold'){
				lalines[i].Adjustment_Amount__c = lalines[i].Lab_Activity__r.M_Value__c;
			}
		}
	}
	update lalines;
}

 Debug Log:

 

19.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO
13:8:36.504|EXECUTION_STARTED
13:8:36.504|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:ApprovalProcessActions
13:8:36.516|WF_APPROVAL|Approve|[Lab Activity: LA-3171 a1bT00000004IaL]|Step 1(Approval based on first response)
13:8:36.516|WF_SPOOL_ACTION_BEGIN|Approve
13:8:36.516|WF_SPOOL_ACTION_BEGIN|Approve
13:8:36.707|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: AppRejDate|Value:Fri Sep 10 00:00:00 GMT 2010|Id=04YT00000008kdP
13:8:36.709|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: IsApproved|Value:Yes|Id=04YT00000008keS
13:8:36.711|WF_FIELD_UPDATE|[Lab Activity: LA-3171 a1bT00000004IaL]|Field:Lab Activity: Status|Value:Calc Approved|Id=04YT00000008kYP
...
13:8:38.451|CODE_UNIT_STARTED|[EXTERNAL]|01qT00000004Uom|LabActAddAdjAmtFromCalcApproval on LA trigger event AfterUpdate for [a1bT00000004IaL] 13:8:38.451|METHOD_ENTRY|[5,25]|LIST<LA__c>.size() 13:8:38.451|METHOD_EXIT|[5,25]|LIST<LA__c>.size() 13:8:38.451|METHOD_ENTRY|[8,5]|SET<Id>.add(Id) 13:8:38.452|METHOD_EXIT|[8,5]|SET<Id>.add(Id) 13:8:38.452|METHOD_ENTRY|[5,25]|LIST<LA__c>.size() 13:8:38.452|METHOD_EXIT|[5,25]|LIST<LA__c>.size() 13:8:38.452|METHOD_ENTRY|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_EXIT|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_ENTRY|[14,3]|system.debug(SET<Id>) 13:8:38.452|USER_DEBUG|[14,3]|DEBUG|{a1bT00000004IaLIAU} 13:8:38.452|METHOD_EXIT|[14,3]|system.debug(SET<Id>) 13:8:38.452|METHOD_ENTRY|[13,26]|SET<Id>.size() 13:8:38.452|METHOD_EXIT|[13,26]|SET<Id>.size() 13:8:38.452|SOQL_EXECUTE_BEGIN|[16,21]|Aggregations:0|select Id, Line_Type__c, Value__c, Adjustment_Amount__c, Lab_Activity__r.A_Value__c, Lab_Activity__r.M_Value__c, Lab_Activity__r.Control_Value__c from LAL__c where Lab_Activity__c in :laIds 13:8:38.474|SOQL_EXECUTE_END|[16,21]|Rows:68 13:8:38.474|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.474|METHOD_EXIT|[19,26]|LIST<LAL__c>.size()
...repetative records removed to cut down on the posting length...

13:8:38.478|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.478|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Histamine, Value__c=5, Id=a1gT0000000D49MIAS} 13:8:38.478|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.478|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.478|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.478|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Value__c=8, Id=a1gT0000000D49NIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=2, Id=a1gT0000000D49OIAS} 13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=1, Id=a1gT0000000D49PIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Value__c=11, Id=a1gT0000000D49QIAS}13:8:38.479|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.479|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.479|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Id=a1gT0000000D49RIAS}13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Id=a1gT0000000D49SIAS} 13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Mold, Id=a1gT0000000D49TIAS} 13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.480|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.480|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Airborne, Value__c=10, Id=a1gT0000000D49UIAS}13:8:38.480|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c)
...repetative records removed to cut down on posting length...

13:8:38.489|METHOD_ENTRY|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.489|USER_DEBUG|[20,3]|DEBUG|LAL__c:{Lab_Activity__c=a1bT00000004IaLIAU, Line_Type__c=Neg.Control, Value__c=2, Id=a1gT0000000D4A9IAK} 13:8:38.489|METHOD_EXIT|[20,3]|system.debug(SOBJECT:LAL__c) 13:8:38.489|METHOD_ENTRY|[19,26]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[19,26]|LIST<LAL__c>.size() 13:8:38.490|METHOD_ENTRY|[22,2]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[22,15]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[22,15]|LIST<LAL__c>.size() 13:8:38.490|USER_DEBUG|[22,2]|DEBUG|68----------------------------------------- 13:8:38.490|METHOD_EXIT|[22,2]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[24,25]|LIST<LAL__c>.size() 13:8:38.490|METHOD_EXIT|[24,25]|LIST<LAL__c>.size() 13:8:38.490|METHOD_ENTRY|[25,3]|system.debug(String) 13:8:38.490|METHOD_ENTRY|[25,16]|integer.valueOf(String) 13:8:38.490|EXCEPTION_THROWN|[25,43]|System.NullPointerException: Argument 1 cannot be null 13:8:38.490|METHOD_EXIT|[25,16]|integer.valueOf(String) 13:8:38.490|METHOD_EXIT|[25,3]|system.debug(String) 13:8:38.490|FATAL_ERROR|System.NullPointerException: Argument 1 cannot be null Trigger.LabActAddAdjAmtFromCalcApproval: line 25, column 43 13:8:38.490|CUMULATIVE_LIMIT_USAGE 13:8:38.490|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 1 out of 20 Number of query rows: 68 out of 1000 Number of SOSL queries: 0 out of 0 Number of DML statements: 0 out of 20 Number of DML rows: 0 out of 100 Number of script statements: 78 out of 10200 Maximum heap size: 0 out of 300000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 0 Number of System.runAs() invocations: 0 out of 20 13:8:38.490|CUMULATIVE_LIMIT_USAGE_END 13:8:38.490|CODE_UNIT_FINISHED|LabActAddAdjAmtFromCalcApproval on LA trigger event AfterUpdate for [a1bT00000004IaL]

 

Steven

 

 

 

 

 

  • September 10, 2010
  • Like
  • 0

I am having difficulty referencing the values of my controller query in a VF page.  The scenario is looking up two different single child records from a single parent record.  When I run the SELECT query below by itself in the AJAX debug shell it returns the correct results.  However, when I attempt to reference in the VF page I see no results.  The APEX and VF syntax are both new to me.  I am stumped, any assistance is very much appreciated.

 

APEX:

 

public with sharing class VisitCtlr
{
	public gii__Product2Add__c giiPR;
	
	public VisitCtlr()
	{
		giiPR = [select Name, (select Name from Accounts__r where id='001A000000Jpj5QIAR'), (select gii__KitProduct__r.Name from gii__KitProductReference__r where gii__ProductReference__c='a0XA0000000oviFMAQ' and gii__Required__c=True) from gii__Product2Add__c where id='a0XA0000000oviFMAQ'];
	}
	
	public gii__Product2Add__c getgiiPR()
	{
		return giiPR;
	}
}

 

 

VF:

 

<apex:page controller="VisitCtlr">
  <apex:pageBlock >
    <apex:pageblocktable value="{!giiPR}" var="pr">
      <apex:pageblocktable value="{!pr.Accounts__r}" var="ac">
        <apex:pageblocktable value="{!pr.gii__KitProductReference__r}" var="kp">
           <apex:column headerValue="Kit Name">
              <apex:outputText value="{!pr.Name}"/>
           </apex:column>
           <apex:column headerValue="Account Name">
              <apex:outputText value="{!ac.Name}"/>
           </apex:column>
           <apex:column headerValue="Product">
              <apex:outputText value="{!kp.Name}"/>
           </apex:column>
        </apex:pageblocktable>
      </apex:pageblocktable>
    </apex:pageblocktable>
  </apex:pageBlock>
</apex:page>

 

 

All the best,

Steven

  • August 24, 2010
  • Like
  • 0

I can't seem to get the pagination to work. I've looked over various examples and my code looks good to me. I'm sure I'm missing something very obvious (at least to someone else) - please help.

 

Here's my controller class:

 

 

public with sharing class zipMap {

public String zips { get; set; }

public PageReference find() {

return null;

}

public ApexPages.StandardSetController accts {

get {

//List<String> zList = new List<String>();

//zList = zips.split(',');

accts = new ApexPages.StandardSetController(

Database.getQueryLocator(

[SELECT Id, Name, BillingStreet, BillingCity, BillingState, BillingPostalCode FROM Account WHERE BillingPostalCode = '10022' ORDER BY BillingPostalCode, Name]

)

);

accts.setPageSize(2);

return accts;

}

set;

}

public List<Account> getAccounts() {

return (List<Account>) accts.getRecords();

}

public Integer pages {

get {

pages = accts.getResultSize()/accts.getPageSize();

return pages;

}

set;

}

public Boolean hasNext {

get {

return accts.getHasNext();

}

set;

}

public Boolean hasPrevious {

get {

return accts.getHasPrevious();

}

set;

}

public Integer pageNumber {

get {

return accts.getPageNumber();

}

set;

}

public void first() {

accts.first();

}

public void last() {

accts.last();

}

public void previous() {

accts.previous();

}

public void next() {

accts.next();

}

public void cancel() {

accts.cancel();

}
}

 

 

VF:

 

 

<apex:page controller="zipMap" showHeader="false" sidebar="false" tabStyle="Account">
<apex:form >

<apex:pageBlock title="Search by Zip">
<apex:inputText value="{!zips}" />
<apex:commandButton value="Search" action="{!find}" />
</apex:pageBlock>

<apex:pageBlock title="Nearby Company/Branch">
<apex:pageBlockTable value="{!accounts}" var="acct" id="accountTable">
<apex:column headerValue="Company/Branch">
<apex:outputLink value="/{!acct.Id}" target="_top">{!acct.Name}</apex:outputLink>
</apex:column>
<apex:column headerValue="Address" colspan="2">
<apex:outputText >{!acct.BillingStreet}, {!acct.BillingCity}, {!acct.BillingState}, {!acct.BillingPostalCode}</apex:outputText>
</apex:column>
<apex:column >
<apex:outputLink value="http://maps.google.com/maps?f=d&source=s_d&saddr=&daddr={!acct.BillingStreet},{!acct.BillingCity},{!acct.BillingState},{!acct.BillingPostalCode}" target="_blank">Get Directions</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>

<apex:panelGrid columns="4">
<apex:commandLink action="{!first}" rendered="{!pages > 1}">First</apex:commandLink>
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandLink>
<apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandLink>
<apex:commandLink action="{!last}" rendered="{!pages > 1}">Last</apex:commandLink>
</apex:panelGrid>

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

 

 

Thanks!

 

Adriel

  • August 17, 2010
  • Like
  • 0