• S91084
  • NEWBIE
  • 370 Points
  • Member since 2012

  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 89
    Replies

Hello,

 

Is there a way to add the "Social Media Header" to a VF page? So the Account/Contact photo, Linkedin, Twitter, FB, etc. linking functions.

 

I did some investigation, and it looks like it uses an internal JS library called SocialCrm.js (However it's compiled and looks rather nasty). 

 

Maybe they're is a VF component, or component attribute im missing on the <apex:detail> component?

 

Thanks in advanced. 

I have a jquery grid that created and filled with data after a search is complete. When you click on a row another div is created to display more information. Inside the div with more info is a button that should redirect you to another page while passing an id as an argument. The problem I'm having is when I try to use the onClick of the button for a page redirect it returns undefined. I was able to  j$('#Edit_Asset').live('click', function(){ to finally recognize the element and do the event...the only problem I have with this is when i use window.opener.location.href=document.domain+'/apex/AS_AssetEdit_m?id='+id; it doesn't go to the new page, it stays on the same page and reloads another instance of it. Anyone have any idea what else I could usei n jQuery to redirect the page?

Here's the code

<script>
    var j$ = jQuery.noConflict();
    var Results_Div=j$('#Results_Grid');
    var Results_Grid_Header=j$('#Results_Grid_Header');
    var QFilter;
    var SearchString;
    var PowersCombined;
    var oldResultElement;
    var id;
    var com;
    var res;
    j$(function() {    
       Results_Div=j$('#Results_Grid');
       QFilter=j$('#Query_Filter').val();
       SearchString=j$('#SearchBox').val();
       PowersCombined=QFilter+'°'+SearchString;
                       
           j$('#Search_Submit').click(function(){
                   
                  QFilter=j$('#Query_Filter').val();
                  SearchString=j$('#SearchBox').val();
                  PowersCombined=QFilter+'°'+SearchString;

                  Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.AS_Viewer_m.getAssets}',
                  PowersCombined,
                  function(result, event)
                  { 
                      j$('#Results_Grid').children().remove();
                      id=result.id;
                      for(var b = 0; b < result.length; b++){
                          
                          j$('<div class="ui-grid-d" name="AssetGrid" id="AssetGrid'+result[b].Id+'" >'+
                              '<div class="ui-block-a"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Name+'</div></div>'+
                              '<div class="ui-block-b"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Model__r.Name+'</div></div>'+
                              '<div class="ui-block-c"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Serial_Number__c+'</div></div>'+
                              '<div class="ui-block-d"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].User+'</div></div>'+
                              '<div class="ui-block-d"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Acquisition_Date__c+'</div></div>'+
                              '<div id="AssetInfo'+result[b].Id+'" name="AssetInfo" style="width:1000px; margin:0 auto;"></div>'+
                            '</div>').appendTo(Results_Div);
                            
                      }
                            
                  },{escape: true});  
       
       });
       j$('#Results_Grid').on('click','div[name="AssetGrid"]', function(e) {
         j$('#DataDiv').empty().remove();

         if (oldResultElement!=null){
             j$(oldResultElement).children().remove();
            
         }

         var st=this.id;
         com='#AssetInfo'+st.substring(9);
         
         oldResultElement='#AssetInfo'+st.substring(9);

         Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.AS_Viewer_m.getAsset}',
            st.substring(9),
            function(result, event)
            {
             
             id=result.Id;

             if(result.RecordType.DeveloperName=='Infrastructure_Hardware'){

               j$('<div id="DataDiv" style="width:1000px; margin:0 auto;" style="width:1000px; margin:0 auto;">'+
               '<div style="width:500px;float:left;" id="MoData_LeftDiv">'+
               '<b>Asset Name: </b>'+result.Name+'<br/>'+
               '<b>Serial Number: </b>'+result.Serial_Number__c+'<br/>'+
               '<b>Model: </b>'+result.Model__r.Name+'<br/>'+
               '<b>Host Name: </b>'+result.Host_Name__c+'<br/>'+
               '<b>IP Address: </b>'+result.IP_Address__c+'<br/>'+
               '<b>MAC Address: </b>'+result.Mac_Address__c+'<br/>'+
               '<b>Comments: </b>'+result.Comments__c+'<br/>'+
               '</div>'+
               '<div style="float:left;width:300px;padding:0px 0px 0px 80px; id="MoData_MidDiv"">'+
               '<b>Account/Hospital: </b>'+result.Account_Hospital__c+'<br/>'+
               '<b>Date Lost/Stolen: </b>'+result.Date_Lost_Stolen__c+'<br/>'+
               '<b>Acquisition Date: </b>'+result.Acquisition_Date__c+'<br/>'+
               '<b>Decommission Date: </b>'+result.Decommission_Date__c+'<br/>'+
               '<b>Allocation: </b>'+result.User__c+'<br/>'+
               '</div>'+ 
               '<div style="width:80px;float:left;" id="MoData_RightDiv">'+
                      '<input type="image" src="{!URLFOR($Resource.Coquette, 'PNG/64x64/edit.png')}"  href="#" id="Edit_Asset"/><br/>'+
                      '<input type="image" src="{!URLFOR($Resource.Coquette, 'PNG/64x64/trash_can.png')}"  href="#" id="Delete_Asset"/>'+
               '</div>'+
               '<br style="clear:both;"/>'+
               '</div>').insertbefore(com);
               
                                                  
              }
            },{escape: true});
                           
        });

        j$('#Edit_Asset').live('click', function(){
            {!$Page.AS_AssetEdit_m}?id={!'+id+'}
            window.opener.location.href=document.domain+'/apex/AS_AssetEdit_m?id='+id;
        });
        

          
    });
   
