• MrSalesForce
  • NEWBIE
  • 0 Points
  • Member since 2012
  • Guru

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

Hi Friends, 

I have added an <analytics:reportChart to a visual force page. Im using a filter for the visualforce page to be context aware. This works great in classic and it renders in Lightning as well...
 

<!-- Active credit limit report (stored in S: Embedded reports folder) -->
        <analytics:reportChart reportId="00O25000000Sfwa" cacheResults="false" filter="[{column:'FK_NAME',operator:'equals',value:'{!Credit_Group__c.Name}'}]" size="small"></analytics:reportChart>

... however, in lightning you get a bonus button called "view report". This button is great if it works. The problem i have is that the button open the source report without any filter. This cant happen since the report will suddenly show all records in the database and confuse my users.

a) Is there any way to get the "view report"-button in lightning to actually use the same filter as the graph? 
OR 
b) Anyone have a creative way of hiding/removing the "view report"-button?

Lightning view = 

User-added image

Classic view = 

User-added image
 

Hi Friends, trying to get a basic   <analytics:reportChart > to work with a filter. Im not a hardcore developer and most solutions got a bit hardcore. This is the code is started off using

<apex:page standardController="Account" standardStylesheets="true">
<apex:form > 
 
Account id test = {!Account.Id}

 <table style="width:100%;">
    <tr>
    <td valign="top" cellpadding="10" border="1">
        <analytics:reportChart showRefreshButton="true" reportId="00O25000000Sg3H" filter="[{column:'Account.Id',operator:'equals',value:'001D000001MITN5IAP'}]" size="small"></analytics:reportChart>
    </td>                                                                                                                          
    <td valign="top"> 
    </td>
    <td valign="top">
    </td>
    <td valign="top"> 
    </td>
 </tr>
</table> 
 
</apex:form>
</apex:page>
 

The code above causes an error message that i was struggeling with for quite some time:

 

Error:
[For the filter 1: Specify a valid filterable column because Account.Id is invalid.]


The reason for this is because the "Account.Id" value is incorrect. I found other examples online that had replaced the dot with underscore character (Account_Id), but that also cases the same error. It turns out that that syntax IS correct, but that the column name is case sensitive and in my case it should be all upper case (ACCOUNT_ID).

The question is how to know what the column name is called in the Analytics Api that is used to render the graph. Here is what I used to debug that.

  1. Open the Developer console.
  2. Drop down menu: Debug + Open Execute Anonymous window.
  3. In the Enter Apax Code window paste the following:
    // Add your report id below
    String reportId = '00O25000000Sg3H'; 
    
    Http http = new Http();
           HttpRequest httpReq = new HttpRequest();
           HttpResponse httpRes = new HttpResponse();      
           httpReq.setMethod('GET');
           httpReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
           httpReq.setEndpoint(
               URL.getSalesforceBaseUrl().toExternalForm()+
               '/services/data/v29.0/analytics/reports/' + reportId +
               '?includeDetails=true'
           );
           httpRes = http.send(httpReq);
           System.debug(httpRes.getBody());
    
  4. Execute
  5. Click debug only to filter out from the excecution log.
  6. Cut n paste the User_Debug line into a text window of choice
  7. User-added image
  8. Look for reportFilters and find the name of the field next to column: (green below)
  9. User-added image
  10. Using that field name solves the "is invalid error message"
  11.  

But it cases my next error message...

 

Error
You can't view the report chart because its report, report type, or chart has been deleted.


To be continued...


 

<apex:page standardController="Account" standardStylesheets="true">
<apex:form > 
 
Account id test = {!Account.Id}

 <table style="width:100%;">
    <tr>
    <td valign="top" cellpadding="10" border="1">
        <analytics:reportChart showRefreshButton="true" reportId="00O25000000Sg3H" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'001D000001MITN5IAP'}]" size="small"></analytics:reportChart>
    </td>                                                                                                                          
    <td valign="top"> 
    </td>
    <td valign="top">
    </td>
    <td valign="top"> 
    </td>
 </tr>
</table> 
 
</apex:form>
</apex:page>
 


 

Is it possible to allow an apex trigger to write to an object without getting stuck in validation rules? 

We have an object where it should be possible to change it via code but not via the user interface (read only does not work since only some types of the object cannot be changed).

 

It would be nice if it was possible to see if a change has been made by the system or by a user using the GUI.

 

Any ideas on how to accomplish this?

 

BR
Mattias

Hi,

 

Im trying to embed a custom visual force page on another visual force page. 

<apex:page standardController="Flight__c">
    <apex:outputText style="font-style:italic" value="This is {0} text with {1}.">
       <apex:param value="my"/>
       <apex:param value="arguments"/>
    </apex:outputText>
</apex:page>

 

Have used the page layout editor to insert that page on a section within the Flight__c object. When i open the flight i can see an section but with no content in it. 

 

What am i doing wrong?

 

How do i get a formula field including br() to actually render a row break instead for showing the text string? 

 

Im using the following code to display a message if the entry criteria for an approval process has not been met. 
The "Missing_needed_fields_for_approval__c"-field is a formula that includes BR(). This renders perfectly on the standard page layout but not in my output text block. In the text block the text BR() is displayed.

Is there any way of getting the formula BR() to be rendered as a <BR/>? 

 

       <!-- APPROVAL ENTRY CRITERIAS -->
       <apex:OutputText escape="false" rendered="{!OR(flight__c.Customer_approved__c == '',flight__c.C_Opportunity_won__c =='', flight__c.C_Simulation_completed__c =='' ) }">
           <br/>
           <div style="border:1px solid red; padding:10px; margin:20px; background-color:#f1cccc;">
           <b>Before submitting this flight for approval you need to fix the following:</b><br/> 
	       {!Flight__c.Missing_needed_fields_for_approval__c}
           </div>
           <br/>
       </apex:outputText>

 

