• Nakata
  • NEWBIE
  • 30 Points
  • Member since 2009

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

Good day, 

 

Appreciated someone please enlighten me how could i test the current page is the page that re-directed in test class?

 

for instance, 

if i have set my current page from test class

 

PageReference pageRef = new PageReference('/apex/mycurrentpage);

 Assume one method executed later and the method call redirect to another page at the end.

 

my question is how should i write a test method for it ? 

 

try using following, but it give me pagereference of '/apex/mycurrentpage', what i expecting is '/apex/nextpage'

 

PageReference curpageRef = ApexPages.currentPage();

 

  • August 29, 2011
  • Like
  • 0

Good day, 

 

I ave following code but the list table showing me half of the screen, appreciated someone can point out where should i change my code to fit 100% on user screen , thanks in advance !

 

<apex:pageBlock title="test" mode="edit">
<apex:pageBlockSection title="" columns="2">
<apex:pageBlockSectionItem >
<apex:outputPanel >
<apex:outputLabel value="Test type" for="Test_Type__c__namevalue"/>
<apex:outputLabel value=":" />                    
<apex:outputText value="{!TestTypeName}" id="Test_Type__c__namevalue"/>
</apex:outputPanel>

</apex:pageBlockSectionItem>

</apex:pageBlockSection>
<apex:pageBlockSection >
  <apex:pageBlockSectionItem >
  <apex:outputPanel >
 <apex:outputLabel value="Country" for="Test_Type__countryNameValue"/>
 <apex:outputLabel value=":" />
 <apex:outputText value="{!TestTypecountry}" id="Test_Type__countryNameValue"/>
 </apex:outputPanel> 
  </apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>

 <apex:tabPanel switchType="client" selectedTab="tabdetails" id="AccountTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" >
 
  <apex:tab label="{!$Label.contact_tab}" name="contactDetails" id="tabContact"  >

 <apex:pageBlock >
 <apex:pageBlockButtons >
<apex:commandButton action="{!doSave}" value="Save"/>
<apex:commandButton action="{!doCancel}" value="Cancel"/>
 </apex:pageBlockButtons>
 
 <apex:pageBlockSection collapsible="false" showHeader="false">
 <apex:pageBlockSectionItem >
 <apex:pageBlockTable value="{!fieldConfigContactOutputList}" var="item" width="100%">
 
 
<apex:column width="100%"> 
<apex:facet name="header">User Name</apex:facet>
 <apex:outputText value="{!item.UserName}" rendered="{!item.countryName=='US'}"/> 
</apex:column>

<apex:column width="100%"> 
<apex:facet name="header">Country Name</apex:facet>   
 <apex:outputText value=" {!item.CountryName}" rendered="{!item.CountryName=='US'}"/> 
</apex:column>

<apex:column width="100%"> 
<apex:facet name="header">Is Enabled</apex:facet>
  <apex:inputCheckbox value="{!item.isEnabled}" rendered="{!item.CountryName=='US'}"/>
</apex:column>

<apex:column width="100%">
<apex:facet name="header">Is Required(Mandatory)</apex:facet>
  <apex:inputCheckbox value="{!item.isRequired}" rendered="{!item.CountryName=='US'}"/>  
</apex:column>

</apex:pageBlockCountryle>
 
 </apex:pageBlockSectionItem>
 </apex:pageBlockSection>

</apex:pageBlock>

  </apex:Country>

 

  • August 13, 2011
  • Like
  • 0

Good day, 

 

the table suppose to display 5 records from a list of 10 records,with rendered filter apply but the problem is the rest 5 records which not suppose to show do not show value but does show the empty line in the table
it is part of multi-tab form and is it under one tab call contact


Code :

 

<apex:pageBlock >
<apex:pageBlockSection collapsible="false" showHeader="false">
<apex:pageBlockSectionItem >
<apex:pageBlockTable value="{!myList}" var="item" width="100%">
	
<apex:column > 
<apex:facet name="header">Field Name</apex:facet>            			
<apex:outputText value="{!item.fieldName}" rendered="{!item.tabName=='Contact'}"/>            				             				
</apex:column>
            			
<apex:column > 
<apex:facet name="header">Tab Name</apex:facet>   
 <apex:outputText value=" {!item.tabName}" rendered="{!item.tabName=='Contact'}"/>                    				         			
</apex:column>
            			
<apex:column >             
<apex:facet name="header">Is Enabled</apex:facet>   				 
<apex:inputCheckbox value="{!item.isEnabled}" rendered="{!item.tabName=='Contact'}"/>
</apex:column>
            			
<apex:column >
<apex:facet name="header">Is Required(Mandatory)</apex:facet>               				 
<apex:inputCheckbox value="{!item.isRequired}" rendered="{!item.tabName=='Contact'}"/>            				          				
</apex:column>
            			            			            			
</apex:pageBlockTable>
		         		
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

</apex:pageBlock>

 

 

 

 

  • August 09, 2011
  • Like
  • 0

Good day, 

 

I need to build a VF page which contain many records and each record indicate a field that have multiple checkbox which allow user to select whether the field should be enable or disable, and it should be required or not.

 

My question is what is the best approach to accept all field's input ?

 

Scenario

========

FieldNameisRequired isEnabled

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

Field1 ticknot tick

Field2not ticktick

 

Appreciated your guidance and Thanks in advance !

  • August 01, 2011
  • Like
  • 0

Good day, 

 

I would like to clone Quote record and by having a button "New Clone", which will doing exactly what is current "clone" button doing, but i want to pass in the previous Quote id as value of a new field in new cloning page.

 

May i know what is the best way to do it ?

 

Thanks in advance !

Good day, 

 

I trying to create a trigger which intend to update oppty field if contact role are inserted, and noticed that we can't create a trigger for OpportunityContactRole object, and worst, the opportunity trigger seem do not trigger on update when new contact role record are created, but noticed lastmodifiedDate is changed on opportunity.

 

I would appreciated if someone point out if i wrong in understanding this limitation and possible state any mistake of the trigger as well (I'm newbie of SFDC)

 

trigger MycontactRoleTrigger on Opportunity (before update) {
	
List<OpportunityContactRole> opptyContactRoleList= [SELECT contact.name, 
ContactId, Id, CreatedById, CreatedDate, IsDeleted, LastModifiedById, LastModifiedDate, 
OpportunityId, IsPrimary, Role, SystemModstamp FROM OpportunityContactRole 
WHERE OpportunityId IN :trigger.newmap.keyset() ];
									
System.debug('opptyContactRoleList list = '+opptyContactRoleList);									
	

if(trigger.isBefore){			
			for(Opportunity oppty : trigger.new){
				if(al.StringUtils.isBlank(oppty.contactPersonName__C) )){
					for(OpportunityContactRole ocr :opptyContactRoleList){
						if(al.StringUtils.equalsIgnoreCase(oppty.id,ocr.OpportunityId)){							
							oppty.contactPersonName__C 	 = ocr.contact.name;							
							break;
						}
					}
				}
			}
		}
	
	}

 

Good day, 

 

Do we have chance to received any email from outside of SFDC and process the email based on some keyword to update related object's fields.

 

Thanks ! 

Good day, 

 

Appreciated if someone can point out how can i get the value of Lead status from lead page ?

 

Thank you !

Good day, 

 

Any expert please point out what's wrong with my query below and get error "invalid query filter operator"

 

SELECT Id FROM Event WHERE WhoId like 'ABC%'

 

Thanks

Good day, 

 

Appreciated if someone enlighten how can we keep track on email that send out from WF.

 

Thanks

Good day, 

 

I always have problem to create test method :(

 

May i know how can we do the test method for below method 

 

 

public static void myMethod(List<String> tempCampaignIDList){
	if(tempCampaignIDList.size()>0){
		List<Campaign> campaignList = [SELECT Id, Type FROM Campaign WHERE id IN :tempCampaignIDList];
	for(Campaign cp : campaignList){
		if(!CampaignVehicleLookupMap.containsKey(cp.id)){
			CampaignVehicleLookupMap.put(cp.id, cp.type);
					}
				}
			}
}

Thanks in advance !

 

 

  • April 21, 2011
  • Like
  • 0

Good day, 

 

I would like to create a VF page as a error page receiver mainly for exception, with the simple code below, i do not know why the error come from controller doesn't appear in following Vf page

 

 

<apex:page 
showHeader="true"     
standardStylesheets="true"
tabStyle="Account"   
id="thePage"
>
<apex:form >
		 
        <apex:pageBlock >
       	<apex:pageMessages />
		</apex:pageBlock>
</apex:form>

</apex:page>

 

 

 My controller have something like below 

 

 

ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'this is error');
ApexPages.addMessage(myMsg);

if(StringUtils.isBlank(URL)){
 URL = '/apex/myErrorPAge';
}

PageReference pageRef = new PageReference(URL);
pageRef.setRedirect(true);
return pageRef;

 But i can't figure out why the error message doesn't show in VF page ?

 

Question :

1. in VF page, i do not put controller, so that it can be used as general exception page, can i do that ?

2. Even i have put the controller in VF page, but it still not able to show me message, not sure what i have miss out

 

Thanks in advance !

 

  • April 09, 2011
  • Like
  • 0

Good day,

 

I would like to create an instance for Schema and if it already instantiated then will not required to instantiate again (Singleton pattern), question is how can i make it persistently ? i did try use static and it couldn't serve me that purpose :(

 

Thanks in advance!

 

  • April 09, 2011
  • Like
  • 0

Good day, 

 

May i know how can i initialized Map<String,Map<String,String>> or List<String,Map<String,String>>

 

I need to keep a set of info like below , which is the best case ?

 

APJ, countryName_1, CountryID_1

EMEA, CountryName2, CountryID_2

 

Thanks in advance !

  • April 08, 2011
  • Like
  • 0

Good day,

 

Anyone have idea how can i get the standard controller object name from my controller ? meaning if my  VF page have standardcontroller = "Account" , then in my controller will able to recognise Account as Standard controller object.

 

Reason of doing that is i have multiple page which have different standard controller in respective page but they have suppose in same behaviour.

 

ie : 

 

 

Mycontroller (ApexPages.StandardController sc){
// how can i know and get dynamically on standard controller object like "Account, Contact..." ?
}

 

Thanks in advance !

  • April 07, 2011
  • Like
  • 0

Hi All,

 

as above mentioned subject, how can i pass field's value and mapping between salesforce to salesforce instance.

 

Thank you !

  • March 22, 2011
  • Like
  • 0

Good day,

 

I working on controller, which pass parameter via URL to a custom object detail page's fields.

 

for instance :

 

 

Controller :
String accountMember = 'user1';
String accountMember2 = 'user2';

String URL = /a03/e?xxx111=accountMember&xxx222=accountMember2;
PageReference myCustomObjectPR = new PageReference(urlStr);

 

 

 

Custom object:

xxx111 is field id of accountMember and belong to text field type

xxx222 is field id of accountMember2 and belong to text field type

 

Problem :

accountMember fields are both read-only suppose, i do not see my parameter populate in fields until i make the field to visible on FLS

 

Question :

1. why the readonly field can't get the parameter ?

2. if i make the fields to visible now, how can i make the fields not editable ? i try using validaton rule with formula 

isChange(accountMember__c) , it doesn't prevent user to edit before it get save, the validation only check after the record saved, any hint on this ?

3. What are the best solution to handle my case ?

 

Thanks!

  • March 09, 2011
  • Like
  • 0

Good day,

 

I working on controller, which pass parameter via URL to a custom object detail page's fields.

 

for instance :

 

Controller :

String accountMember = 'user1';

String accountMember2 = 'user2';

 

String URL = /a03/e?xxx111=accountMember&xxx222=accountMember2;

 

Custom object:

xxx111 is field id of accountMember and belong to text field type

xxx222 is field id of accountMember2 and belong to text field type

 

Problem :

accountMember fields are both read-only suppose, i do not see my parameter populate in fields until i make the field to visible on FLS

 

question :

1. why the readonly field can't get the parameter ?

2. if i make the fields to visible now, how can i make the fields not editable ? i try using validaton rule with formula 

isChange(accountMember__c) , it doesn't prevent user to edit before it get save, the validation only check after the record saved, any hint on this ?

 

Thanks!

 

  • March 09, 2011
  • Like
  • 0

Good day, 

 

I trying to create a condition in order to get the value appear in email template

 

the condition like following 

 

If approved reason = "Not Exceed" then show "Other approve reason" which is user entry value, i put it in this way but when i try to test the template, it doesn't show me the "Other approve reason" value

 

** Approved reason is picklist whereas "Other approve reason" is textfield

 

My try on following, but it doens't show me the "Other approved reason" value, any clue ?

 

 

{!IF(ISPICKVAL(myObject.Approved_Reason__c,"Not Exceed"),myObject.Other_approved_reason__c,"") OR 
!IF(ISPICKVAL(myObject.Approved_Reason__c,"Exceed"),"Exceed","")
}

 

Thanks in advance !

 

  • February 09, 2011
  • Like
  • 0

Good day, 

 

When i trying to pass in more than one parameter to saveURL, and it does go to right page but do not show more than one paramater in the saveURL. the code sample like below, after the contact save, it should go to 'another' page with parameter show for 'accountName=' and 'modified=true' , but it seem like only appear accountName and newId , but 'modified=true' no longer showing.

 

 

PageReference newContactView = new PageReference('/apex/myContact?accountId='+accountId+'&saveURL=/apex/anotherpage?accountName='+accountName + '&modified=true');

 

Thank you !

 

  • January 07, 2011
  • Like
  • 0

Good day,

 

Can i know if Apex:Repeat tag's value able hold Map instead of List ?

 

 

VF page
------------
<apex:repeat value="{!partnerFieldList}" var="field">

<apex:variable var="currentLabel" value="{!$Label.first_name}" rendered="{field.containsKey('First_Name__c')}"/>


Controller
-----------
public Map<String,Boolean> partnerFieldList = new Map<String,Boolean>{
'First_Name__c' => TRUE

};

 

public Map<String,Boolean> getPartnerFieldList(){
return partnerFieldList;

 

 

 I would like to rendered the 'firstname' variable if the field are calling, but i get "Unsupported type common.apex.runtime.impl.MapValue encountered."error when i run the apex page

 

Thank you !

 

  • November 10, 2009
  • Like
  • 1

Good day, 

 

I need to build a VF page which contain many records and each record indicate a field that have multiple checkbox which allow user to select whether the field should be enable or disable, and it should be required or not.

 

My question is what is the best approach to accept all field's input ?

 

Scenario

========

FieldNameisRequired isEnabled

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

Field1 ticknot tick

Field2not ticktick

 

Appreciated your guidance and Thanks in advance !

  • August 01, 2011
  • Like
  • 0

Good day, 

 

I would like to clone Quote record and by having a button "New Clone", which will doing exactly what is current "clone" button doing, but i want to pass in the previous Quote id as value of a new field in new cloning page.

 

May i know what is the best way to do it ?

 

Thanks in advance !

Good day, 

 

I trying to create a trigger which intend to update oppty field if contact role are inserted, and noticed that we can't create a trigger for OpportunityContactRole object, and worst, the opportunity trigger seem do not trigger on update when new contact role record are created, but noticed lastmodifiedDate is changed on opportunity.

 

I would appreciated if someone point out if i wrong in understanding this limitation and possible state any mistake of the trigger as well (I'm newbie of SFDC)

 

trigger MycontactRoleTrigger on Opportunity (before update) {
	
List<OpportunityContactRole> opptyContactRoleList= [SELECT contact.name, 
ContactId, Id, CreatedById, CreatedDate, IsDeleted, LastModifiedById, LastModifiedDate, 
OpportunityId, IsPrimary, Role, SystemModstamp FROM OpportunityContactRole 
WHERE OpportunityId IN :trigger.newmap.keyset() ];
									
System.debug('opptyContactRoleList list = '+opptyContactRoleList);									
	

if(trigger.isBefore){			
			for(Opportunity oppty : trigger.new){
				if(al.StringUtils.isBlank(oppty.contactPersonName__C) )){
					for(OpportunityContactRole ocr :opptyContactRoleList){
						if(al.StringUtils.equalsIgnoreCase(oppty.id,ocr.OpportunityId)){							
							oppty.contactPersonName__C 	 = ocr.contact.name;							
							break;
						}
					}
				}
			}
		}
	
	}

 

Good day, 

 

Do we have chance to received any email from outside of SFDC and process the email based on some keyword to update related object's fields.

 

Thanks ! 

Good day, 

 

Appreciated if someone can point out how can i get the value of Lead status from lead page ?

 

Thank you !

Good day, 

 

Any expert please point out what's wrong with my query below and get error "invalid query filter operator"

 

SELECT Id FROM Event WHERE WhoId like 'ABC%'

 

Thanks

Good day, 

 

Appreciated if someone enlighten how can we keep track on email that send out from WF.

 

Thanks

Good day, 

 

I would like to create a VF page as a error page receiver mainly for exception, with the simple code below, i do not know why the error come from controller doesn't appear in following Vf page

 

 

<apex:page 
showHeader="true"     
standardStylesheets="true"
tabStyle="Account"   
id="thePage"
>
<apex:form >
		 
        <apex:pageBlock >
       	<apex:pageMessages />
		</apex:pageBlock>
</apex:form>

</apex:page>

 

 

 My controller have something like below 

 

 

ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'this is error');
ApexPages.addMessage(myMsg);

if(StringUtils.isBlank(URL)){
 URL = '/apex/myErrorPAge';
}

PageReference pageRef = new PageReference(URL);
pageRef.setRedirect(true);
return pageRef;

 But i can't figure out why the error message doesn't show in VF page ?

 

Question :

1. in VF page, i do not put controller, so that it can be used as general exception page, can i do that ?

2. Even i have put the controller in VF page, but it still not able to show me message, not sure what i have miss out

 

Thanks in advance !

 

  • April 09, 2011
  • Like
  • 0

Good day,

 

I would like to create an instance for Schema and if it already instantiated then will not required to instantiate again (Singleton pattern), question is how can i make it persistently ? i did try use static and it couldn't serve me that purpose :(

 

Thanks in advance!

 

  • April 09, 2011
  • Like
  • 0

Good day, 

 

May i know how can i initialized Map<String,Map<String,String>> or List<String,Map<String,String>>

 

I need to keep a set of info like below , which is the best case ?

 

APJ, countryName_1, CountryID_1

EMEA, CountryName2, CountryID_2

 

Thanks in advance !

  • April 08, 2011
  • Like
  • 0