• Ankit Arora 30
  • NEWBIE
  • 14 Points
  • Member since 2019
  • Systems Developer
  • New York Institute of Technology

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 13
    Replies
Hi Everyone,

I need some help. I have recently turned on the domain in the Sandbox. I have uploaded the logo and set the URL for the banner. When I go to the Salesforce login page using the domain URL, everything looks great but when I log in and log out from Salesforce, I don't see my company's Logo anymore.

Logo Dimensions:
Width: 180 px
Height: 113 px
Size: 9.32 KB

LOGO:
Login Salesforce with Logo

NO LOGO:

Login Screen Without Logo

Regards,
Ankit
Hi Everyone,

I have a "Contact" object and a custom child object "FinancialAid" Object. I want to create a VF page that displays FinancialAid object records but I want to display that page on Contact Object or any object I want to. Also, How can I pass an ID to it. Currently, I am using hardcoded ID of the contact record. I want to fetch the ID automatically from the page.

VF Page:
<apex:page controller="FinAidData">
<apex:pageBlock title="Financial Aid Information">
<apex:pageBlockTable value="{!finaidresults}" var="finaid">
<apex:column value="{!finaid.Name}"/>
<apex:column value="{!finaid.Amount__c}"/>
<apex:column value="{!finaid.Accepted__c}"/>
<apex:column value="{!finaid.Accept_Date__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
APEX Class:
public class FinAidData {

List<Financial_Aid__c> finaidresults = [Select Name, Amount__c, Accepted__c, Accept_Date__c from Financial_Aid__c  where Contact__c = 'XXXXX000035Mp7XXXX' ];

public List<Financial_Aid__c> getfinaidresults(){
return finaidresults;
}
}
HI Everyone,

I need help.

We have implemented SSO in our Org. When we login using the SSO, its working fine.
-> When we logout from Salesforce, we used to get some error message but then we set up the logout URL in SSO and then it started to work.
-> If we have multiple tabs open and if we logout from one tab, then we get the logout page as assigned in logout URL but now if we go to another tab, we get two options, one is RETURN and other is LOGIN. When we click on LOGIN, it gives us an error, it should suppose to take us at the LOGIN page that is provided by Identity Provider. When we click on RETURN, nothing happens, sometimes it says check your internet connection and when we reload the page, we get error message.

Error Message:
User-added image
I want to convert VF to PDF and then save it to Notes and attachments and below are the VF pages and apex class.

When I run the process, a pdf is created successfully at the right location under the application's notes and attachments but its blank. When I "login to community as a user", again the same vf page is blank but when I create a custom link of vf page in Application object, I can see the entire letter in pdf. Before putting the extension and action tag, I was able to see the same page from the custom link and from "login to community as a user". Can you please tell me what I am doing wrong, why its showing blank page.
Also VF page render the output dynamically, its not a static page. I have added VF pages and Apex classes to the community profile.
Please help me.

1st Visualforce Page:
<apex:page standardcontroller="Application__c" extensions="attachPDFToApplication" action="{!attachPDF}" standardStylesheets="false" showHeader="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >
<apex:include pageName="DecisionLetter_V2"/>

2nd Visualforce Page:
<apex:page renderAs="pdf"> </apex:page>

Apex Class:
public class attachPDFToApplication {

public attachPDFToApplication(ApexPages.StandardController standardPageController) {
    }
 
public void attachPDF() {
PageReference pdfPage = Page.DecisionLetter_V2;
Attachment attach = new Attachment();
Blob pdfBlob;
      try {
             pdfBlob = pdfPage.getContent();
           }
       catch (VisualforceException e) {
             pdfBlob = Blob.valueOf('Some Text');
           }
                
attach.parentId = ApexPages.currentPage().getParameters().get('id');
attach.Name = 'DecisionLetter - '+ system.Now() + ' .pdf';
attach.body = pdfBlob;
insert attach;
    }
}


Thank you

Regards,
Ankit
Hi Everyone,

I need some help. I have recently turned on the domain in the Sandbox. I have uploaded the logo and set the URL for the banner. When I go to the Salesforce login page using the domain URL, everything looks great but when I log in and log out from Salesforce, I don't see my company's Logo anymore.

Logo Dimensions:
Width: 180 px
Height: 113 px
Size: 9.32 KB

LOGO:
Login Salesforce with Logo

NO LOGO:

Login Screen Without Logo

Regards,
Ankit
Hi Everyone,