FYI : Im a beginner to apex :)

 

Hi Friends, 

I have added an <analytics:reportChart to a visual force page. Im using a filter for the visualforce page to be context aware. This works great in classic and it renders in Lightning as well...
 

<!-- Active credit limit report (stored in S: Embedded reports folder) -->
        <analytics:reportChart reportId="00O25000000Sfwa" cacheResults="false" filter="[{column:'FK_NAME',operator:'equals',value:'{!Credit_Group__c.Name}'}]" size="small"></analytics:reportChart>

... however, in lightning you get a bonus button called "view report". This button is great if it works. The problem i have is that the button open the source report without any filter. This cant happen since the report will suddenly show all records in the database and confuse my users.

a) Is there any way to get the "view report"-button in lightning to actually use the same filter as the graph? 
OR 
b) Anyone have a creative way of hiding/removing the "view report"-button?

Lightning view = 

User-added image

Classic view = 

User-added image
 

Hi Friends, trying to get a basic   <analytics:reportChart > to work with a filter. Im not a hardcore developer and most solutions got a bit hardcore. This is the code is started off using

<apex:page standardController="Account" standardStylesheets="true">
<apex:form > 
 
Account id test = {!Account.Id}

 <table style="width:100%;">
    <tr>
    <td valign="top" cellpadding="10" border="1">
        <analytics:reportChart showRefreshButton="true" reportId="00O25000000Sg3H" filter="[{column:'Account.Id',operator:'equals',value:'001D000001MITN5IAP'}]" size="small"></analytics:reportChart>
    </td>                                                                                                                          
    <td valign="top"> 
    </td>
    <td valign="top">
    </td>
    <td valign="top"> 
    </td>
 </tr>
</table> 
 
</apex:form>
</apex:page>
 

The code above causes an error message that i was struggeling with for quite some time:

 

Error:
[For the filter 1: Specify a valid filterable column because Account.Id is invalid.]


The reason for this is because the "Account.Id" value is incorrect. I found other examples online that had replaced the dot with underscore character (Account_Id), but that also cases the same error. It turns out that that syntax IS correct, but that the column name is case sensitive and in my case it should be all upper case (ACCOUNT_ID).

The question is how to know what the column name is called in the Analytics Api that is used to render the graph. Here is what I used to debug that.

  1. Open the Developer console.
  2. Drop down menu: Debug + Open Execute Anonymous window.
  3. In the Enter Apax Code window paste the following:
    // Add your report id below
    String reportId = '00O25000000Sg3H'; 
    
    Http http = new Http();
           HttpRequest httpReq = new HttpRequest();
           HttpResponse httpRes = new HttpResponse();      
           httpReq.setMethod('GET');
           httpReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
           httpReq.setEndpoint(
               URL.getSalesforceBaseUrl().toExternalForm()+
               '/services/data/v29.0/analytics/reports/' + reportId +
               '?includeDetails=true'
           );
           httpRes = http.send(httpReq);
           System.debug(httpRes.getBody());
    
  4. Execute
  5. Click debug only to filter out from the excecution log.
  6. Cut n paste the User_Debug line into a text window of choice
  7. User-added image
  8. Look for reportFilters and find the name of the field next to column: (green below)
  9. User-added image
  10. Using that field name solves the "is invalid error message"
  11.  

But it cases my next error message...

 

Error
You can't view the report chart because its report, report type, or chart has been deleted.


To be continued...


 

<apex:page standardController="Account" standardStylesheets="true">
<apex:form > 
 
Account id test = {!Account.Id}

 <table style="width:100%;">
    <tr>
    <td valign="top" cellpadding="10" border="1">
        <analytics:reportChart showRefreshButton="true" reportId="00O25000000Sg3H" filter="[{column:'ACCOUNT_ID',operator:'equals',value:'001D000001MITN5IAP'}]" size="small"></analytics:reportChart>
    </td>                                                                                                                          
    <td valign="top"> 
    </td>
    <td valign="top">
    </td>
    <td valign="top"> 
    </td>
 </tr>
</table> 
 
</apex:form>
</apex:page>
 


 

Hi,

 

Im trying to embed a custom visual force page on another visual force page. 

<apex:page standardController="Flight__c">
    <apex:outputText style="font-style:italic" value="This is {0} text with {1}.">
       <apex:param value="my"/>
       <apex:param value="arguments"/>
    </apex:outputText>
</apex:page>

 

Have used the page layout editor to insert that page on a section within the Flight__c object. When i open the flight i can see an section but with no content in it. 

 

What am i doing wrong?

 

How do i get a formula field including br() to actually render a row break instead for showing the text string? 

 

Im using the following code to display a message if the entry criteria for an approval process has not been met. 
The "Missing_needed_fields_for_approval__c"-field is a formula that includes BR(). This renders perfectly on the standard page layout but not in my output text block. In the text block the text BR() is displayed.

Is there any way of getting the formula BR() to be rendered as a <BR/>? 

 

       <!-- APPROVAL ENTRY CRITERIAS -->
       <apex:OutputText escape="false" rendered="{!OR(flight__c.Customer_approved__c == '',flight__c.C_Opportunity_won__c =='', flight__c.C_Simulation_completed__c =='' ) }">
           <br/>
           <div style="border:1px solid red; padding:10px; margin:20px; background-color:#f1cccc;">
           <b>Before submitting this flight for approval you need to fix the following:</b><br/> 
	       {!Flight__c.Missing_needed_fields_for_approval__c}
           </div>
           <br/>
       </apex:outputText>

 

FYI : Im a beginner to apex :)