• svd
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 6
    Replies

I'm having issue in escaping a single quote in VisualForce page.

In my output label, I used

{!IF($Profile.Name=="Customer Portal User","My Open Service Requests","Company\'s Open Service Requests")}

 

The output on my VF page is Company\'s Open Service Requests. Its not escaping the single quote. 

 

I also tried "Company\'\'s Open Service Requests".

 

Thanks in advance for the help.

  • October 04, 2012
  • Like
  • 0

Hi,

 

I'm facing a lookup filter issue in Visualforce even though "inputfield" is used.

 

The following code works.

 

//

<apex:inputField value="{!c.ContactId}" required="true" />
<apex:inputField value="{!c.AccountId}" required="true" />

//

 

I have a lookup filter on Contact ID which fetches the contacts related to the selected account only. So c.AccountID is the controlling field. But when I make this c.AccountID an outputField with a value populated in Controller, my lookup filter on ContactID does not work.

 

Code that does not work.

 

//

<apex:inputField value="{!c.ContactId}" required="true" />
<apex:outputField value="{!c.AccountId}" required="true" />

// 

 

The reason I made c.AccountID as outputField is because, we don't want the user to update the AccountID in this case. It would be populated by System.

 

Please let me know how this can be fixed. I appreciate your time.

 

Thanks,
Svd

  • April 25, 2012
  • Like
  • 0

Hello,

 

I installed lightbox component from appexchange. instead of hiding the box, is there a way to close the box ?

 

Given code in the component

 

box.setContentInnerHTML("<a href=\"#\" onclick=\"box.hide();\">Close</a><br /><br /><p>{!content}</p>");

 

Instead of hiding it, I want to close the box (lightbox window). For eg, if I'm playing audio content, this function will hide the box but still play the audio. So I want to close the lightbox window completely.

 

Thanks in advance for your help.

 

  • November 10, 2010
  • Like
  • 0

Hi ,

 

Can anyone tell me how to get system IP address (logged in system ip) using apex. are there any DNS related classes (like java)

or any other approaches. ?

 

thanks for your time and help,

SVD 

  • June 26, 2009
  • Like
  • 0

Hi ,

 

I'm getting  " Non-selective query against large object type (more than 100000 rows) " error thought I used an external id in my WHERE clause.

 

Here is psuedo of my query.

 

TestObject tst = [select id,Name from TestObject where Name = 'Unique Name' and Ext_Num__c != null  ] 

 

Ext_Num__c is a external id for my TestObject. And my testObject has more than 100k records.

 

Why is this failing though I filtered my query ?

 

Thanks in advance for your time and help.

 

Thanks,

SVD 

 

  • June 24, 2009
  • Like
  • 0
Hi All,

My requirement is to access the variable of repeat tag. My controller returns List < List<Trans__c> >. My repeat tag builds a pageblock section for each sublist. Data is being displayed fine, but I'm unable to access the repeat variable in the title of Pageblocksection.

here is sample data for more clarity on what I need.

     <apex:repeat value="{!Transcript}" var="subList" >             // My Controller returns List <List<Trans__c> > where Trans__c is my object.  
         
                <apex:pageBlockSection title=" ??? " columns="1" id="pbsTrans">
               
                    <apex:pageBlockTable value="{!subList}" var="trans" >

                         <apex:column value="{!trans.Activity_Title__c}"  />                                                 
                        
                          <apex:column value="{!trans.Year__c}" /> // I want this year to be displayed in the page block section TITLE
                  
                   </apex:pageBlockTable>
                  
              </apex:pageBlockSection>
           
           
            </apex:repeat> 

I tried returning Map<Integer, List<Trans__c > > from my controller where integer would be year. But in my repeat tag I did not know how to access the sublist and integer of the returned map obj for my page block table.

please let me know how I can get this achieved.

Thanks in Advance,
dvs

  • December 22, 2008
  • Like
  • 0
Hi,

I have to use "apex:repeat" tag to repeat some content in VF page. If my controller returns a map, how do I use the map inside the repeat tag.
Here is sample code. I'm facing some problems. How do I iterate through map object. The one shown below in red color is what I wanted. I have 10 accounts in a map. So I want to display them  using repeat object. is this possible. I could do this with List. But i need Map as I need to use the String returned also. please help.

<apex:page>

 <apex:repeat value="{!mapData}" var ="m" >
 
    <apex:pageBlockTable value = {!m.List<Account>} var = "t' >
         <apex:column> {!t.Name} </apex:column>
    </apex:pageBlockTable>
  
 </apex:repeat>

</apex:page>

// controller

public class testCtr()
{
  public Map< String, List<Account> > getMapData()
  {
      Map< String, List<Account> > mapObj = new Map< String, List<Account> >();
      mapObj.put(1,new Account('Test'));

      return mapObj;
  }


}

Any help is appreciated.

Thanks,
DSV
  • December 18, 2008
  • Like
  • 0
Hi,

I'm trying to call a action method in my controller through my java script code in the visualforce page. but my action method consists of 'Insert' DML statement and so I'm getting the following error.

System.Exception: DML currently not allowed. External entry point

here is a piece from my code.

<apex:page>

 <script type="text/javascript">

          function register(regId)
          {
          // I have some code to add regId to my query String. Then I call my action method in controller.  
             {!register};                          
          }
    </script>

