• dipu
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 21
    Replies

I have some flows that were working fine before the Winter 12 update. Now I am getting following JavaScript error when the Next button is clicked. 

 

 

JS Error with flow

  • October 10, 2011
  • Like
  • 0

How can I span a PageBlockSection into two columns in a one column display?

In the following code when I use columns="2" it spans two columns (you know the correct number here is four). When I use columns="1" it shows both fields in the first column.

 

How can show the label in the first half of the page and value in the second half of the page? I am also OK with any CSS gotcha as a solution.

 

<apex:pageBlockSection title="Span Entire Page" columns="1" collapsible="true" >
   	<apex:inputField value="{!attr.Width__c}"/>
    	<apex:inputField value="{!attr.Height__c}"/>
</apex:pageBlockSection>   

 

 

 

  • September 29, 2011
  • Like
  • 0

I have a confirmation dialog with Ok and Cancel button. When user clicks OK I would call server action to proceed and on cancel no server call is necessary.

 

I want to use the apex:commandButton for both to make sure that they use the same css style. Even if I do not have the action parameter the command submits a call to the server. 

 

 

 

  • August 29, 2011
  • Like
  • 0

I have a pretty complex VF page. 

User can select an item from a given list. There is an added item list on the side. User can deselect item from the added item list. During this select/deselect operation user stays in the same page.

 

After user has selected three items, the added item list shows three items. Now the user deselects the first item. The added list shows two items. Next when the user delselects second item from the added list the first deleted item re-appears.

 

The added list is maintained by

public Set<ID> addedItemIds{get;set;}

 

 

When an item is deselected I do remove the id from the addedItemIds. On second deselect the first removed item reappears.

 

I probalby can find the source of the problem by simplifying my code.

 

This post is for just in case someone has faced the same problem; please respond.

 

 

  • August 22, 2011
  • Like
  • 0

I want to get the  image URL in a VF page from the controller class. The image is in the StaticResource.

What is the equivalent of {!$Resource.TestImage} in the apex class? 

  • August 12, 2011
  • Like
  • 0

Is there a way to detect user's language in Apex code without making an SOQL query?

  • August 03, 2011
  • Like
  • 0

Is there a guideline document for SOQL optimization.? How much should I worrry about performance issues due to sub query?

 

Thanks,

Dipu 

 

  • July 29, 2011
  • Like
  • 0

What is the best way to translate description field values? I would like to provide a way to store product description in different languages. I also wish to display the product description in user's language using the standard layout.

 

Thanks,

Dipu

  • July 27, 2011
  • Like
  • 0

IE 9 is now an automatic install. Is this still an unsupported browser?

  • June 22, 2011
  • Like
  • 0

I want to use <apex:repeat to repeat the tabs inside and tab panel.

The following block of code compiles correctly. The tab contents are available in the browser ( view source text). However none of the tabs are visible.

 

 

<apex:tabPanel id="idTabPanel" 
	   switchType="client" 
	   value="{!curTabSelection}"
	   inactiveTabClass="inactiveTab"
	   tabClass="activeTab" 
	   contentClass="tabContentClass" >

	<apex:repeat value="{!tabs}" var="aTab"> 
		<apex:tab id="idTab"  
			  label="{!aTab.Label}" 
			  name="{!aTab.Id}"
			  rendered="{! aTab.isEmpty == false }"
			  rerender="idErrorMsg, idTabPanel" 
			  ontabenter="onTabClickHandler('{!aTab.Id}');" 
			  oncomplete="onActionComplete();" >
			  
		    <c:RenderTab id="idTabBody" optionGroup="{!aTab}"/>
					
		</apex:tab>
	</apex:repeat>

</apex:tabPanel>

 

 

  • June 10, 2011
  • Like
  • 0

The size of the internal view state increases dramatically when custom components are used. Only the internal view state size increases. Other view state sizes are small. Are there any ways to take care of this issue? I want to display children and grand children records using custom components.

 

 

<apex:dataTable value="{!mainRecord.childRecords}"
                var="childRecord" 
		width="100%">
    <apex:column >
        <c:ChildRecordView id="idChild1" 
	               dataRecord="{!childRecord}"
			/> 
    </apex:column>
</apex:dataTable>	

The size increases even when the mainRecord.childRecords is empty.

  • May 31, 2011
  • Like
  • 0

I want to get the relative URL for the static resource in a controller. The StaticResrouce object does not seem to have any information about the number (1300899525000)  I see in the relative URL.

https://na7.salesforce.com/resource/1300899525000/Image_DefaultProductIcon

  • March 23, 2011
  • Like
  • 0

How can I span a PageBlockSection into two columns in a one column display?

In the following code when I use columns="2" it spans two columns (you know the correct number here is four). When I use columns="1" it shows both fields in the first column.

 

