• Jonathan Wolff 7
  • NEWBIE
  • 285 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 120
    Questions
  • 65
    Replies
Hello, I made a Search component, which querys on my object "Mediatheken".When I enter 'Pension' I do get results but if I try something similar like ' Pensio' or 'Pens' I do not get these results. Could you tell me if there is a possibility to find answers that are near to the entered text.

My Apex code:

public class MediathekSearchController {


    
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND : searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name, Bezeichnung__c, Typ__c, Zielgruppe__c, Umfang__c, Bezeichnung_Link__c, Bezeichnung_Search__c)
                                            ];
        return searchResult;
     
    } 
}
Hello,

I have build a search component. In system administrators I do get results when I insert a word, but do not get results for Standart Lightning users. Where could this problem come from?

Greetings
Hello, I have a problem with a trigger that I have. I created a field in Content Version named "Dokumentenklasse" and if a file with the value i.e Vertragsdokument  is chosen, the trigger should lead to it, that this file can not be deleted. Everything to this point is working absolutely fine.

The problem is that when I create a new version on a document that cant be deleted and give it a Dokumentenklasse that could be deleted, I still get the error, because the old version blocks the deletation.
Could you show me how to change the trigger code, that only the last version is looked at, when I try to delete the file instead of every possible version?

Thank you for the help!

My code:

trigger DokumentenklasseDelete on ContentDocument (before delete) {       
    map<id,ContentDocument> documentMap = new map<id,ContentDocument>([SELECT id,(SELECT Id,FileType,Dokumentenklasse__c from ContentVersions) from ContentDocument where id IN :trigger.old]);         
    for(ContentDocument con : Trigger.old){              
        List<ContentVersion> versionList = documentMap.get(con.Id).ContentVersions;         
        if (versionList != null && versionList.size() > 0) {        
            for (contentVersion cv : versionList) {  
                set<STring> setValues = new set<STring>{'Geschäftsbrief', 'Vertragsdokument', 'Wichtige Dokumentation oder Entscheidung', 'Druckstück'};
                if(setValues.contains(cv.Dokumentenklasse__c)) { con.adderror('Fehler: Dokumente der Dokumentenklassen "Geschäftsbrief", "Vertragsdokument", "Wichtige Dokumentation oder Entscheidung", sowie "Druckstück" dürfen aus rechtlichen Gründen vor Ablauf der Aufbewahrungsfrist nicht gelöscht werden. Kontaktieren Sie hierfür bitte einen Systemadministrator.');
                }              
            }            
        }                    
        
    } 
}
Hello, I build a flow "Test_flow" and in the flow I got a picklist "Auswahl". I want to achive, that when I select "Type 1" in this picklist, a text field displays "this is type 1". Could you tell me how to use the flow field in a formula. It is in the account object but I could not find a solution on this.
Hello friends,
I finally decided to create my first flow and I'm very excited. I would like to make the flow in the account object. I also want to place a visualforce in the account page and by clicking certain fields in the flow,I would like to determine what is written in the visualforce. The last I would like to achive would be to safe the visualforce in files through the flow, but this step is far away :D.

Could you tell me how I can achive it that a picklist value from the flow is added in the visualforce
Hello, I want to achive the following requirement. I want to create a flow in contacts where I pass information and insert them into a visualforce. I would like to make it possible to save the visualforce as a file in the end. Could you give me a guide if and how this can be achived?

Greetings
Jonathan
Hello I tried to delete an apex class by using destructiveChanges.xml and package.xml which I added to a zip-file. I deployed it to my workbench and got these errors. Could you tell me what to fix, so I could delete classes without facing this error?

User-added image
Hello friends
, I made a search component with a datatable where I would like to link to the record. Could you look over my code and help me achive it so the url-result Bezeichnung__c leads to its record?

Thank you in advance for your help.