</script> 

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
</head>
<apex:form >
<div data-role="header"> 
    <h1>Find Asset</h1> 
</div> 

<div id="Search_Div" class="Element_LeftAlign">
<input type="text" id="SearchBox" style="width:300px;display:inline;"/>
<button type="button" style="vertical-align:bottom;display:inline;" id="Search_Submit">Search</button>
    <select size="1" id="Query_Filter">
        <option value="00">--Please select--</option>
        <option value="01">Serial Number</option>
        <option value="02">Name</option>
        <option value="03">Allocated To</option>
        <option value="04">In Inventory</option>
    </select>
    <!--Make this a button that expands out-->
</div>
<div id="Results_Grid_Header" data-theme="d" style="display:inline;position:fixed;top:170px;">
<div class="ui-grid-d">
<div class="ui-block-a ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Name</b></div></div>
<div class="ui-block-b ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Model</b></div></div>
<div class="ui-block-c ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Serial Number</b></div></div>
<div class="ui-block-d ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Allocated To</b></div></div>
<div class="ui-block-e ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Acquisition Date</b></div></div>
</div>
<div id="Results_Grid" class="" style="overflow:auto;height:350px;">

</div>
</div>




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

 

  • September 19, 2012
  • Like
  • 0

Hey, I want to to read 7 digit no 

i tried with input text like

 <apex:inputtext value="{!phoneno}" id="no" size="7"/>

 it showing 7 digit width but accepting many.how can i restrict this field to 7 digits.

Hi,

In a table I placed two checkboxes yes and no .if i click yes then checkbox NOshould deselect(if it already selected).

if a click  checkbox  NO it should deselect YES.

Here is my vf page:

<table class="list" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes" immediate="true">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<apex:param name="checkyes" value="true" assignTo="{!yescheck}" />
</apex:actionSupport>
</apex:inputCheckbox>
</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno" immediate="true">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
</tbody>
</table>

 

the controller is:

public void highcapacity() {



if(prihighcapacity == true){
prinohighcapacity = false;
}

}

public void nohighcapacity(){


if(prinohighcapacity == true){
prihighcapacity = false;
}

}

 but it is not working as i expect if i click yes and then click no both are selecting .

we shuold select either one.any suggestion please.

Hai All,

 

I have one requirement, can we the get the Task list in Visualforce page?????

 

I have tried a lot but i couldnt find out the solution.

Here is the code. Im getting error as List Controllers are supported for Task

public with sharing class TaskPagination {
private final Task t;

public TaskPagination(ApexPages.StandardSetController controller) {
this.c = (Task)controller.getRecord();
}
public ApexPages.StandardSetController TaskRecords{
get {
if(TaskRecords == null) {
return new ApexPages.StandardSetController(Database.getQueryLocator(
[SELECT t.ActivityDate, t.Status FROM Task t]));
}
return TaskRecords;
}
private set;
}
public List<Task> getTaskPagination() {
return (List<Task>) TaskRecords.getRecords();
}
}

 Thanks in Advance..........

 

  • September 17, 2012
  • Like
  • 0

Hi guys and gals,

 

I am trying to wrap my head around actionSupport calls within VisualForce, and I keep getting this error:

java.lang.IllegalArgumentException: Illegal view ID

 

I scoured the web, various SFDC entries, and I still can't figure out why this error is happening. Any help would be greatly appreciated.

 

Thanks!

-Jeff

 

 

VisualForce Page:

 