How can show the label in the first half of the page and value in the second half of the page? I am also OK with any CSS gotcha as a solution.

 

<apex:pageBlockSection title="Span Entire Page" columns="1" collapsible="true" >
   	<apex:inputField value="{!attr.Width__c}"/>
    	<apex:inputField value="{!attr.Height__c}"/>
</apex:pageBlockSection>   

 

 

 

  • September 29, 2011
  • Like
  • 0

I want to get the  image URL in a VF page from the controller class. The image is in the StaticResource.

What is the equivalent of {!$Resource.TestImage} in the apex class? 

  • August 12, 2011
  • Like
  • 0

Is there a guideline document for SOQL optimization.? How much should I worrry about performance issues due to sub query?

 

Thanks,

Dipu 

 

  • July 29, 2011
  • Like
  • 0

What is the best way to translate description field values? I would like to provide a way to store product description in different languages. I also wish to display the product description in user's language using the standard layout.

 

Thanks,

Dipu

  • July 27, 2011
  • Like
  • 0

Hi all,

 

I have a question, we have a custom object and the detail layout (standard page layout) is shown in a Visualforce page (so we can have different layouts shown based on the record type). When I collapse a section on the layout and go to another page and go back to the layout, the section is not collapsed anymore. So my question is: is there any way that it can be 'remembered' which sections are collapsed and which aren't, just like you have with the standard functionality?

 

Kind Regards,

Niels

I want to use <apex:repeat to repeat the tabs inside and tab panel.

The following block of code compiles correctly. The tab contents are available in the browser ( view source text). However none of the tabs are visible.

 

 

<apex:tabPanel id="idTabPanel" 
	   switchType="client" 
	   value="{!curTabSelection}"
	   inactiveTabClass="inactiveTab"
	   tabClass="activeTab" 
	   contentClass="tabContentClass" >

	<apex:repeat value="{!tabs}" var="aTab"> 
		<apex:tab id="idTab"  
			  label="{!aTab.Label}" 
			  name="{!aTab.Id}"
			  rendered="{! aTab.isEmpty == false }"
			  rerender="idErrorMsg, idTabPanel" 
			  ontabenter="onTabClickHandler('{!aTab.Id}');" 
			  oncomplete="onActionComplete();" >
			  
		    <c:RenderTab id="idTabBody" optionGroup="{!aTab}"/>
					
		</apex:tab>
	</apex:repeat>

</apex:tabPanel>

 

 

  • June 10, 2011
  • Like
  • 0

Hi,

 

 I have a trigger which is basically to restrict the user from manually deleting a task in salesforce. And also the same task can be delete by Apex code. Say like if I'm creating a simillar task then the already existing task should get delete and the new task has to get create. So how to differentiate the request between whether that particular trigger is occuring from salesforce page or from another apex code??

 

Thanks in advance !!

 

--

Regards,

Kothan.

Hi,

I am trying to dynamically display the fields of a custom object in a list. for that I am using the concept of VF Dynamic Bindings.

<apex:repeat value="{!columnFieldsList}" var="flds">                 
 <apex:column > 
  <apex:facet name="header">   
 <apex:outputField value="{!l.loc[flds]}" style="width:30%;"/>                	
 </apex:column> 
</apex:repeat>

 This works fine for me, 

But now I want to extend this functionality by adding a command link on the reference fields. for that I have created a Wrapper class with a boolean value isReference and checking in the controller if the field is a Reference and setting boolean to true.

 

But in VF, I am not sure how to use the wrapper in the apex repeat statement for a dyamic binding.. Below is what I did and I am getting error

 

 

<apex:repeat value="{!columnFields}" var="flds">                 
 <apex:column > 
  <apex:commandLink value="{!l.loc[flds.ColumnFieldName]}" id="fieldname" action="{!navigatefield}" target="_blank" rendered="{!flds.isReference}">
               <apex:param name="FieldId" value="{!!l.loc[flds.ColumnFieldName]}" assignTo="{!fieldName}"/>  
   </apex:commandLink> 
<apex:outputField value="{!l.loc[flds.ColumnFieldName]}" style="width:30%;" rendered="{!NOT(flds.isReference}/>                	
 </apex:column> 
</apex:repeat>

 

 

Can anyone tell me or confirm if VF Bindings can be done using wrapper classes? or if there is roundabout for this problem?

 

Thanks

Kartik

 

 

 

I have a complex visualforce page in which *all* of my <ol> tags are rendering as <blockquotes>.  In the page source, there are many <ol> tags and no <blockquote> tags.  In the rendered HTML, it's the opposite.

 

I don't even know where to begin looking for a solution -- thoughts?

 

Benj

  • June 03, 2011
  • Like
  • 0

Hi All,

 