COMPONENT

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
    <div class= "slds-box">
        <div class="slds-grid slds-wrap" >
            <div class="slds-size_12-of-12">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem  size="8">
                <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
            </lightning:layoutItem>
            <lightning:layoutItem  size="2">
                <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    </div>
    <div class="haha">
        <aura:if isTrue="{!v.showSearchResults}">
            <lightning:layout multipleRows="true">
                <lightning:layoutItem padding="around-small" size="9" >
                    <lightning:datatable keyField="id"
                                         data="{!v.mediathekList}"
                                         columns="{!v.mediathekColumns}"
                                         hideCheckboxColumn="true"/>
                </lightning:layoutItem>
            </lightning:layout>
        </aura:if>
    </div>
        </div>
    
    
    
</aura:component>

JS:

({
    init: function (component, event, helper){
       component.set('v.mediathekColumns', [
            {label: 'Bezeichnung', fieldName: 'Bezeichnung__c', type: 'url', 
            typeAttributes: {label: { fieldName: 'Bezeichnung__c' }, target: '_blank'}},
           {label: 'Typ', fieldName: 'Typ__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Typ__c' }, target: '_blank'}},
           {label: 'Zielgruppe', fieldName: 'Zielgruppe__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Zielgruppe__c' }, target: '_blank'}},
           {label: 'Umfang', fieldName: 'Umfang__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Umfang__c' }, target: '_blank'}},
            
            
          ]);
             var action = component.get("c.getSearchResult");
        action.setParams({
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                    record.Bezeichnung__c = '/'+record.Id;
                });
                component.set("v.mediathekList", records);
            }
        });
        $A.enqueueAction(action);
    },




        
    search : function(component, event, helper) {
        helper.getSearchResultsFromApex(component, event, helper);
        component.set("v.showSearchResults",true);
    }
})

APEX 

public class MediathekSearchController {


    
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name, Bezeichnung__c, Typ__c, Zielgruppe__c, Umfang__c, Bezeichnung_Link__c)
                                            ];
        return searchResult;
     
    } 
}

 
Hello, I want to hyperlink a record in lightning:datatable and tried to do it like in : Infallible Techie: How to Hyperlink a Record in lightning:datatable?

Could you tell me how to change my code so the hyperlink does work, because I cant find the fault I made ;/

COMPONENT:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
    <div class= "slds-box">
        <div class="slds-grid slds-wrap" >
            <div class="slds-size_12-of-12">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem  size="8">
                <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
            </lightning:layoutItem>
            <lightning:layoutItem  size="2">
                <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    </div>
    <div class="haha">
        <aura:if isTrue="{!v.showSearchResults}">
            <lightning:layout multipleRows="true">
                <lightning:layoutItem padding="around-small" size="9" >
                    <lightning:datatable keyField="id"
                                         data="{!v.mediathekList}"
                                         columns="{!v.mediathekColumns}"
                                         hideCheckboxColumn="true"/>
                </lightning:layoutItem>
            </lightning:layout>
        </aura:if>
    </div>
        </div>
    
</aura:component>

CONTROLLER

({
    init: function (component, event, helper){
       component.set('v.mediathekColumns', [
            {label: 'Bezeichnung', fieldName: 'Bezeichnung__c', type: 'url', 
            typeAttributes: {label: { fieldName: 'Bezeichnung__c' }, target: '_blank'}},
           {label: 'Typ', fieldName: 'Typ__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Typ__c' }, target: '_blank'}},
           {label: 'Zielgruppe', fieldName: 'Zielgruppe__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Zielgruppe__c' }, target: '_blank'}},
           {label: 'Umfang', fieldName: 'Umfang__c', type: 'text', 
            typeAttributes: {label: { fieldName: 'Umfang__c' }, target: '_blank'}},
            
            
          ]);
             var action = component.get("c.getSearchResult");
        action.setParams({
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                    record.Bezeichnung__c = '/'+record.Id;
                });
                component.set("v.mediathekList", records);
            }
        });
        $A.enqueueAction(action);
    },




        
    search : function(component, event, helper) {
        helper.getSearchResultsFromApex(component, event, helper);
        component.set("v.showSearchResults",true);
    }
})