< // some visual force component that calls Java script 'register' function />

</apex:page>

my action method code is as follows:

 public Pagereference getRegister()
     {
   
        scheduleId = System.currentPageReference().getParameters().get('schID'); // getting the query string added by my javascript method
        userId = UserInfo.getUserId();
        Registration__c reg = new
Registration__c(Activity_Schedule_ID__c = scheduleId, User__c = userId );
       
        insert reg;
       
        return null;
    }


Is there any other way that I can get this done.
Any help is appreciated. Thanks in advance.

Thanks,
DSV
  • November 24, 2008
  • Like
  • 0
Hi everyone,

I want to convert String into Integer so that I can filter data in my where clause of SOQL query.
I created a AutoNumber field on account object. In my SOQL query I want to get account objects 100 at a time into a list. So i did the following query.

Here is my query

// acc is a Account object

acc = [Select id from account a where ( a.AutoNum__c >= 1 and a.AutoNum__c < 100 )];

The problem is AutoNumber in salesforce is of type String. So I cant compare that field to integers 1 and 100. How can I achieve this.

Any example or syntax would help me. I know that valueOf can be used to convert string to integer, but how can i embed that into my SOQL query.

Thank you in advance.

its,
dsv
  • August 29, 2008
  • Like
  • 0
Hi,
I would like to access google maps through my visual force page.
I would like to know how to achieve this.

I'm new to sforce.

thanks in advance,
dsv
  • August 21, 2008
  • Like
  • 0
Hi All,

My requirement is to access the variable of repeat tag. My controller returns List < List<Trans__c> >. My repeat tag builds a pageblock section for each sublist. Data is being displayed fine, but I'm unable to access the repeat variable in the title of Pageblocksection.

here is sample data for more clarity on what I need.

     <apex:repeat value="{!Transcript}" var="subList" >             // My Controller returns List <List<Trans__c> > where Trans__c is my object.  
         
                <apex:pageBlockSection title=" ??? " columns="1" id="pbsTrans">
               
                    <apex:pageBlockTable value="{!subList}" var="trans" >

                         <apex:column value="{!trans.Activity_Title__c}"  />                                                 
                        
                          <apex:column value="{!trans.Year__c}" /> // I want this year to be displayed in the page block section TITLE
                  
                   </apex:pageBlockTable>
                  
              </apex:pageBlockSection>
           
           
            </apex:repeat> 

I tried returning Map<Integer, List<Trans__c > > from my controller where integer would be year. But in my repeat tag I did not know how to access the sublist and integer of the returned map obj for my page block table.

please let me know how I can get this achieved.

Thanks in Advance,
dvs

  • December 22, 2008
  • Like
  • 0
Hi,

I'm trying to call a action method in my controller through my java script code in the visualforce page. but my action method consists of 'Insert' DML statement and so I'm getting the following error.

System.Exception: DML currently not allowed. External entry point

here is a piece from my code.

<apex:page>

 <script type="text/javascript">

          function register(regId)
          {
          // I have some code to add regId to my query String. Then I call my action method in controller.  
             {!register};                          
          }
    </script>

< // some visual force component that calls Java script 'register' function />

</apex:page>

my action method code is as follows:

 public Pagereference getRegister()
     {
   
        scheduleId = System.currentPageReference().getParameters().get('schID'); // getting the query string added by my javascript method
        userId = UserInfo.getUserId();
        Registration__c reg = new
Registration__c(Activity_Schedule_ID__c = scheduleId, User__c = userId );
       
        insert reg;
       
        return null;
    }


Is there any other way that I can get this done.
Any help is appreciated. Thanks in advance.

Thanks,
DSV
  • November 24, 2008
  • Like
  • 0
Hello experts,

I'm trying to load a custom Apex Class I created in a sandbox into a production org.  I have downloaded Eclipse, and installed the Apex Eclipse Toolkit.  I was able to import all the apex stuff from my production org, but I can't export-- I am not seeing the force.com/deploy option for anything.  Is there another plug-in I must install?  Also, when I try to create a new 'package' (which I'm assuming are the classes), it says "unexpected token: package".  So I opened an existing package, copied the code I created in the sandbox, and did a 'save as' to save my file.  This all worked fine, but it won't let me run tests on it, or deploy it, or anything.  Please help!
hello all,

i've been reading the reference guide and tutrorials on using apex and i wanted to spread my wings to see what i could do.  i created 4 custom objects and have some psuedocode for the relationship between the objects.

my problem is that i can't see anywhere inside of the salesforce ui to associate a trigger with a custom object... only standard objects.

is apex triggers only for standard objects?
Hi everyone,

I want to convert String into Integer so that I can filter data in my where clause of SOQL query.
I created a AutoNumber field on account object. In my SOQL query I want to get account objects 100 at a time into a list. So i did the following query.

Here is my query

// acc is a Account object

acc = [Select id from account a where ( a.AutoNum__c >= 1 and a.AutoNum__c < 100 )];

The problem is AutoNumber in salesforce is of type String. So I cant compare that field to integers 1 and 100. How can I achieve this.

Any example or syntax would help me. I know that valueOf can be used to convert string to integer, but how can i embed that into my SOQL query.

Thank you in advance.

its,
dsv
  • August 29, 2008
  • Like
  • 0