• Pablo_Roldan
  • NEWBIE
  • 75 Points
  • Member since 2014
  • Technical Architect
  • Mavens

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 41
    Replies

Hi, 

  I added a button on Asset tab which will call visualforce page. Inside visualforce page i am calling a apex controller which has a SOQL query based on AccountId

  Assets are associted to Account. I am using below method to pass AccountId from Asset Page but its not working. Please suggest me how to change. 

public class renewal_Asset
{
    public renewal_Asset(ApexPages.StandardController Ast ) {
     this();
    }

  
    public List<Asset> Ast {get;set;}
    public renewal_Asset()
    {
    String AstId = ApexPages.currentPage().getParameters().get('AccountId');
   
        Ast = [SELECT Name,SerialNumber,Product2Id,SLA_End_Date__c,AccountId
               FROM Asset
               WHERE Id = :AstId ];
    }   
   
  
}

Thanks

Sudhir

“Have been trying to learn Javascript Remoting since hours. I have manipulated this example to display a table of records with remoting an apex class. Following is the controller and VF.. My controller pulls all records from custom object Feedback. But i'm unable to display in VF. Please guide.

global with sharing class AccountRemoter {

public String accountName { get; set; }
public Feedback__c account { get; set; }
public AccountRemoter() { }

@RemoteAction
global static List<Feedback__c> getAccount(String accountName) {
List<Feedback__c> account = [SELECT Name FROM Feedback__c ];
return account;
}
}
and the Visualforce page...

<apex:page controller="AccountRemoter">
<script type="text/javascript">
function getRemoteAccount() {
    var accountName = document.getElementById('acctSearch').value;

    Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.AccountRemoter.getAccount}',
        accountName,
        function(result, event){
            if (event.status) {
                // Get DOM IDs for HTML and Visualforce elements like this
                document.getElementById('remoteAcctId').innerHTML = result.Id
                document.getElementById(
                    "{!$Component.block.blockSection.secondItem.acctNumEmployees}"
                    ).innerHTML = result.NumberOfEmployees;
            } else if (event.type === 'exception') {
                document.getElementById("responseErrors").innerHTML =
                    event.message + "<br/>\n<pre>" + event.where + "</pre>";
            } else {
                document.getElementById("responseErrors").innerHTML = event.message;
            }
         },
         {escape: true}
     );
   }
  </script>

    <input id="acctSearch" type="text"/>
    <button onclick="getRemoteAccount()">Get Feedbacks</button>
    <div id="responseErrors"></div>

    <apex:pageBlock id="block">
    <apex:pageBlockSection id="blockSection" columns="2">
        <apex:pageBlockSectionItem id="firstItem">
            <span id="remoteAcctId"/>
        </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem id="secondItem">
            <apex:outputText id="acctNumEmployees"/>
        </apex:pageBlockSectionItem>
    </apex:pageBlockSection>
   </apex:pageBlock>
   </apex:page>
The closest to a table on click of the "Get Feedback" button, I have achieved so far with undefined results.... enter image description here

Any help will be appreciated. Thanks

UPDATE: Fields in Feedback

Client_Feedback_App__c

Description__c

Importance__c

Resolution__c

Status__c

Summary__c
  • April 15, 2014
  • Like
  • 0
Hi everyone,

Has someone else problems creating new developer instance from https://developer.salesforce.com/signup?d=70130000000td6N ??
It tells me all names already taken...

Thank you,
Pablo
Hi all,

I want to include MetadataService in my managed package, the problem is when I tried to install this package in another instance of salesforce.
I mean, when I created this package I did in eu2.salesforce.com, although I tried to install it in na15.salesforce.com. So my remote site doesn't work with different instances, because the metadata is inside the salesforce.

So does anyone know any way to include the remote site for any salesforce instance?

Thanks in advance,
Pablo.
Hi All,

I am exploring the possibilities with the reports and metadata. However I didn't find anything about deploy reports into salesforce
I have tried something similar to deploy apexclasses, although it doesn't work...

APEX CLASS:


