• Leo C
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I have a list button for the Product2 object in my org that redirects to a VisualForce page. This VisualForce page displays the product name and description of all the product records that were selected in list view. That works fine, and I have the page rendered as a PDF using the renderAs tag.
renderAs="pdf"
My problem occurs when I go to download the PDF using the provided button in the browser. When I do this, the PDF is downloaded but the content shows the name and description of every single product record, not just the ones I selected.
How can I get the downloaded PDF to show only the selected records?
Am I missing something? I feel like this may be some sort of caching issue but I really don't know honestly.

Here is my VF code for reference:
<apex:page standardController="Product2" recordSetVar="prods" showHeader="false" extensions="CatalogueGenerationExt" renderAs="pdf">
    <!-- Static resource style sheet -->
    <apex:stylesheet value="{!URLFOR($Resource.cataloguegenstyle)}"/>

    <div class="main-containter" style="background-image:url('{!URLFOR($Resource.watermarkfull)}');">
        <div class="head">
            <div class="genTitle">
                Custom Catalog Generation (<apex:outputText value="{0, date,MMMM d',' yyyy - HH:mm 'GMT'}"><apex:param value="{!NOW()}"/></apex:outputText>)
            </div>
        </div>
        <div>
            <apex:repeat value="{!prods}" var="q">
                <div class="product-inner">
                    <div class="prod-title">
                        <h3>
                            <apex:outputField value="{!q.Name}"/>
                        </h3>
                    </div>
                    <div class="client-desc-cont">
                        <apex:outputField value="{!q.Client_Description__c}"/>
                        <apex:outputText rendered="{!q.Client_Description__c=Null}">&lt;No Description available&gt;</apex:outputText>
                    </div>
                </div>
            </apex:repeat>
        </div>
    </div>
</apex:page>

 
  • May 08, 2020
  • Like
  • 0
I recently started completing the 'Build Lightning Web Components' trail on Trailhead and as much as it is informational and pretty cool I am getting more and more confused about terminology. 

They refer to 'Lightning Web Components'... are these different from 'Lightning Components'? If so, how?

'Lightning Components' is just another term for 'Aura Components', right?

Finally, how do 'VisualForce Components' tie into all of this?
  • August 20, 2019
  • Like
  • 0
I have an Apex Trigger that has for main goal to set the 'Assigned To' (OwnerId) field depending on on the 'Related To' (WhatId) record's type.

I feel like I'm going a little bit crazy at this very instant because I could have sworn the trigger was working last week.

This is give or take what my code looks like currently:
trigger EventAssignToTrigger on Event (before insert) {
    for (Event e :Trigger.New) {
        String relatedObject = e.What.Type;
        
        if(e.What.Type == 'Account' || e.What.Type == 'Contract__c') {
            //related to Account, NDA Contract, or Vendor Contract
            if(e.What.Type == 'Account' || e.what.recordTypeId == '0121t000000EC3cAAG') {
                e.OwnerId = '0231w0000010AWx';  //Calendar 1
            } else if (e.what.recordTypeId == '0121t000000EC3mAAG') {
                e.OwnerId = '0231t000001EAwZ';  //Calendar 2
            }  else {
                e.OwnerId = '0231t000001EAwj'; //Calendar 3
            }
            
        }   
    }
}

The code above is slightly simplified but that is basically the just of it. For some reason I can't seem to access the 'What.Type' or 'What.RecordTypeId' from the trigger. Is that normal?
I know WhatId returns what it should but for some reason What.* returns null.
If this is normal, what are my options in terms of getting the WhatId object's type and record type?
  • June 24, 2019
  • Like
  • 0
I have an Apex Trigger that has for main goal to set the 'Assigned To' (OwnerId) field depending on on the 'Related To' (WhatId) record's type.

I feel like I'm going a little bit crazy at this very instant because I could have sworn the trigger was working last week.

This is give or take what my code looks like currently:
trigger EventAssignToTrigger on Event (before insert) {
    for (Event e :Trigger.New) {
        String relatedObject = e.What.Type;
        
        if(e.What.Type == 'Account' || e.What.Type == 'Contract__c') {
            //related to Account, NDA Contract, or Vendor Contract
            if(e.What.Type == 'Account' || e.what.recordTypeId == '0121t000000EC3cAAG') {
                e.OwnerId = '0231w0000010AWx';  //Calendar 1
            } else if (e.what.recordTypeId == '0121t000000EC3mAAG') {
                e.OwnerId = '0231t000001EAwZ';  //Calendar 2
            }  else {
                e.OwnerId = '0231t000001EAwj'; //Calendar 3
            }
            
        }   
    }
}

The code above is slightly simplified but that is basically the just of it. For some reason I can't seem to access the 'What.Type' or 'What.RecordTypeId' from the trigger. Is that normal?
I know WhatId returns what it should but for some reason What.* returns null.
If this is normal, what are my options in terms of getting the WhatId object's type and record type?
  • June 24, 2019
  • Like
  • 0