APEX Class

public class MediathekSearchController {

 
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name, Bezeichnung__c, Typ__c, Zielgruppe__c, Umfang__c)
                                            ];
        return searchResult;
     
    }
}
Hello, I made a search component and I would like to lead to the record when I click on the field "Bezeichnung" which is an URL.

User-added image
Could you tell me how to change the controller so behind the url behind Bezeichnung leads to the record that was found in the suchleiste. For that purpose I add the Component too.


COMPONENT

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
    <div class= "slds-box">
        <div class="slds-grid slds-wrap" >
            <div class="slds-size_12-of-12">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem  size="9">
                <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
            </lightning:layoutItem>
            <lightning:layoutItem  size="3">
                <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    </div>
    <div class="haha">
        <aura:if isTrue="{!v.showSearchResults}">
            <lightning:layout multipleRows="true">
                <lightning:layoutItem padding="around-small" size="8" >
                    <lightning:datatable keyField="id"
                                         data="{!v.mediathekList}"
                                         columns="{!v.mediathekColumns}"
                                         hideCheckboxColumn="true"/>
                </lightning:layoutItem>
            </lightning:layout>
        </aura:if>
    </div>
        </div>
    
    
    
</aura:component>
Hello, I made a search component, but I am not satisfied with the design. Could you tell me how to change the color of the white part which shows the search results?User-added image

My code:

COMPONENT:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
 
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
 
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
 
    <lightning:layout multipleRows="true">
        <lightning:layoutItem padding="around-small" size="9">
            <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="3">
            <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
        </lightning:layoutItem>
    </lightning:layout>
 
    <aura:if isTrue="{!v.showSearchResults}">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem padding="around-small" size="12">
                Mediathek
                <lightning:datatable keyField="id"
                                     data="{!v.mediathekList}"
                                     columns="{!v.mediathekColumns}"
                                     hideCheckboxColumn="true"/>
            </lightning:layoutItem>
            
        </lightning:layout>
    </aura:if>
 
</aura:component>

Style:
.THIS .customButton{
    margin-top: 19px;
    background-color: #ffffff;
    color: blue
}

.cMediathekSuchleiste{
 height: 50px;
 background-color:#003781;
}



 
Hello,
I need a test class for a component I made. Could you help me with it?


APEX CLASS

public class MediathekSearchController {

 
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name)
                                            ];
        return searchResult;
     
    }
}
Hello friends, 
I build a search component which is working fine on an object named "Mediathek". I find results when I search through the component but the problem is, that by clicking on the results, I'm not lead to the record. Could you tell me what the reason in my code could be?

COMPONENT:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
 
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
 
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
 
    <lightning:layout multipleRows="true">
        <lightning:layoutItem padding="around-small" size="9">
            <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="3">
            <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
        </lightning:layoutItem>
    </lightning:layout>
 
    <aura:if isTrue="{!v.showSearchResults}">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem padding="around-small" size="12">
                Mediathek
                <lightning:datatable keyField="id"
                                     data="{!v.mediathekList}"
                                     columns="{!v.mediathekColumns}"
                                     hideCheckboxColumn="true"/>
            </lightning:layoutItem>
            
        </lightning:layout>
    </aura:if>
 
</aura:component>

CONTROLLER

({
    init: function (component, event, helper){
       component.set('v.mediathekColumns', [
            {label: 'Mediathek Name', fieldName: 'Name', type: 'url', 
            typeAttributes: {label: { fieldName: 'Name' }, target: '_blank'}},
            
        ]);
        
    },
 
    search : function(component, event, helper) {
        helper.getSearchResultsFromApex(component, event, helper);
        component.set("v.showSearchResults",true);
    }
})

HELPER