Is there anybody know how to set the mandatory of the fields in the field sets.  After Summer 11', salesforce has added more properties for field sets, like DBRequired, Required. Origianlly, we had the problem to set some of the fields required in the field sets, after the delivery of Summer 11',  i thought this problem could be resolved by the new property. Below is one of my codes:

 

 

<apex:page standardController="Account">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:repeat value="{!$ObjectType.Account.FieldSets.Billing_Address}" var="i">                   
                    <apex:inputField value="{!Account[i]}" required="{!$ObjectType.Account.Fields[i].Required}" />
                </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>        
    </apex:form>
</apex:page>

But after doing this, i always got the error message: Unknown property 'Field.Required'

Error is in expression '{!$ObjectType.Account.Fields[i].Required}' in component <apex:inputField> in page accountbillingaddress
Is there anybody can help me with this problem? Thanks in advance!

 

 

 

I need to pass a common variable, let's call it "client name", from a custom object through a number of pages that access different tables. Does anyone know how to code that in either the VF page or the extension?

 

Thanks in advance

 

Tom

The size of the internal view state increases dramatically when custom components are used. Only the internal view state size increases. Other view state sizes are small. Are there any ways to take care of this issue? I want to display children and grand children records using custom components.

 

 

<apex:dataTable value="{!mainRecord.childRecords}"
                var="childRecord" 
		width="100%">
    <apex:column >
        <c:ChildRecordView id="idChild1" 
	               dataRecord="{!childRecord}"
			/> 
    </apex:column>
</apex:dataTable>	

The size increases even when the mainRecord.childRecords is empty.

  • May 31, 2011
  • Like
  • 0

I must be doing something very simply stupid.

 

I have two JS Functions, one takes a single variable and a second JS function that takes two variables.

 

All of these variables are in my Apex Controller and updated based on user input. I can't just call the variable directly in the function because it only get's set on the page load and not when a user makes an update.

 

For my first JS function with only 1 varilable I call using an ActionFunction that calls the PageReference to update the variable in the Controller and then calls my JS Function oncomplete and passes the variable to the JS Function.

 

Like this:

  <apex:actionFunction name="DurationCalculate" action="{!CalDuration}" rerender="Rec_Rev_Term,PanelTesting" oncomplete="setARRT({!duration})" >
  </apex:actionFunction>

<script type="text/javascript">
	function setARRT(duration)
	{		
		var months = duration;
		
		//set ARRT data
		document.getElementById('{!$Component.page.ProductForm.ContractProductsBlock.pbs.pbsiARRT.OutputARRT_m}').innerHTML = months;
	}
</script>

 This works perfectly!

 

So I tried doing this with my function that takes two variables. The actionfunction gets called but the actual JS function isn't.

 

  <apex:actionFunction name="CalPriceType"  rerender="PanelTesting" oncomplete="setPrices({!duration},{!Price_Type})" >  																				 
  </apex:actionFunction>	

<script type="text/javascript">
	function setPrices(duration,PriceType)
	{
		if(PriceType == 'Recurring')
		{
			.... do this
		}
		return false;
	}
</script>

 What am I doing wrong? Both {! duration } and {! Price_Type} can change base on the user input. The values are set correctly in the controller.

Hi,

 

Being new to SFDC development , I am trying to write a apex trigger. On the opportunity page we have a field called number of resources. When the user enters the number, those many opportunity product records need to be created. I have written the code but i have been successful only when the number of resources is upto 15, if the number is above 15 , i get the following error. I have also added the code. I hope somebody can help me.

 

Thanks.

 

trigger OppportunityProductInsert on Opportunity (after Insert, after Update )
{
    Product2 Prod = [select Id from Product2 limit 1 ];
    Pricebook2 PB = [select Id from Pricebook2 where IsActive=True  limit 1 ];
    PricebookEntry P = [select Id from PricebookEntry where Pricebook2Id=:PB.Id limit 1 ];
    List<Opportunity> lstOpportunity = new List<Opportunity>();
    Integer Num = 1;
    For (Integer I = 0; I < Num; I++)
    {
        For (Opportunity a : Trigger.new)
        {
            if (a.RecordTypeId=='01290000000UUr2' && (a.Number_of_Resources__c-a.Total_Number_of_Opportunity_Products__c)>0 && a.CurrencyIsoCode == P.CurrencyIsoCode)
            {
                OpportunityLineItem OppLI = new OpportunityLineItem (OpportunityId=a.id, UnitPrice=0, Quantity =1, PricebookEntryId=P.Id);
                lstOpportunity.add(OppLI);
            }
        }
    }
    if(!lstOpportunityisEmpty())
        update lstOpportunity;
}

 

 

The error:

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger OppportunityProductInsert caused an unexpected exception, contact your administrator: OppportunityProductInsert: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OppportunityProductInsert: maximum trigger depth exceeded Opportunity trigger event AfterInsert for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO]: []: Trigger.OppportunityProductInsert: line 12, column 1