MetadataService.MetadataPort service = createService();                               
 
 MetadataFiles = new List<MetadataFile>();
 MetadataFile metaDataFile = new MetadataFile();
        metaDataFile.fullName = 'MyReportFolder/MyNewReportMetadata';
        metaDataFile.content = '<?xml version="1.0" encoding="UTF-8"?>' +
        '<Report xmlns="http://soap.sforce.com/2006/04/metadata">' +
            '<chart>' +
                '<backgroundColor1>#FFFFFF</backgroundColor1>' +
                '<backgroundColor2>#FFFFFF</backgroundColor2>' +
                '<backgroundFadeDir>Diagonal</backgroundFadeDir>' +
                '<chartSummaries>' +
                    '<axisBinding>y</axisBinding>' +
                    '<column>RowCount</column>' +
                '</chartSummaries>' +
                '<chartType>HorizontalBar</chartType>' +
                '<enableHoverLabels>false</enableHoverLabels>' +
                '<expandOthers>true</expandOthers>' +
                '<groupingColumn>Contact$Id</groupingColumn>' +
                '<location>CHART_TOP</location>' +
                '<showAxisLabels>true</showAxisLabels>' +
                '<showPercentage>false</showPercentage>' +
                '<showTotal>false</showTotal>' +
                '<showValues>false</showValues>' +
                '<size>Medium</size>' +
                '<summaryAxisRange>Auto</summaryAxisRange>' +
                '<textColor>#000000</textColor>' +
                '<textSize>12</textSize>' +
                '<titleColor>#000000</titleColor>' +
                '<titleSize>18</titleSize>' +
            '</chart>' +
            '<columns>' +
                '<field>Contact$Id</field>' +
            '</columns>' +
            '<columns>' +
                '<field>Contact$Name</field>' +
            '</columns>' +
            '<columns>' +
                '<field>Contact$Email</field>' +
            '</columns>' +
            '<columns>' +
                '<field>Contact$Phone</field>' +
            '</columns>' +
            '<description>My test report metadata</description>' +
            '<filter>' +
                '<criteriaItems>' +
                    '<column>Contact$Name</column>' +
                    '<operator>start with</operator>' +
                    '<value>p</value>' +
                '</criteriaItems>' +
            '</filter>' +
            '<format>Summary</format>' +
            '<groupingsDown>' +
                '<dateGranularity>Day</dateGranularity>' +
                '<field>Contact$Id</field>' +
                '<sortOrder>Asc</sortOrder>' +
            '</groupingsDown>' +
            '<name>MyNewReportMetadata</name>' +
            '<params>' +
                '<name>co</name>' +
                '<value>1</value>' +
            '</params>' +
            '<reportType>Goals__c</reportType>' +
            '<scope>team</scope>' +
            '<showDetails>true</showDetails>' +
            '<timeFrameFilter>' +
                '<dateColumn>Contact$CreatedDate</dateColumn>' +
                '<interval>INTERVAL_CUSTOM</interval>' +
            '</timeFrameFilter>' +
        '</Report>';
  MetadataFiles.add(metaDataFile);
  metaDataFile = new MetadataFile();
        metaDataFile.fullName = 'package.xml';
  metaDataFile.content = '<?xml version="1.0" encoding="UTF-8"?>' +
        '<Package xmlns="http://soap.sforce.com/2006/04/metadata">' +
            '<types>' +
                '<members>MyReportFolder/MyNewReportMetadata</members>' +
                '<name>Report</name>' +
            '</types>' +
            '<version>29.0</version>' +
        '</Package>';
        MetadataFiles.add(metaDataFile);



Any idea?
Thanks in advance,
Pablo

Hi all,

I want to include MetadataService in my managed package, the problem is when I tried to install this package in another instance of salesforce.
I mean, when I created this package I did in eu2.salesforce.com, although I tried to install it in na15.salesforce.com. So my remote site doesn't work with different instances, because the metadata is inside the salesforce.

So does anyone know any way to include the remote site for any salesforce instance?

Thanks in advance,
Pablo.
Hi everyone,

Has someone else problems creating new developer instance from https://developer.salesforce.com/signup?d=70130000000td6N ??
It tells me all names already taken...

Thank you,
Pablo
Hi All,
I am getting some un expected characters in word document some thing like below.

•Hospital
•Clinic
•Nursing Home
•CRO

I tried all possible ways to get rid of this issue but no use.Can any one please help me out to sort out this issue.
Follwoing is my visualforce code:
<apex:page standardcontroller="Business_Requirement__c" standardStylesheets="false" showheader="false" contentType="application/rtf;charset=ISO-8859-1#Word_Document.doc" extensions="GenerateReport_BR" cache="true">
    <html xmlns:w="urn:schemas-microsoft-com:office:word">
    <apex:outputText value="{!PrintView}" escape="false"/>
    <body>
    <h2>Business Requirement</h2> 
    <h3>This section of the User Requirement Specification contains all of the business requirements of the system.
    These requirements are written at a level of detail sufficient to enable designers to design a system that will
    satisfy those requirements and testers to test that the system satisfies those requirements.
    (Static from one of the field from Release Plan)</h3>
    <table width="100%" border="1" cellspacing="0" cellpadding="0" >
            <tr>
                <th>BR#</th>
                <th>Requirement Summary</th>
                <th>Use Case</th>
            </tr>
            <tr>
                <td>{!CMAX__Business_Requirement__c.Name}</td>
                <td><apex:outputtext escape="false" value="{!CMAX__Business_Requirement__c.CMAX__Business_Requirements_Summary__c}"/></td>
                <td><apex:outputtext escape="false" value="{!CMAX__Business_Requirement__c.CMAX__Use_Case__c}"/></td>
            </tr>
    </table>