({
    getSearchResultsFromApex : function(component, event, helper){
     
        var action = component.get("c.getSearchResult");
        action.setParams({ searchKey : component.get("v.searchKey") });
     
        // Create a callback that is executed after
        // the server-side action returns
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
 var result = response.getReturnValue();
  result.forEach(function(result){
                    result.Name = '/'+result.Id;
                      
                });
               
                // SOSL will always return the list in the order they were queried
                component.set("v.mediathekList",result[0]);
                  
                
            }
            else if (state === "INCOMPLETE") {
                // do something
            }
                else if (state === "ERROR") {
                    var errors = response.getError();
                    if (errors) {
                        if (errors[0] && errors[0].message) {
                            console.log("Error message: " +
                                        errors[0].message);
                        }
                    } else {
                        console.log("Unknown error");
                    }
                }
        });
        $A.enqueueAction(action);
    }
})

STYLE

.THIS .customButton{
    margin-top: 19px;
}

.cMediathekSuchleiste{
 height: 50px;
  background-color:#ffffff;
}


APEX CLASS

public class MediathekSearchController {

 
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name)
                                            ];
        return searchResult;
     
    }
}
Hello, I have an Object with the name "Mediathek". I build a search component that can find results. I get no errors and when I search for a record in Mediathek, I get results. The problem I got is, that when I click on a result It does not lead to the record but shows me a page that nothing was found on the internet. Could you give me help how to make it, so I open records by clicking?


My Code:

COMPONENT:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
 
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
 
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
 
    <lightning:layout multipleRows="true">
        <lightning:layoutItem padding="around-small" size="9">
            <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="3">
            <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
        </lightning:layoutItem>
    </lightning:layout>
 
    <aura:if isTrue="{!v.showSearchResults}">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem padding="around-small" size="12">
                Mediathek
                <lightning:datatable keyField="id"
                                     data="{!v.mediathekList}"
                                     columns="{!v.mediathekColumns}"
                                     hideCheckboxColumn="true"/>
            </lightning:layoutItem>
            
        </lightning:layout>
    </aura:if>
 
</aura:component>

CONTROLLER

({
    init: function (component, event, helper){
       component.set('v.mediathakColumns', [
            {label: 'Mediathek Name', fieldName: 'Name', type: 'url', 
            typeAttributes: {label: { fieldName: 'Name' }, target: '_blank'}},
            
        ]);
        
    },
 
    search : function(component, event, helper) {
        helper.getSearchResultsFromApex(component, event, helper);
        component.set("v.showSearchResults",true);
    }
})

HELPER

({
    getSearchResultsFromApex : function(component, event, helper){
     
        var action = component.get("c.getSearchResult");
        action.setParams({ searchKey : component.get("v.searchKey") });
     
        // Create a callback that is executed after
        // the server-side action returns
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
 var result = response.getReturnValue();
  result.forEach(function(result){
                    result.Name = '/'+result.Id;
                      
                });
               
                // SOSL will always return the list in the order they were queried
                component.set("v.mediathekList",result[0]);
                  
                
            }
            else if (state === "INCOMPLETE") {
                // do something
            }
                else if (state === "ERROR") {
                    var errors = response.getError();
                    if (errors) {
                        if (errors[0] && errors[0].message) {
                            console.log("Error message: " +
                                        errors[0].message);
                        }
                    } else {
                        console.log("Unknown error");
                    }
                }
        });
        $A.enqueueAction(action);
    }
})

STYLE

.THIS .customButton{
    margin-top: 19px;
}

.cMediathekSuchleiste{
 height: 50px;
  background-color:#ffffff;
}


APEX CLASS

public class MediathekSearchController {

 
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name)
                                            ];
        return searchResult;
     
    }
}
Hello, I used an inputfield and wanted to display different texts depending on which value for the field "PDF_Vorlage__c" is inserted. But inseted of text I am only able to display the variable
( <apex:inputField value="{!Campaign.PDF_Vorlage__c}" rendered="{!IF(Campaign.PDF_Vorlage__c ='Vorlage 1' ,true,false)}"/>)