<apex:page StandardController="Case" extensions="VistaCaseExtension">
    <apex:form>
        
        
        <apex:outputPanel id="counter">
            <apex:outputText value="Click Me!" />
            <apex:actionSupport event="onclick"  action="{!myTest}" rerender="counter2" status="refreshstatus" /> 
        </apex:outputPanel>  
        
        <apex:actionStatus id="refreshstatus" startstyle="color:green;" startText="Refreshing...."></apex:actionStatus>
          
        <apex:outputPanel id="counter2">
            <p>
            <apex:outputText value="I want to change!" />
            </p>
        </apex:outputPanel> 
              
    </apex:form>
    
</apex:page>

 

Apex Class

public class VistaCaseExtension {

    // Create extension hook
    private ApexPages.StandardController controller;
    
    String testRet = 'clicked... now what?';
    
    // Constructor
    public VistaCaseExtension(ApexPages.StandardController std){
        controller = std;
    }
    
    public void AccountPopulated() {
        Case cont=(Case) controller.getRecord();
        cont.Account=[select AccountNumber, Site, ShippingStreet from Account where id=:cont.AccountId];
    }    
    
    public String myTest(){
        return testRet;
    }  
    
    
}

 


I'm trying to create a List Button on a custom object (Test_Object__c) that is a related list to the Account object.  I've created the VF page and Controller below, but I do not get the option of adding it to a custom list button.  I am also trying to pre-populate a look-up field on Test_Object__c with the Account name.  Can anyone tell me what I am doing wrong? 

 

VF Page:

 

<apex:page standardController="Account" tabStyle="Account" extensions="TestController3">
   <apex:form >
   <apex:pageBlock >
       <apex:pageBlockSection columns="2">
            <apex:inputField value="{!L1.test1__c}"/>
            <apex:inputField value="{!L1.test2__c}"/>
            <apex:inputField value="{!L1.test3__c}"/>
       </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!Save}"/>
            <apex:commandButton value="Save and New" action="{!News}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
       </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

Controller:

 

public class TestController3{

    public Account acct{get;set;}
    public Level_1__c L1{get;set;}

    public TestController3(ApexPages.StandardController controller) {
    
        This.L1 = (Level_1__c)controller.getRecord();
    }
    public PageReference Save(){
        L1.Company_Name__c = acct.Name;
        insert L1;
        PageReference ref = new PageReference('/'+acct.id);
        return ref;
    }
    public PageReference News(){
        return null;
    }
    public PageReference Cancel(){
        return null;
    }
}

  • August 01, 2012
  • Like
  • 0

Trying to find a way around my previous testing problem I added this method to the test class:

static testMethod void testContributionSearchControllerDirect () {
      //instantiate a page     
     PageReference pg = Page.Contributions_Search_v9;
     // instantiate the controller
        ContributionsSearchController_v9 controller = new ContributionsSearchController_v9();
    // Plug in variable values
       controller.setcontributorFname('a');
       controller.setcontributorLname('z');
       controller.setMOC_Lname('g');
       controller.setsoqlLimitPage('limit 20');

 

The controller has this code between the class defn and the constructor:

   Public string contributorFname{
       get {return contributorFname; }
       set;
       }
   Public string contributorLname{
       get {return contributorLname; }
       set;
       }
   Public string MOC_Lname{
       get {return MOC_Lname; }
       set;
       }
   Public string soqlLimitPage{
       get {return soqlLimitPage; }
       set;
       } 


I get an error when I try to setContributorFname:
Error: Compile Error: Method does not exist or incorrect signature: [ContributionsSearchController_v9].setcontributorFname(String) at line 12 column 8. This is the line:

       controller.setcontributorFname('a');

 

I get the same error with the other lines if I comment out the first offender.

 

I'm baffled by this, I think I'm using the setter properly but clearly something is wrong. Thanks for any help.

 

....Bob

I have build a method to handle emailing in a class called TripRptManager.  I requires no parameters.  It is not functioning but returns no errors.  Any ideas.  Thanks 

 

 

An Excerp:

 

The call in the controller is TripRptManager sendEmail;

 

The class:

 

public with sharing class TripRptManager {

//===============================================================
//Public attributes
//===============================================================

//===============================================================
//Utility methods
//===============================================================
public class SendEmail {
public String subject {get; set;}
public String body {get; set;}
private final Account account;

public SendEmail() {

account = [SELECT Name,
( SELECT Contact.Name, Contact.Email
FROM Account.Contacts)
FROM Account
WHERE Id = :ApexPages.currentPage().getParameters().get('id')];

}

public Account getAccount() {
return account;
}

public PageReference send() {

Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();

PageReference pdf = Page.TripReportPDF;
pdf.getParameters().put('id', (String)Account.id);
pdf.setRedirect(true);

Blob b = pdf.getContent();

Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
efa.setFileName('TripReport.pdf');
efa.setBody(b);

String addresses;
if (account.Contacts[0].Email != null) {
addresses = account.Contacts[0].Email;

for (Integer i = 1; i < account.Contacts.size(); i++) {
if (account.Contacts[0].Email != null) {
addresses += account.Contacts[i].Email;
}
}
}

String[] toAddresses = addresses.split(':',0);

email.setSubject( subject );
email.setToAddresses( toAddresses );
email.setPlainTextBody( body );

email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

Messaging.SendEmailResult [] r =
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

return null;

}
}

Has anyone had success displaying video on a VF page by using the embed code from a CDN like Limelight? Here's the code they provide:

 

<span class="LimelightEmbeddedPlayer"><script src="http://assets.delvenetworks.com/player/embed.js"></script><object type="application/x-shockwave-flash" id="limelight_player_393753" name="limelight_player_393753" class="LimelightEmbeddedPlayerFlash" width="800" height="360" data="http://assets.delvenetworks.com/player/loader.swf"><param name="movie" value="http://assets.delvenetworks.com/player/loader.swf"/><param name="wmode" value="window"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="flashVars" value="deepLink=true&amp;playerForm=LVPPlayerHorizontalPlaylist&amp;channelId=59affe0988334bbb82412775fd75c62c"/></object><script>LimelightPlayerUtil.initEmbed('limelight_player_393753');</script></span>

 

The player shows up, but it doesn't play and the play button does nothing.

 

I'm sure I'm missing something and any bit of help would be appreciated.

Hi,

 

We are planning to implement FEDERATED SSO in our organization. I have enabled "My Domain" and mentioned to use "SAML IPD" authentication service so that whenever users click the domain url they will be redirected to the Identity Provider Login URL. As an admin I am able o login using the login.salesforce.com URl, but if I check the 'Prevent login from login.salesforce.com' checkbox, then I am not able to login to Salesforce either by using my domain URL appended by /?login=1 or through login.salesforce.com. My question is, If I check the checkbox and something happens to ADFS server then I wont be able to login to salesforce as an admin also. Is there a workaround for this? When ADFS identity fails, how will an admin login to salesforce to disable login from Identity Provider?

 

Thanks in advance.

 

 

  • January 16, 2013
  • Like
  • 0

If Account A is the Child of Account B, and contact A creates a case under Account A, Then when contact A of Account B logs in to the customer portal, he/she must see the cases created under Account A and Account B.

 

Can anyone suggest me how to do this. Thanks in Advance.

  • December 12, 2012
  • Like
  • 0

Hi ,

 

I am trying to create a public group membership through Apex from the cutomer portal. When I login to the portal as an admin and run the Apex Code, it is adding me to the public group. If I login to the portal with Salesforce cutomer portal ser, it is not working as expected. I know this is because only admin can creat/edit public groups and its members. But is there way that while creating the group through Apex, I can run that peice of code in the context of System Administrator?

 

Any Help?

 

Thanks in Advance.

  • September 14, 2012
  • Like
  • 0

Does Salesforce has any limit on creating the number of public groups

 

Manage --> Public Groups

  • September 13, 2012
  • Like
  • 0

Hi .

I have created a visualforce email template and using it in the workflow email  alert. When i test the template it works fine. But when I test it with a different user wh o is not admin, i am seeing blank emails. Any ideas of why this is causing an issue?

  • September 05, 2012
  • Like
  • 0

Hi,

 

I am trying to create a twitter feed or post when a record is created in salesforce. When evenr user saves a record, i would like to post that as a twitter feed or post to one of the twitter account.

 

Does salesforce support this?

  • August 07, 2012
  • Like
  • 0

Hi,


I am a certified salesforce developer and administrator with 2+ years of experience and has proficient knowledge on J2EE technologies and looking for a full-time position anywhere in United States. Please let me know if you have any positions available at your client place.

  • March 08, 2012
  • Like
  • 0

Hi,

 

I am trying to display the articles based on the product selected by the user that matches the software on the article.

Below is my code. I have articles that match the below criteria but not able to get the results. It is returning 0 rows.

 

public List<KnowledgeArticleVersion> getArticles(){
User u = [Select Id, Product__c, Industry__c from User where Id=:userinfo.getUserId()];
String[] Product = u.Product__c.split(';');
List<Problem__Kav> problems = [Select Id,KnowledgeArticleId,Software__c from Problem__Kav where Software__C IN :Product and PublishStatus='Online' and Language='en_US'];
if(!problems.isEmpty()){
    for(Problem__Kav p : problems)
       articleIds.add(p.KnowledgeArticleId);
}
List<KnowledgeArticleVersion> technicalarticles=[Select ArticleNumber, UrlName, Title,KnowledgeArticleId, CreatedDate, CreatedById From KnowledgeArticleVersion where PublishStatus='Online' and Language='en_US'and KnowledgeArticleId IN :articleIds order by LastPublishedDate desc];
return technicalarticles;
}

 Can anyone please help me on this.

 

If i am removing the filter Software__c IN :Product, I am getting the results.

 

  • February 29, 2012
  • Like
  • 0

I am trying to display the service contract in the customer portal. I am using a visulaforce page and queried fileds from service contract but not able to display them on the page. I have checked the object-level, field-level permissions but could not get the list onto the page. Can anyone help me on this.

Thanks in advance.

  • February 03, 2012
  • Like
  • 0

Hi,

 

We are planning to implement FEDERATED SSO in our organization. I have enabled "My Domain" and mentioned to use "SAML IPD" authentication service so that whenever users click the domain url they will be redirected to the Identity Provider Login URL. As an admin I am able o login using the login.salesforce.com URl, but if I check the 'Prevent login from login.salesforce.com' checkbox, then I am not able to login to Salesforce either by using my domain URL appended by /?login=1 or through login.salesforce.com. My question is, If I check the checkbox and something happens to ADFS server then I wont be able to login to salesforce as an admin also. Is there a workaround for this? When ADFS identity fails, how will an admin login to salesforce to disable login from Identity Provider?

 

Thanks in advance.

 

 

  • January 16, 2013
  • Like
  • 0

If Account A is the Child of Account B, and contact A creates a case under Account A, Then when contact A of Account B logs in to the customer portal, he/she must see the cases created under Account A and Account B.

 

Can anyone suggest me how to do this. Thanks in Advance.

  • December 12, 2012
  • Like
  • 0

Hello,

 

Is there a way to add the "Social Media Header" to a VF page? So the Account/Contact photo, Linkedin, Twitter, FB, etc. linking functions.

 

I did some investigation, and it looks like it uses an internal JS library called SocialCrm.js (However it's compiled and looks rather nasty). 

 

Maybe they're is a VF component, or component attribute im missing on the <apex:detail> component?

 

Thanks in advanced. 

Hello,

 

I am trying to add a logic to have the pop up dispalyed on the custom VF when it closes. I came to know that the popup display when the CF page is closed is out of box solution in salesforce.

 

I tried using the Java script onclick event with no luck & kind of lost. Can anyone who came across such requirement help me.

 

Thanks.

I have a jquery grid that created and filled with data after a search is complete. When you click on a row another div is created to display more information. Inside the div with more info is a button that should redirect you to another page while passing an id as an argument. The problem I'm having is when I try to use the onClick of the button for a page redirect it returns undefined. I was able to  j$('#Edit_Asset').live('click', function(){ to finally recognize the element and do the event...the only problem I have with this is when i use window.opener.location.href=document.domain+'/apex/AS_AssetEdit_m?id='+id; it doesn't go to the new page, it stays on the same page and reloads another instance of it. Anyone have any idea what else I could usei n jQuery to redirect the page?

Here's the code

<script>
    var j$ = jQuery.noConflict();
    var Results_Div=j$('#Results_Grid');
    var Results_Grid_Header=j$('#Results_Grid_Header');
    var QFilter;
    var SearchString;
    var PowersCombined;
    var oldResultElement;
    var id;
    var com;
    var res;
    j$(function() {    
       Results_Div=j$('#Results_Grid');
       QFilter=j$('#Query_Filter').val();
       SearchString=j$('#SearchBox').val();
       PowersCombined=QFilter+'°'+SearchString;
                       
           j$('#Search_Submit').click(function(){
                   
                  QFilter=j$('#Query_Filter').val();
                  SearchString=j$('#SearchBox').val();
                  PowersCombined=QFilter+'°'+SearchString;

                  Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.AS_Viewer_m.getAssets}',
                  PowersCombined,
                  function(result, event)
                  { 
                      j$('#Results_Grid').children().remove();
                      id=result.id;
                      for(var b = 0; b < result.length; b++){
                          
                          j$('<div class="ui-grid-d" name="AssetGrid" id="AssetGrid'+result[b].Id+'" >'+
                              '<div class="ui-block-a"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Name+'</div></div>'+
                              '<div class="ui-block-b"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Model__r.Name+'</div></div>'+
                              '<div class="ui-block-c"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Serial_Number__c+'</div></div>'+
                              '<div class="ui-block-d"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].User+'</div></div>'+
                              '<div class="ui-block-d"><div class="ui-bar ui-bar-e" style="height:20px;width:200px">'+result[b].Acquisition_Date__c+'</div></div>'+
                              '<div id="AssetInfo'+result[b].Id+'" name="AssetInfo" style="width:1000px; margin:0 auto;"></div>'+
                            '</div>').appendTo(Results_Div);
                            
                      }
                            
                  },{escape: true});  
       
       });
       j$('#Results_Grid').on('click','div[name="AssetGrid"]', function(e) {
         j$('#DataDiv').empty().remove();

         if (oldResultElement!=null){
             j$(oldResultElement).children().remove();
            
         }

         var st=this.id;
         com='#AssetInfo'+st.substring(9);
         
         oldResultElement='#AssetInfo'+st.substring(9);

         Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.AS_Viewer_m.getAsset}',
            st.substring(9),
            function(result, event)
            {
             
             id=result.Id;

             if(result.RecordType.DeveloperName=='Infrastructure_Hardware'){

               j$('<div id="DataDiv" style="width:1000px; margin:0 auto;" style="width:1000px; margin:0 auto;">'+
               '<div style="width:500px;float:left;" id="MoData_LeftDiv">'+
               '<b>Asset Name: </b>'+result.Name+'<br/>'+
               '<b>Serial Number: </b>'+result.Serial_Number__c+'<br/>'+
               '<b>Model: </b>'+result.Model__r.Name+'<br/>'+
               '<b>Host Name: </b>'+result.Host_Name__c+'<br/>'+
               '<b>IP Address: </b>'+result.IP_Address__c+'<br/>'+
               '<b>MAC Address: </b>'+result.Mac_Address__c+'<br/>'+
               '<b>Comments: </b>'+result.Comments__c+'<br/>'+
               '</div>'+
               '<div style="float:left;width:300px;padding:0px 0px 0px 80px; id="MoData_MidDiv"">'+
               '<b>Account/Hospital: </b>'+result.Account_Hospital__c+'<br/>'+
               '<b>Date Lost/Stolen: </b>'+result.Date_Lost_Stolen__c+'<br/>'+
               '<b>Acquisition Date: </b>'+result.Acquisition_Date__c+'<br/>'+
               '<b>Decommission Date: </b>'+result.Decommission_Date__c+'<br/>'+
               '<b>Allocation: </b>'+result.User__c+'<br/>'+
               '</div>'+ 
               '<div style="width:80px;float:left;" id="MoData_RightDiv">'+
                      '<input type="image" src="{!URLFOR($Resource.Coquette, 'PNG/64x64/edit.png')}"  href="#" id="Edit_Asset"/><br/>'+
                      '<input type="image" src="{!URLFOR($Resource.Coquette, 'PNG/64x64/trash_can.png')}"  href="#" id="Delete_Asset"/>'+
               '</div>'+
               '<br style="clear:both;"/>'+
               '</div>').insertbefore(com);
               
                                                  
              }
            },{escape: true});
                           
        });

        j$('#Edit_Asset').live('click', function(){
            {!$Page.AS_AssetEdit_m}?id={!'+id+'}
            window.opener.location.href=document.domain+'/apex/AS_AssetEdit_m?id='+id;
        });
        

          
    });
   