I need some help. I want to integrate Salesforce with some other company. They have provided me documentation with the following details:

Server URL,
Test API page URL,
API for create, read, delete and update.

I have API Create in JSON format. I don't have any endpoint URL that I can use in the Apex code. I am not sure what I need to do with these APIs. I am this integration for the first time.

Let's say after I create this user who will attend this event, I want to display this user in salesforce that this person attended the event.

I checked online but everyone is using endpoint url and I have only server url.

Please help me.
Thank you

Regards,
Ankit
Hi Everyone,

I have a "Contact" object and a custom child object "FinancialAid" Object. I want to create a VF page that displays FinancialAid object records but I want to display that page on Contact Object or any object I want to. Also, How can I pass an ID to it. Currently, I am using hardcoded ID of the contact record. I want to fetch the ID automatically from the page.

VF Page:
<apex:page controller="FinAidData">
<apex:pageBlock title="Financial Aid Information">
<apex:pageBlockTable value="{!finaidresults}" var="finaid">
<apex:column value="{!finaid.Name}"/>
<apex:column value="{!finaid.Amount__c}"/>
<apex:column value="{!finaid.Accepted__c}"/>
<apex:column value="{!finaid.Accept_Date__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
APEX Class:
public class FinAidData {

List<Financial_Aid__c> finaidresults = [Select Name, Amount__c, Accepted__c, Accept_Date__c from Financial_Aid__c  where Contact__c = 'XXXXX000035Mp7XXXX' ];

public List<Financial_Aid__c> getfinaidresults(){
return finaidresults;
}
}
HI Everyone,

I need help.

We have implemented SSO in our Org. When we login using the SSO, its working fine.
-> When we logout from Salesforce, we used to get some error message but then we set up the logout URL in SSO and then it started to work.
-> If we have multiple tabs open and if we logout from one tab, then we get the logout page as assigned in logout URL but now if we go to another tab, we get two options, one is RETURN and other is LOGIN. When we click on LOGIN, it gives us an error, it should suppose to take us at the LOGIN page that is provided by Identity Provider. When we click on RETURN, nothing happens, sometimes it says check your internet connection and when we reload the page, we get error message.

Error Message:
User-added image
We have in some of our Knowledge base articles public links to Salesforce Files. When a user opens one of these links, it opens a browser tab with the file and the favicon is the Salesforce cloud icon. Is there any way to apply a custom favicon to these public links? Salesforce support indicated that it would require applying a custom favicon to all Salesforce pages. Is this even possible?
I want to convert VF to PDF and then save it to Notes and attachments and below are the VF pages and apex class.

When I run the process, a pdf is created successfully at the right location under the application's notes and attachments but its blank. When I "login to community as a user", again the same vf page is blank but when I create a custom link of vf page in Application object, I can see the entire letter in pdf. Before putting the extension and action tag, I was able to see the same page from the custom link and from "login to community as a user". Can you please tell me what I am doing wrong, why its showing blank page.
Also VF page render the output dynamically, its not a static page. I have added VF pages and Apex classes to the community profile.
Please help me.

1st Visualforce Page:
<apex:page standardcontroller="Application__c" extensions="attachPDFToApplication" action="{!attachPDF}" standardStylesheets="false" showHeader="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >
<apex:include pageName="DecisionLetter_V2"/>

2nd Visualforce Page:
<apex:page renderAs="pdf"> </apex:page>

Apex Class:
public class attachPDFToApplication {

public attachPDFToApplication(ApexPages.StandardController standardPageController) {
    }
 
public void attachPDF() {
PageReference pdfPage = Page.DecisionLetter_V2;
Attachment attach = new Attachment();
Blob pdfBlob;
      try {
             pdfBlob = pdfPage.getContent();
           }
       catch (VisualforceException e) {
             pdfBlob = Blob.valueOf('Some Text');
           }
                
attach.parentId = ApexPages.currentPage().getParameters().get('id');
attach.Name = 'DecisionLetter - '+ system.Now() + ' .pdf';
attach.body = pdfBlob;
insert attach;
    }
}


Thank you

Regards,
Ankit
Hello,

I am inserting some records when i click on custom button. Button is on parent object. I am creating child records of that parent object. I want to show all this records on visualforce page. I have written the code. But nothing is displaing. Can anyone please help me?
VF SHOWDTP


