• Manibalan Sampathkumar
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
Hi,

I need to modify the below page to generate a PDF and modify the PDF exporting settings to export a table of only 10 records on each page.

<apex:page standardController="Contact" recordSetvar="Cont">
    <head>
        <style>
            .head { font-size:1.3em; }
        </style>
    </head>
    <apex:slds />
    <body>
        <div class="slds-scope">
            <apex:form>
                <apex:sectionHeader title="Financial Force Contacts" subtitle="Financial Home" help="https://help.salesforce.com/articleView?err=1&id=contacts_overview.htm&siteLang=en_US&type=0" />
                <apex:panelGrid columns="6">
                    <apex:outputLabel value="View:" />
                    <apex:selectList value="{!filterId}" size="1" id="sel">
                        <apex:actionSupport event="onchange" action="{!list}" />
                        <apex:selectOptions value="{!listviewoptions}" />
                    </apex:selectList>
                    <apex:commandButton value="GO!" action="{!list}" />
                    <apex:outputLink value="/ui/list/FilterEditPage?id=00B6F00000Al7Mj&retURL=%2F003&cancelURL=%2F003%2Fo">
                        <apex:outputtext value="Edit"/>
                    </apex:outputLink>|
                    <apex:outputLink value="/ui/list/FilterEditPage?ui/list/FilterEditPage?ftype=c&retURL=%2F003&cancelURL=%2F003%2Fo">
                        <apex:outputtext value="Create New View"/>
                    </apex:outputLink>
                </apex:panelGrid>
                
                <apex:pageBlock>
                    <apex:panelGrid columns="2" width="50%">
                        <h1 class="head">Recent Contacts</h1>
                        <apex:commandButton value="New" action="/001/e" />
                    </apex:panelGrid>
                    <apex:pageBlockTable value="{!cont}" var="item"  id="list">
                        <apex:column headerValue="Name">
                            <apex:outputLink value="/{!item.id}">
                                <apex:outputText >{!item.name}</apex:outputText>
                            </apex:outputLink>
                        </apex:column>
                        <apex:column headerValue="Account Name">
                            <apex:outputLink value="/{!item.accountid}">
                                <apex:outputtext value="{!item.Account.name}"/>
                            </apex:outputlink>
                        </apex:column>
                        
                        <apex:column headerValue="Phone">
                            <apex:outputtext value="{!item.phone}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:form>
        </div>
    </body>
</apex:page>

I used renderAs=pdf to generate the page in pdf which displays 20 records in a table.

To apply page break after 10 records, I tried with apex:repeat, div style="page-break-after:always; and apex:variable but it does not seem to work.

Please help me on this by posting an updated VF code to achieve this requirement. Thanks in advance!!!
Hi,

Is SOQL Polymorphism generally available? Is it available in developer edition?  I tried executing the following SOQL query in Developer edition, but I didn't get the contact name and email though there are contact records which matches the criteria:

SELECT Id, (SELECT TYPEOF Relation WHEN Contact THEN Name, Email END FROM EventRelations) FROM Event WHERE ActivityDateTime<=TODAY

Please let me know. Thx!
Hi,

I tried the same formula which is given in https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vsfIAA with my fields substituted(added 36 months in my case) and I got an error saying Mod expected Number but received Date. The formuala I tried:

DATE (
 
YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36 - 1)/12), 

/*MONTH*/  

CASE(MOD(MONTH(Commencement_Date__c) + 36, 12 ), 0, 12, MOD(MONTH(Commencement_Date__c)+ Commencement_Date__c, 12 )),Commencement_Date__c,Commencement_Date__c)/*DAY*/  

MIN(DAY(Commencement_Date__c),  

CASE(MOD(MONTH(Commencement_Date__c) + 36,12), 9, 30, 4, 30, 6, 30, 11, 30, 2,  /* return max days for February dependent on if end date is leap year */

IF(MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 400) = 0 || (MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 4) = 0 && MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 100) <> 0  ), 29,28), 31))  )

Please help me to resolve this.

Thanks.
I have been trying to complete this trail
Use Custom Metadata Types in Formulas, Default Values, and Validation (salesforce.com)
 but can't be able to solve it
My Validation rule is 
IF(( ISPICKVAL( Support_Tier__c , "Gold") && ( AnnualRevenue < $CustomMetadata.Support_Tier__mdt.Gold.Minimum_Spending__c * 20)), TRUE, FALSE)

but I'm Receiving a weird error called
"Challenge not yet complete in Creative Hawk Playground
In the validation rule named 'Revenue_Validation', we can’t find a reference to '$CustomMetadata.Support_Tier__mdt.Gold.Minimum_Spending__c'."