</script> 

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
</head>
<apex:form >
<div data-role="header"> 
    <h1>Find Asset</h1> 
</div> 

<div id="Search_Div" class="Element_LeftAlign">
<input type="text" id="SearchBox" style="width:300px;display:inline;"/>
<button type="button" style="vertical-align:bottom;display:inline;" id="Search_Submit">Search</button>
    <select size="1" id="Query_Filter">
        <option value="00">--Please select--</option>
        <option value="01">Serial Number</option>
        <option value="02">Name</option>
        <option value="03">Allocated To</option>
        <option value="04">In Inventory</option>
    </select>
    <!--Make this a button that expands out-->
</div>
<div id="Results_Grid_Header" data-theme="d" style="display:inline;position:fixed;top:170px;">
<div class="ui-grid-d">
<div class="ui-block-a ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Name</b></div></div>
<div class="ui-block-b ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Model</b></div></div>
<div class="ui-block-c ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Serial Number</b></div></div>
<div class="ui-block-d ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Allocated To</b></div></div>
<div class="ui-block-e ui-li-count"><div class="ui-bar ui-bar-e" style="height:20px;width:200px"><b>Acquisition Date</b></div></div>
</div>
<div id="Results_Grid" class="" style="overflow:auto;height:350px;">

</div>
</div>




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

 

  • September 19, 2012
  • Like
  • 0