<apex:page standardController="MTP__c"  extensions="showCalender">
<apex:form >
 <apex:pageBlock title="All Dtp">
 <apex:pageblockTable value="{!mydtpList}" var="item">
 <apex:column value="{!item.Name}"/> 
 <apex:column value="{!item.Date__c}"/> 
 <apex:column value="{!item.Visit_type__c}"/> 
 <apex:column value="{!item.Food_Expenses__c}"/> 
</apex:pageblockTable>
 </apex:pageBlock> 
 </apex:form>
</apex:page>


=============================================

Controller

public class showCalender {
    public List<DTP__c> mydtpList {set;get;}
     public  id tid{get;set;}


    public showCalender(ApexPages.StandardController controller)
     {
          tid = ApexPages.currentPage().getParameters().get('id');
         System.debug('***************dtp added*******************'+tid); 
        getMydtpList();
     }
       public List<DTP__c> getMydtpList(){
      
    
        List<DTP__c> mydtpList =[select Name, Expenses__c, MTP__c, Food_Expenses__c, Date__c, Visit_type__c from DTP__c where MTP__c=:tid limit 50];

        return mydtpList ;
        }
    //List<DTP__c>  mydtpList = [select Expenses__c, Name, MTP__c, Food_Expenses__c, Visit_type__c from DTP__c where id=:tid];

    }

Regards,
Satakshi
Hi All,

My question is regarding Save Pdf as in Notes and Attachment under the record,

So, my issue is,

First controller is fill the document(PDF) and Second controller can Save that PDF using that first Controller, How can i Do this ?

Or any other solution to save this PDF in Notes and Attachment ?

Please Help..

Thank you.
Hi,

I have a Visualforce page that creates a PDF contract of an opportunity, and I'm trying to save the PDF as an attachment on the opportunity.  I think I'm almost there, but I'm getting an error 

"DML currently not allowed 
An unexpected error has occurred. Your development organization has been notified."


here is my controller extension
public class savePDF {

        // The extension constructor initializes the private member
    // variable pageOpp by using the getRecord method from the standard
    // controller.
    Private Opportunity pageOpp;
    public savePDF(ApexPages.StandardController stdController) {
        this.pageOpp = (Opportunity)stdController.getRecord();
        system.debug('id = ' + pageOpp.id);
        
         PageReference pdf = Page.TWC_Contract;
    // create the new attachment
    Attachment attach = new Attachment();

    // the contents of the attachment from the pdf
    Blob body;

    try {

        // returns the output of the page as a PDF
        body = pdf.getContent();

    // need to pass unit test -- current bug    
    } catch (VisualforceException e) {
        body = Blob.valueOf('Some Text');
    }

    attach.Body = body;
    // add the user entered name
    attach.Name = 'test';
    attach.IsPrivate = false;
    // attach the pdf to the account
    attach.ParentId = pageOpp.Id;
    insert attach;

    }
  
}
I kind of hypridized the code based on the post here
http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/


Thanks,

 

Hi

I have word docx file in notes and attachments. I want to display it in my vf page. Is there any way to do this.

 

Thanks

Ishan Sharma

Hi All,

 

I have a VFP within which I have written:

Visualforce page Name: MyAttach:

<apex:page standardController="CustomObj__C" extension="MyClass" action="saveAttach">

//here I generate PDF data with the help of both standard controller and its extension

</apex:page>

 

in MyClass I have written this method as:

 

public void saveAttach()

{

    System.debug('Inside saveAttach');
    PageReference pdfPage = Page.MyAttach;
    pdfPage.getParameters().put('id',q.id);//q is variable of CustomObj__c which fetches records.
    Blob pdfBlob ;//= pdfPage.getContent();
    pdfBlob = pdfPage.getContent();
    Attachment a = new Attachment(parentId = q.id, name=q.id + '.pdf', body = pdfBlob);
    insert a;
    pdfBlob = Blob.valueOf('Unit Test Attachment Body');?

}

 

When I click a custom button(having MyAttach VFP) from CustomObj__c page layout, it give me error Too many nested getContent calls, I don't know why is this going in infinite loop.

Any Ideas/thoughts/workarounds to this are highly appreciated.

Thank you!

:

Regards,

Lakshman

hi guys,

how to attach a pdf file to 'notes & attachments' part of an object?

i was able to generate a pdf file using the visualforce with a custom controller.

then they ask to automatically generate and Attach the pdf file to the 'notes & attachment' as well when you press the custom 'buttons and links'.

all i can find is how to attach it to email.

can anyone help? thanks in advance.