• Abhishek Verma 34
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 7
    Replies
I am facing the same problem wherein I have a date field on a pop up and i dont want to use position:relative as while scrolling down I want to see the popup but for that the date picker remains at the top of the page while scrolling down. in case of using position:fixed.
I am facing the same problem wherein I have a date field on a pop up and i dont want to use position:relative as while scrolling down I want to see the popup but for that the date picker remains at the top of the page while scrolling down. in case of using position:fixed.
Dear all, 
I am trying to solve one of the Trailhead Challenges in the unit: Creating Test Data for Apex Tests and is giving me the following error:

Challenge Not yet complete... here's what's wrong: 
Executing the 'generateRandomContacts' method failed. Either the method does not exist, is not static, or did not return the correct set of Contact records.

The following is the code; 
public class RandomContactFactory {

    public static List<Contact> generateRandomContacts (integer nNumContacts, string sLastName)
    {
        List<Contact> lContactList = new List<Contact>();
        
        for(integer i=0; i<nNumcontacts; i++)
        {
            Contact c = new Contact(LastName= sLastName + ' ' +i);
            lContactList.add(c);

        }    
        return lContactList;
    }
    
}

What I need to solve is the following:

 Create an Apex class that returns a list of contacts based on two incoming parameters: one for the number of contacts to generate, and the other for the last name. The list should NOT be inserted into the system, only returned. The first name should be dynamically generated and should be unique for each contact record in the list.The Apex class must be called 'RandomContactFactory' and be in the public scope.
The Apex class should NOT use the @isTest annotation.
The Apex class must have a public static method called 'generateRandomContacts' (without the @testMethod annotation).
The 'generateRandomContacts' method must accept an integer as the first parameter, and a string as the second. The first parameter controls the number of contacts being generated, the second is the last name of the contacts generated.
The 'generateRandomContacts' method should have a return type of List<Contact>.
The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names.
For example, the 'generateRandomContacts' might return first names based on iterated number (i.e. 'Test 1','Test 2').
The 'generateRandomContacts' method should not insert the contact records into the database.

Can anyone help me? 

Thanks!

Bea

 
Hai guys,
The repeater must use the <li> HTML list tag
The repeater must use the apex:outputLink component to link to the respective record detail page
HINT: Record detail pages can be reached by placing a record ID at the root of the URL (e.g. '/<record id>').
how can i achieve it.
my vf page code is
<apex:page standardController="Account" recordSetVar="accounts">
  <apex:form >
  <apex:repeat value="{!accounts}" var="a">
 
  
 <li> <apex:outputLink value="/apex/AccountList?id=00128000005LpU9">
  
  {!Account.Name}
  
  </apex:outputLink>
</li>
  </apex:repeat>
  
  
  </apex:form>
</apex:page>
can any one help me

Hi,

 

I have a date input field in a popup window. Issue that i am facing is the date picker is not inligned with the text field. Could any one please address this issue

 

Thanks and Regards,

Neha

I am displaying the name of the asset on a page like this <apex:outputField id="CaseField3" value="{!Case.AssetId}"/>.

 

This displays the name of the asset as a link since this is a lookup relationship, therefore, the user can click on it and is taken to the asset page. I would like to prevent that from happening, is there a way to remove the hyperlink and just display the name? or at least don't do anything if the user clicks on the link ?

 

 

I need to display the owner field visualforce page pop up on the parent window,It is now displaying inside child window so it is some how hiding the pop up so please help me out in this issue below is the code for visual force page and controller

 

 

Page :

 

<apex:page standardController="Account" extensions="PopupTest" standardStylesheets="true">
 <!-- <apex:includeScript value="{!$Resource.JQuery}"/>-->
 <apex:form >
<style type="text/css">
      body {
        margin: 0;
        padding: 0;
        font-family: Arial, Helvetica, sans-serif;
        background: #000 url(bg-texture.png) repeat;
        color: #dddddd;
      }
     
           
      a {
        color: #EB067B;
      }
     
        
      /* HOVER STYLES */
      div#pop-up {
        display: none;
        z-index: 10;
        position: absolute;
        width: 200px;
        padding: 30px;
        background: #FFFFFF;
        color: #000000;
        border: 3px solid #C0C0C0;
        font-size: 100%;
      }
   
    </style>
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script
 <script type="text/javascript">
 
      $(function() {
        var moveLeft = 10;
        var moveDown = 5;
       
        $('a#trigger').hover(function(e) {
          $('div#pop-up').show();
                  }, function() {
          $('div#pop-up').hide();
        });
       
        $('a#trigger').mousemove(function(e) {
          $("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
        });
       
      });
    </script>

    <apex:repeat value="{!accounts}" var="acc">     
        <a href="/{!acc.ownerId}" id="trigger" >{!acc.Owner.Name}</a>.
  </apex:repeat>
    <!-- HIDDEN / POP-UP DIV -->
    <div id="pop-up">
      <div> <table> <tr>
                           <td>
                             <b>  Name  </b> :
                           </td>
                           <td >  
                             {!$User.FirstName} {!$User.LastName}<br/>
                           </td>
                     </tr>
                     <tr>
                           <td>
                               <b>  Role  </b> :
                           </td>
                           <td>  
                                {!$UserRole.Name}<br/>
                           </td>
                     </tr>
                     <tr>
                         <td>
                             <b>  Phone </b> :
                          </td>
                          <td> 
                              {!$User.Phone}<br/>
                          </td>
                     </tr>
                     <tr>
                         <td>
                           <b>  Email </b> :
                         </td>
                         <td>
                           {!$User.Email}<br/></td>
                     </tr>
                </table>
            </div>
    </div>
   </apex:form>
</apex:page>

 

Controller:

 

public with sharing class PopupTest {
    public PopupTest(ApexPages.StandardController controller) {

    }


    public String getOwner() {
        return null;
    }

 
    public List<account> getAccounts()
    {
        List<account> accounttList = new List<account>();
        accounttList = [Select Id, Name,ownerId,Owner.Name from Account LIMIT 1];
        return accounttList ;
    }

}

 

 

 

  • April 24, 2013
  • Like
  • 1

Hi,

 

I have a date input field in a popup window. Issue that i am facing is the date picker is not inligned with the text field. Could any one please address this issue

 

Thanks and Regards,

Neha