Hi 

 

Facet not working on my table and I can not find how to make the first column  looks as a saleforce row header...

Thanks for your help

 

 

<apex:pageBlock >


<apex:pageBlockSection collapsible="true" title="table 1" columns="1">
<apex:PageBlockTable columns="{!colLabels.size+1}"
rows="{!rowLabels.size+1}" value="{!LBItems}" var="it">

<apex:column >
<apex:outputlabel value="{!it.rowlabel}" / >
</apex:column>

<apex:repeat value="{!it.rowBoxIt}" var="rbi">
<apex:column >
<apex:facet name="header" >{!rbi.colLabel}
</apex:facet>
<apex:outputlabel value="{!rbi.name}" / >
</apex:column>

</apex:repeat>

</apex:PageBlockTable>
</apex:pageBlockSection>

  • September 19, 2012
  • Like
  • 0

In my case object there is a custom button called future change request as a related list. This custom object ( future change request) has a new standard button. My requirement is when i click this new button it should open up a page in new tab or window. so that i can get the info  from the case object and paste it into future change request. Please help me on it.

Hi Guys,

 

Is it possible to display the vf page on the external website and the functionalty should work.

 

suppose if i click a link on external website, it has to bring our vf page into that external site and has to display some info

particular to that link.

 

Please Anybody have idea...