</body>
     </html>
   
</apex:page>
  • April 22, 2014
  • Like
  • 0
Hello all,

Is anyone elkse having problems while developing on cs18?
Salesforce in the browser works fine, but all interactions from eclipse end up in timeouts.
This happens for all projects(multiple customers) that connect to cs18.

This isn't the first time this happens. It should be the 4th time or so now(in the past 2 months).

trust.salesforce.com doesn't show any errors..

Regards,

Jordi

Hi

Please give me a way to come out over this- 

I want to delete a tab which is now managed.

Thank You

 

trigger createcontact on student_profile__c (after insert) { 
    List<contact> listcontact = new List<contact>();
  for (Student_Profile__c oStudent : trigger.new) {      
contact oContact = new contact();
   oContact.AccountId = oStudent.Current_Institution__c;
   oContact.firstName = oStudent.First_Name__c;
    oContact.LastName =oStudent.Last_Name__c;
    oContact.Attendance_Points__c = oStudent.Attendance_Points__c;
    oContact.Birthday__c = oStudent.Birthday__c;
    oContact.City__c = oStudent.City__c;
    oContact.Country__c = oStudent.Country__c;
    oContact.Course_Program__c = oStudent.Course_Program__c;
    oContact.Course_Name__c = oStudent.Course_Name__c;
    oContact.Course_No__c = oStudent.Course_No__c;
 
    oContact.imageURL__c = oStudent.imageURL__c;
    oContact.Institution_Name__c = oStudent.Institution_Name__c;
  
   oContact.Student_ID__c=ostudent.Student_ID__c;
    oContact.Mentor_Points__c = oStudent.Mentor_Points__c;
    oContact.Mentor_Points_2__c = oStudent.Mentor_Points_2__c;



        listcontact.add(oContact);
    }

    if (listcontact.isEmpty() == false) {
        Database.insert(listcontact);
    }

here student.Student_ID__c is unique  custom ffield,  Now i can insert a record in a contact but I cant update it.. Means if i make any changes in custom object record then it not poulating in contact object record,,,

Please help me to update a contact records on change a change of custom record. ,,
Hi All,

I am trying to iterate the apex:repeat with value of picklist.
what I mean is........... If I select 3 from picklist, apex:repeat must iterate only 3 times only.
Please help me

Hi, 

  I added a button on Asset tab which will call visualforce page. Inside visualforce page i am calling a apex controller which has a SOQL query based on AccountId

  Assets are associted to Account. I am using below method to pass AccountId from Asset Page but its not working. Please suggest me how to change. 

public class renewal_Asset
{
    public renewal_Asset(ApexPages.StandardController Ast ) {
     this();
    }

  
    public List<Asset> Ast {get;set;}
    public renewal_Asset()
    {
    String AstId = ApexPages.currentPage().getParameters().get('AccountId');
   
        Ast = [SELECT Name,SerialNumber,Product2Id,SLA_End_Date__c,AccountId
               FROM Asset
               WHERE Id = :AstId ];
    }   
   
  
}

Thanks

Sudhir

Hi All,

I am trying to write a test class in the following code:

public class OpportunityContactRoleExtension{

public List<OpportunityContactRole> ContactRoles{get;set;}

public OpportunityContactRoleExtension(
ApexPages.StandardController controller
){
ContactRoles =
[
SELECT
Contact.Name,
Contact.Email,
Role
FROM
OpportunityContactRole
WHERE
OpportunityId =
:((Opportunity)controller.getRecord()).Id
];
}

Please Help me to solve
Hi all,

I want to include MetadataService in my managed package, the problem is when I tried to install this package in another instance of salesforce.
I mean, when I created this package I did in eu2.salesforce.com, although I tried to install it in na15.salesforce.com. So my remote site doesn't work with different instances, because the metadata is inside the salesforce.

So does anyone know any way to include the remote site for any salesforce instance?

Thanks in advance,
Pablo.