If I insert text in the value field I get an error.
Is it possible in some way to achive getting a text instead of the variable?
Hello, I added a Visualforce to campaign page. In campaign I have the field "PDF_Vorlage__c". If the value of this field is Vorlage 1 I want to display a text in the visualforce but I get the error:

Error: Attribute value in <apex:inputField> must contain only a formula expression that resolves to a single controller variable or method in Campaign_PDF at line 24 column 93

How can I solve it. My code:

<apex:page standardController="Campaign" renderAs="pdf">
    <apex:repeat value="{!Campaign.CampaignMembers}" var="cMem">
        <div style="page-break-after:always;"> 
            <h1>Welcome to APP!</h1>
            <p>Thank you, <b><apex:outputText value=" {!cMem.Name}"/></b>, for working with APP.</p>
            <p>Your campaign details are:</p>
            <table>
                <tr><th>Account Name</th>
                    <td><apex:outputText value="{!Campaign.Name}"/></td>
                </tr>
                <tr><th>Account Rep</th>
                    <td><apex:outputText value="{!Campaign.Owner.Name}"/></td>
                </tr>
                <tr><th>Customer Since</th>
                    <td><apex:outputText value="{0,date,long}">
                        <apex:param value="{!Campaign.CreatedDate}"/>
                        </apex:outputText></td>
                </tr>
                
            </table>
            <apex:pageBlock>
            <apex:pageBlockSection rendered="true">

  <apex:inputField  value="This is the text i want to display" rendered="{!IF(!Campaign.PDF_Vorlage__c ='Vorlage 1' )}"/>  
                                                                     
</apex:pageBlockSection>
            
            
            </apex:pageBlock>
            
        </div>
    </apex:repeat>
</apex:page>
Hello, I would like to track the exports of the reports. Could you tell me how I can achive this by using Event Monitoring. I did not really understand the requirements and steps on trailblazer
Hello, I made a picklist in Campaign (PDF_Vorlage__c) with the 2 values 'Volage 1' and 'Vorlage 2'.

I also created a visualforce that I inserted in campaign page.
I want to achive that when I select the value 'Vorlage 1' , the visualforce should show 'This is Vorlage 1' and the same if Vorlage 2 is selected.

Could you modify my Visualforce so I can test it?

VF:

<apex:page standardController="Campaign" renderAs="pdf">
    <apex:repeat value="{!Campaign.CampaignMembers}" var="cMem">
        <div style="page-break-after:always;"> 
            <h1>Welcome to APP!</h1>
            <p>Thank you, <b><apex:outputText value=" {!cMem.Name}"/></b>, for working with APP.</p>
            <p>Your campaign details are:</p>
            <table>
                <tr><th>Account Name</th>
                    <td><apex:outputText value="{!Campaign.Name}"/></td>
                </tr>
                <tr><th>Account Rep</th>
                    <td><apex:outputText value="{!Campaign.Owner.Name}"/></td>
                </tr>
                <tr><th>Customer Since</th>
                    <td><apex:outputText value="{0,date,long}">
                        <apex:param value="{!Campaign.CreatedDate}"/>
                        </apex:outputText></td>
                </tr>
                
            </table>
        </div>
    </apex:repeat>
</apex:page>
Hello, I want to track who exported which report. I found Event Log Files as a possibillity to track. Could you give me an aswer, if it will be possible this way to create a list to track the export of reports. 
Thank yu in advance :D

Greetings
Jonathan
Hello, I have a component in whick I insert the header and a description. I want the header to be on the top of the component and the description on the bottom. Can you tell me how to change the CSS to make it?

Code

Component:

<aura:component implements="flexipage:availableForAllPageTypes" access="global">

    <aura:attribute name="url" type="String"/>
    <aura:attribute name="header" type="String"/>
    <aura:attribute name="description" type="String"/>
    <aura:attribute name="font" type="String"/>
    
    <a href="{!v.url}" target="_blank">
            {!v.header} 
            <br/>
            <br/>
            
            
            {!v.description}
            {!v.fontcolor}
    </a> 
    
</aura:component>

CSS

.THIS header {
    object-fit: contain;  
    background-color: white;  
    border-color: white; 
    height: 150px;
    max-height: 120px;
    width:170px;
    
    
}

.THIS description {
    object-fit: contain;  
    background-color: white;  
    border-color: white; 
    height: 150px;
    max-height: 120px;
    width:170px;
       
    
}
Hello, I build a List button that Includes a Visualforce Page. When I chose Accounts in List view and click account I only see the blank Page without the account fields. Please tell me how to change it.

<apex:page standardController="Account" renderAs="pdf" recordSetVar="accounts" >
 

<h1>Welcome to APP!</h1>
 
<p>Thank you, <b><apex:outputText value=" {!Account.Name}"/></b>, for 
   working with APP.</p>
 
<p>Your account details are:</p>
 
<table>
<tr><th>Account Name</th>
    <td><apex:outputText value="{!Account.Name}"/></td>
    </tr>
<tr><th>Account Rep</th>
    <td><apex:outputText value="{!Account.Owner.Name}"/></td>
    </tr>
<tr><th>Customer Since</th>
    <td><apex:outputText value="{0,date,long}">
        <apex:param value="{!Account.CreatedDate}"/>
        </apex:outputText></td>
    </tr>
</table>
    
</apex:page>

User-added image


Result:

User-added image
Hello I tried to delete an apex class by using destructiveChanges.xml and package.xml which I added to a zip-file. I deployed it to my workbench and got these errors. Could you tell me what to fix, so I could delete classes without facing this error?

User-added image
Hello friends, 
I build a search component which is working fine on an object named "Mediathek". I find results when I search through the component but the problem is, that by clicking on the results, I'm not lead to the record. Could you tell me what the reason in my code could be?

COMPONENT:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
 
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
 
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
 
    <lightning:layout multipleRows="true">
        <lightning:layoutItem padding="around-small" size="9">
            <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="3">
            <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
        </lightning:layoutItem>
    </lightning:layout>
 
    <aura:if isTrue="{!v.showSearchResults}">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem padding="around-small" size="12">
                Mediathek
                <lightning:datatable keyField="id"
                                     data="{!v.mediathekList}"
                                     columns="{!v.mediathekColumns}"
                                     hideCheckboxColumn="true"/>
            </lightning:layoutItem>
            
        </lightning:layout>
    </aura:if>
 
</aura:component>

CONTROLLER

({
    init: function (component, event, helper){
       component.set('v.mediathekColumns', [
            {label: 'Mediathek Name', fieldName: 'Name', type: 'url', 
            typeAttributes: {label: { fieldName: 'Name' }, target: '_blank'}},
            
        ]);
        
    },
 
    search : function(component, event, helper) {
        helper.getSearchResultsFromApex(component, event, helper);
        component.set("v.showSearchResults",true);
    }
})

HELPER

({
    getSearchResultsFromApex : function(component, event, helper){
     
        var action = component.get("c.getSearchResult");
        action.setParams({ searchKey : component.get("v.searchKey") });
     
        // Create a callback that is executed after
        // the server-side action returns
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
 var result = response.getReturnValue();
  result.forEach(function(result){
                    result.Name = '/'+result.Id;
                      
                });
               
                // SOSL will always return the list in the order they were queried
                component.set("v.mediathekList",result[0]);
                  
                
            }
            else if (state === "INCOMPLETE") {
                // do something
            }
                else if (state === "ERROR") {
                    var errors = response.getError();
                    if (errors) {
                        if (errors[0] && errors[0].message) {
                            console.log("Error message: " +
                                        errors[0].message);
                        }
                    } else {
                        console.log("Unknown error");
                    }
                }
        });
        $A.enqueueAction(action);
    }
})