Urgent

 

Thanks,

Bujji

  • September 18, 2012
  • Like
  • 0

i have one visual force page which is used to render a pdf,and i created one more visualforce page2 which is used to show table data in VF1 ,i want to bring VF2 in VF1,i have used iframe it is not working

  • September 18, 2012
  • Like
  • 0

Hi, Iam trying to place some checkboxes and trying to read those values in modal popup window, but my page is not recognising the actions.

Here is my code

<apex:outputPanel id="priModalPanelWrap" rendered="{!ap.pg.name == 'PRI Services'}">
<a href="#" id="modalButton{!p.b.Id}" class="actionLink">Select</a>

<apex:outputPanel rendered="{!ap.pg.name == 'PRI Services'}" >
<div id="theModal{!p.b.Id}" class="reveal-modal medium" style="width:320px;" >


<div style="line-height:18px; margin:0 0 20px; padding:0; border:0; font-weight:bold; font-size:13px; font-style:normal; text-align:left; display:block;">
<label style="font-size:14px;">Will this PRI be:</label>
<br />
<table border="1">
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<!-- <apex:param name="selectedproductid" value="{!ap.pg.id}" assignTo="{!selectedproductid}" />-->
</apex:actionSupport>
</apex:inputCheckbox>

</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
<!--<apex:param name="selectedSiteABuildSiteId" value="{!epl.bs.Id}" assignTo="{!selectedSiteABuildSiteId}" />-->
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
<tr>

</tr>
</table>

</div>

<a class="close-reveal-modal">&#215;</a>
<apex:commandButton value="Submit" action="{!prioptions}"/>

</div>
</apex:outputPanel>

<script type="text/javascript">
jQuery(document).ready(function(jQuery) {
jQuery('#modalButton{!p.b.Id}').click(function(e) {
e.preventDefault();
jQuery('#theModal{!p.b.Id}').reveal();
});
});
</script>


</apex:outputPanel>

 

in the controller:

 

public string selectedproductid {get;set;}
public boolean prihighcapacity {get;set;}
public boolean prinohighcapacity {get;set;}