even though it was there in the Validation rule
Hi,

I need to modify the below page to generate a PDF and modify the PDF exporting settings to export a table of only 10 records on each page.

<apex:page standardController="Contact" recordSetvar="Cont">
    <head>
        <style>
            .head { font-size:1.3em; }
        </style>
    </head>
    <apex:slds />
    <body>
        <div class="slds-scope">
            <apex:form>
                <apex:sectionHeader title="Financial Force Contacts" subtitle="Financial Home" help="https://help.salesforce.com/articleView?err=1&id=contacts_overview.htm&siteLang=en_US&type=0" />
                <apex:panelGrid columns="6">
                    <apex:outputLabel value="View:" />
                    <apex:selectList value="{!filterId}" size="1" id="sel">
                        <apex:actionSupport event="onchange" action="{!list}" />
                        <apex:selectOptions value="{!listviewoptions}" />
                    </apex:selectList>
                    <apex:commandButton value="GO!" action="{!list}" />
                    <apex:outputLink value="/ui/list/FilterEditPage?id=00B6F00000Al7Mj&retURL=%2F003&cancelURL=%2F003%2Fo">
                        <apex:outputtext value="Edit"/>
                    </apex:outputLink>|
                    <apex:outputLink value="/ui/list/FilterEditPage?ui/list/FilterEditPage?ftype=c&retURL=%2F003&cancelURL=%2F003%2Fo">
                        <apex:outputtext value="Create New View"/>
                    </apex:outputLink>
                </apex:panelGrid>
                
                <apex:pageBlock>
                    <apex:panelGrid columns="2" width="50%">
                        <h1 class="head">Recent Contacts</h1>
                        <apex:commandButton value="New" action="/001/e" />
                    </apex:panelGrid>
                    <apex:pageBlockTable value="{!cont}" var="item"  id="list">
                        <apex:column headerValue="Name">
                            <apex:outputLink value="/{!item.id}">
                                <apex:outputText >{!item.name}</apex:outputText>
                            </apex:outputLink>
                        </apex:column>
                        <apex:column headerValue="Account Name">
                            <apex:outputLink value="/{!item.accountid}">
                                <apex:outputtext value="{!item.Account.name}"/>
                            </apex:outputlink>
                        </apex:column>
                        
                        <apex:column headerValue="Phone">
                            <apex:outputtext value="{!item.phone}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:form>
        </div>
    </body>
</apex:page>

I used renderAs=pdf to generate the page in pdf which displays 20 records in a table.

To apply page break after 10 records, I tried with apex:repeat, div style="page-break-after:always; and apex:variable but it does not seem to work.

Please help me on this by posting an updated VF code to achieve this requirement. Thanks in advance!!!
Hi,

Is SOQL Polymorphism generally available? Is it available in developer edition?  I tried executing the following SOQL query in Developer edition, but I didn't get the contact name and email though there are contact records which matches the criteria:

SELECT Id, (SELECT TYPEOF Relation WHEN Contact THEN Name, Email END FROM EventRelations) FROM Event WHERE ActivityDateTime<=TODAY

Please let me know. Thx!
Hi,

I tried the same formula which is given in https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vsfIAA with my fields substituted(added 36 months in my case) and I got an error saying Mod expected Number but received Date. The formuala I tried:

DATE (
 
YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36 - 1)/12), 

/*MONTH*/  

CASE(MOD(MONTH(Commencement_Date__c) + 36, 12 ), 0, 12, MOD(MONTH(Commencement_Date__c)+ Commencement_Date__c, 12 )),Commencement_Date__c,Commencement_Date__c)/*DAY*/  

MIN(DAY(Commencement_Date__c),  

CASE(MOD(MONTH(Commencement_Date__c) + 36,12), 9, 30, 4, 30, 6, 30, 11, 30, 2,  /* return max days for February dependent on if end date is leap year */

IF(MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 400) = 0 || (MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 4) = 0 && MOD(YEAR(Commencement_Date__c) + FLOOR((MONTH(Commencement_Date__c) + 36)/12), 100) <> 0  ), 29,28), 31))  )

Please help me to resolve this.

Thanks.
Hi,

I have a formula field named Contract End Date and the value of this field should be calucated based on Contract Start Date and the Contract Duration. Contract Start Date is of type Date and Contract Duration is the number of months. Id I just add both the fields it considers Contract Duration as number of days instead of month. How do I achieve this?

Thanks
Jina