STYLE

.THIS .customButton{
    margin-top: 19px;
}

.cMediathekSuchleiste{
 height: 50px;
  background-color:#ffffff;
}


APEX CLASS

public class MediathekSearchController {

 
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND :searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name)
                                            ];
        return searchResult;
     
    }
}
Hello, I want to make a visualforce that I put in the campaign pages and that show Information about campaign members. Could you give me an example of a visualforce and apex class that shows campaign members?
Hello, I build a List button that Includes a Visualforce Page. When I chose Accounts in List view and click account I only see the blank Page without the account fields. Please tell me how to change it.

<apex:page standardController="Account" renderAs="pdf" recordSetVar="accounts" >
 

<h1>Welcome to APP!</h1>
 
<p>Thank you, <b><apex:outputText value=" {!Account.Name}"/></b>, for 
   working with APP.</p>
 
<p>Your account details are:</p>
 
<table>
<tr><th>Account Name</th>
    <td><apex:outputText value="{!Account.Name}"/></td>
    </tr>
<tr><th>Account Rep</th>
    <td><apex:outputText value="{!Account.Owner.Name}"/></td>
    </tr>
<tr><th>Customer Since</th>
    <td><apex:outputText value="{0,date,long}">
        <apex:param value="{!Account.CreatedDate}"/>
        </apex:outputText></td>
    </tr>
</table>
    
</apex:page>

User-added image


Result:

User-added image
Hello, I have a aura component with a datatable. It includes a checkbox in the datatable section. Now I would like to add a fuctionality to this checkbox, but I dont know how to achive this. Could you look over my code and help me to achive this functionality: I want to change the status of the task to "Completed" when the checkbox is clicked.
Should I share you my code so you can implement it?





 
Hello, I made a pdf that contan fields of the account object. I want to use the pdf visualforce on my account object side as a tab. In addition I would like to make a button on the account list view,so when I chose many accounts, salesforce does print the pdf for every account that I chose.
Greetings
Hello, I want to build a permission set for a certain group of people to be able to edit the field email, mobile and phone on user details. Could you give me a guide how it can be made?
Hello, I would like to change my component datatable code so if the checkbox is checked the status of the task shown is marked as completed? Does somebody know how it can be made? If you like I share my code sample
Hello, I made a datatable for the task title and status. I want to use the checkbox on the datatable to mark the tasks as completed. 
To this day nobody could help me with this issue. Could somebody offer me a help with it? 
Hello, I have build a trigger before delete on ContentDocument. Could you give me a code sample for the test class?