public void highcapacity() {


system.debug('we are in highcapacity module');
if(prihighcapacity == true){
prinohighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}

public void nohighcapacity(){

system.debug('we are in non-high capacity module');
if(prinohighcapacity == true){
prihighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}


public void prioptions() {

system.debug('in pri options method');

}

 

 

when i execute my page , when i click yes or no, it is not executing the actions and not displaying system.debug messages.

is it not possible to place checkboxses in modal window?

Hello,


I am creating a multiple file upload, one of the thing that is failing for me is "Calling controller method from javascript, Golbal Remote call for is not working"

So I created a simple example to test and that not working either, Here is my Controller class and page, Its not showing me a alert on page load.  What am I doing wront here ?

Class
===========

global with sharing class myControllerTest {
    
    @RemoteAction
    global static String getID(String parentId){
        return parentId;
    }
}




Page
============

<apex:page >
<head>
   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"/>
   <script type="text/javascript">
     j$=jQuery.noConflict();
     
     myControllerTest.getID('Hello Salesforce', function(result,event){
        if(event.status == true){
            alert(result);
        }else{
            alert(event.message);
        }
    }, {escape: false});
   </script>
</head>   
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  <!-- End Default Content REMOVE THIS -->
</apex:page>

Hai All,

 

I have one requirement, can we the get the Task list in Visualforce page?????

 

I have tried a lot but i couldnt find out the solution.

Here is the code. Im getting error as List Controllers are supported for Task

public with sharing class TaskPagination {
private final Task t;

public TaskPagination(ApexPages.StandardSetController controller) {
this.c = (Task)controller.getRecord();
}
public ApexPages.StandardSetController TaskRecords{
get {
if(TaskRecords == null) {
return new ApexPages.StandardSetController(Database.getQueryLocator(
[SELECT t.ActivityDate, t.Status FROM Task t]));
}
return TaskRecords;
}
private set;
}
public List<Task> getTaskPagination() {
return (List<Task>) TaskRecords.getRecords();
}
}

 Thanks in Advance..........

 

  • September 17, 2012
  • Like
  • 0

I'm working on making a section on the quotes page layout that displays some aggregated data for quote line item categories, that will display as a table. With the family on the left and then four columns of data, with five rows of categories and then two charts on the left. I tried using columns but that didn't work well, and now I'm using pageblocksection tags and items to lay it out and it worked well, but then I added a second row and the spacing got messed up. 

 

This is the markup I'm working with now and what it looks like now, ideally the chart would display on the right with the data all being aligned and spaced on the right. I'm still relatively new to using visualforce, I'm good with css and html for markup, I've tried using the built in style on the visualforce tags in a few ways and just using internal css but I haven't found the right way to style this. 

 

I'm sure this is just me approaching this the wrong way and using the wrong tags for my use case. Hopefully someone can enlighten me with the right approach :]

 

<apex:page standardController="Quote">
    <style type="text/css">
        .label{
            font-size: 18px;
            text-decoration: underline;
        }
        .section{
            width: 50%;
            
        }
        .text{
            font-size: 18px;
        }
        </style>
        <apex:pageBlock >
            <apex:pageBlockSection columns="5" id="section">
            
            <!--Video Line-->
                <apex:pageBlockSectionItem dataStyle="width:5%">
                    <apex:outputLabel styleClass="label" >Redemption</apex:outputLabel>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%">
                    <apex:outputText value="{!Quote.Redemption_Quantity__c}" styleClass="text" />
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%" >
                    <apex:outputText value="{0,number,##.##}%" styleClass="text">
                       <apex:param value="{!Quote.Redemption_Percentage__c}" />
                     </apex:outputText>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSEctionItem dataStyle="width:10%">
                      <apex:outputText value="12345.34" styleClass="text"/>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%">
                    <apex:outputText value="12345.34" styleClass="text"/>
                </apex:pageBlockSectionItem>
            
            <!--Video Line-->
                <apex:pageBlockSectionItem dataStyle="width:10%">
                    <apex:outputLabel styleClass="label" >Video</apex:outputLabel>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%">
                    <apex:outputText value="{!Quote.Video_Quantity__c}" styleClass="text" />
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%" >
                    <apex:outputText value="{0,number,##.##}%" styleClass="text">
                       <apex:param value="{!Quote.Video_Percentage__c}" />
                     </apex:outputText>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSEctionItem dataStyle="width:10%">
                      <apex:outputText value="12345.34" styleClass="text"/>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem dataStyle="width:10%">
                    <apex:outputText value="12345.34" styleClass="text"/>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem >
                              <apex:outputText value="{!Quote.QuantityChart__c}" escape="false" label=""/>
                </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
        </apex:pageBlock>
</apex:page>

 

 

 

 

 

 

I am performing sosl queries to return knowledge articles similar to this.

 

find {test} IN ALL FIELDS RETURNING KnowledgeArticleVersion ( id,title, urlName where publishStatus='online' and language='en_US')

 

How can I find out what type of article each result is? 

 

I don't want to have the sosl return a seperate list for each article type as I would like to keep the articles ranked based on the search term as stronly as possible. I'm only interested in a max of 5 returned records and I have 5 article types.

 

I can't find a good solution to this. Two possible solutions

 

1) for each id returned, query each article type to see if a record is returned

SELECT count() FROM faq__kav where id = 'ka4S0000000CaTSIA0'

...

SELECT count() FROM documentation__kav where id = 'ka4S0000000CaTSIA0'

 

So if I'm returning 5 records in my sosl, I could have up to 25 soql queries if I have 5 article types.

 

2) query knowledgeArticleVersion and the individual article Types in sosl. Take the list of knowledgeArticleVersions and then iterate through the other lists to see which articleType list it belongs to.

 

find {test} IN ALL FIELDS RETURNING KnowledgeArticleVersion ( id,title, urlName where publishStatus='online' and language='en_US'), faq__kav (id), documentation__kav(id)...

 

Is there a better way that I'm missing?

 

Thanks,.

 

We're interested in automating the article assignment process via Apex.

 

How can we access the "Assigned To" and "Assigned By" fields (if they are fields) for articles in a draft status? We can't see these fields on the KAV object, or really anywhere in the ERD (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_guidelines_knowledge.htm).

 

Can we read or write this parameter?

  • August 11, 2011
  • Like
  • 0

Hi,

 

I want to create a rollup field in Account Object with Opportunity Amount. Can any one help me on this, Actually i'm new in  trigger.