trigger DokumentenklasseDelete on ContentDocument (before delete) {

    
    map<id,ContentDocument> documentMap = new map<id,ContentDocument>([SELECT id,(SELECT Id,FileType,Dokumentenklasse__c from ContentVersions) from ContentDocument where id IN :trigger.old]);
 
        for(ContentDocument con : Trigger.old){
           List<ContentVersion> versionList = documentMap.get(con.Id).ContentVersions;
            if (versionList.size() > 0) {
                for (contentVersion cv : versionList) {
                    if(cv.Dokumentenklasse__c =='Geschäftsbrief' || cv.Dokumentenklasse__c == 'Vertragsdokument' || cv.Dokumentenklasse__c == 'Wichtige Dokumentation oder Entscheidung' ) {
                        con.adderror('Dokumente der Dokumentenklassen "Geschäftsbrief", "Vertragsdokument", "Wichtige Dokumentation oder Entscheidung" dürfen aus rechtlichen Gründen vor Ablauf der Aufbewahrungsfrist nicht gelöscht werden.');
                    }
                 }
            }
            
        }
Hello, I have a before delete Trigger on Content Version. A user here told me that there is a limitation that does not allow before delete triggers to work on content version. Do you know a possibility how to overcome this problem?
The trigger code is:

trigger ContentVersionTrigger on ContentVersion (before delete) { Set<Id> contentDocumentIdSet = new Set<Id>();

if(trigger.IsDelete){ for(ContentVersion con : Trigger.old){

if(con.ContentDocumentId != null) { contentDocumentIdSet.add(con.ContentDocumentId); } } ContentDocumentLink cdl = [SELECT ContentDocumentId,

LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId IN:contentDocumentIdSet Limit 1];

for(ContentVersion con : Trigger.old){

if(con.Dokumentenklasse__c =='Geschäftsbrief'){
if(cdl!=null){

con.addError('You cant delete the file');
}
}
}
}
}
Hello, I have a multo section task component. I added a checkbox to mark thhe tasks as completed when checkbox is clicked. Could you tell me where my error is and how to make the component working:

Component
<aura:component controller="TaskController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <aura:attribute name="recordId" type="Id" />    
    <aura:attribute name="tasks" type="Task[]"/>
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>    
    <aura:attribute name="mycolumns" type="List"/>
    <aura:attribute name="doSelect" type="List"/>
     
   
    <lightning:card iconName="standard:task" title="Aufgaben">
        <div class="slds-card__body slds-card__body_inner">
             <div style="padding-left: 62%; margin-top: -2rem;">
            <lightning:button label="Aufgaben Anzeigen" onclick="{! c.openTask}"/>
            </div>
            
        </div>
    
        
  <div style= "font-size: 15px; font-weight: bold; margin-left:15px; margin-top:10px;">
      Überfällig        

  </div>
           
    <div>
        
        </div>    
        <div>
           
            <aura:if isTrue="{!not(empty(v.tasks))}">
                <lightning:datatable data="{!v.tasks }" 
                         columns="{!v.mycolumns }" 
                         keyField="Id"
                         hideCheckboxColumn="false"
                         onrowselection="{! c.doSelect}" 
                                     />
                <aura:set attribute="else">
                    <div Style="text-align : center"> Keine Aufgaben</div>
                </aura:set>
            </aura:if>
        </div>

        
    </lightning:card>
     
</aura:component>

JS

({
    doInit: function(component, event, helper) {
    
       component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                {label: 'Status', fieldName: 'Status', type: 'picklist', fixedWidth: 160 },
                
        ]);
        var action = component.get("c.loadTasks");
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                   
                    record.SubjectName = '/'+record.Id;
                    record.ActivityDate= record.ActivityDate;
        
       
                });
                component.set("v.tasks", records);
            }
                          
        });
        $A.enqueueAction(action);
                 
   
   },
    openTask: function(component, event, helper) {
       window.open('');
    
    },
          
          doSelect : function(component, event, helper) {
        
        var selectedRows = event.getParam('selectedRows'); 
        var ids = [];
        for ( var i = 0; i < selectedRows.length; i++ ) {
            
            ids.push(selectedRows[i].id);

        }
        
        var action = cmp.get("c.loadTasks");
        action.setParams(
        { 
            recordId : ids,
        }
        )}
    
   
})

Apex Conroller:

public with sharing class TaskController {
     
//ÜBERFÄLLIG - Abfrage Tasks, wo das Activity Date abgelaufen und der Status "Not Completed" ist//
@AuraEnabled    
    public static List<Task> loadTasks(List<Id> recordId){
    string userId = UserInfo.getUserId();
    List<Task>  taskObj=[select id, Subject, ActivityDate, Status from task where id IN:recordId];
    
    for(Task tsk : taskObj){
        tsk.Status='Completed';
    }
    
    if(taskObj.size() > 0)
    update taskObj;
    
    return[SELECT Subject, ActivityDate, Status  FROM Task WHERE ActivityDate< TODAY AND OwnerId=:userId AND Status !='Completed'];
}
}