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

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 152
    Questions
  • 77
    Replies
Hello, 
I would like to get a report as a visualforce. For this I made the code:

<apex:page standardController="account"> <analytics:reportChart reportId="00O0Q000000U9CyUAK"></analytics:reportChart> </apex:page>

When adding the visualforce to a page I get the error:

"The report chart is unavailable because the report's format is not summary or matrix."

What do I have to change to make it work?
Hello, I have a report with the name "FDB Reporting" which has the column "Erstellungsdatum" which contains the creation date. Now I want to achive that I get the rows of the current month as a Visualforce List and safe them as pdf afterwards. My Goal is, that I get a pdf of the current month elements at the last day of the month at 23:59. I think for this I will need a flow. The topic is very urgent, so could you tell me how I can achive this topic?

Greetings
Jonathan

User-added image
Hello, I have a report that I need to automatically save as a pdf at the last day of the month at 23:59 every month. But the pdf schould only include the records which where created in the month, so it is an actual month-report.

This pdf should be created automatically at 23:59 at the last day so i dont have to do anything and be save at files of a custom object
Hello I need a test class for the following code, could you help me with it?
 
global class AutoHandler implements Auth.RegistrationHandler{
class RegHandlerException extends Exception {}
global User createUser(Id portalId, Auth.UserData data){
// authenticated users are found by the email in their authentication token
User u = new User();
String email= data.email;
List<User> userList = [Select Id, Name, Email, UserName From User Where (Email =: email) AND isActive = true ];
if(userList != null && userList.size() > 0) {
return userList.get(0);
} else {
throw new RegHandlerException('Cannot find user with email:'+ data.email);
}
}
global void updateUser(Id userId, Id portalId, Auth.UserData data){
// user profile data is updated from authentication token data
User u = new User(id=userId);
u.lastName = data.lastName;
u.firstName = data.firstName;
update(u);
}
}

Greetings,Jonathan
Hello, I want to recreate the Related Record Component on Opportunities because the users I want to see it do not have edit rights. Could you give me a guide how to make a component that shows the fields of the records its in. Kind of like a visualforce just as a component.

Greetings
Jonathan

Hello, I have build a task datatable component and added the Who.Name as a column. It is working fine when the Who.Name field has content in it, otherwise I get an error message when leaving the field empty. Could you give me a solution for it?

User-added image


My code:

APEX
//ÜBERFÄLLIG - Abfrage Tasks, wo das Activity Date abgelaufen und der Status "Not Completed" ist//
@AuraEnabled
public static List<Task> loadTasks(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, WhoId, ActivityDate, Status FROM Task WHERE ActivityDate< TODAY AND OwnerId=:userId AND Status !='Completed'];
}


JS
 
component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                 {label: 'Name', fieldName: 'whoName', type: 'text',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        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.whoName = record.Who.Name
                });
                component.set("v.tasks", records);
            }
        });
        $A.enqueueAction(action);

 
Hello friends, I have a task datatable component and added the Who.Name as a column. the problem is, that now I do get error messages whenever there is a task where Who.Name is empty. Could you give me a solution for it?

User-added image
My code:

APEX
@AuraEnabled
public static List<Task> loadTasks3(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TOMORROW AND OwnerId=:userId AND Status !='Completed'];
}



JS
component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                 {label: 'Name', fieldName: 'whoName', type: 'text',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        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.whoName = record.Who.Name
                });
                component.set("v.tasks", records);
            }
        });
        $A.enqueueAction(action);

 
Hi, I used Workbench to find all the Files I have by querying
"SELECT PathOnClient.Object FROM ContentVersion".
Now I would like to get the Object in which the file is safed + the record name within the object. Could you tell me how I need to query for achiving this?
 
Greetings,
Jonathan
Hello, I want to get the Who.Name in a datatable, but I struggle with it due to the value not displaying in my datatable component.
I'm quite confident that my query in my apex class is working:
@AuraEnabled
public static List<Task> loadTasks2(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TODAY AND OwnerId=:userId AND Status !='Completed'];
}

I think I made a mistake in the Datatable Controller. Could you look in it and tell me what to change, so the Who.Name is shown?

Controller:
component.set('v.mycolumns2', [
            {label: 'Thema', fieldName: 'Subject', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},             
            {label: 'Name', fieldName: 'WhoName', type: 'lookup',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        var action = component.get("c.loadTasks2");
        
        
        
        var whatId = component.get("v.recordId");
        action.setParams({
            "recordId":whatId
        });
          
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                   
                    record.SubjectName = '/'+record.Id;
                    
                });
                component.set("v.tasks2", records);
            }
        });
        $A.enqueueAction(action);

 
Hello friends,

I have following requirements. Have a custom object "Mediathek" with a List "Printmaterial". I want to make a datatable that shows the list of all Files in this List. I want the File name, the number of downloads and Views. The problem is, that I do not know how the querys for ContentDocument/Version should look like to achive this. Could you give me the Querys to get the data I want.

Thank you in advance :D

Sincerly,
Jonathan
Hello, I have a Visualforce template. I want to use an apex class with PageReference.getContentAsPDF() to create a pdf through a flow with the VF template. Could you give me an example of the Apex class to use for my "Visualforce code" that I can add to a flow to create a pdf. (I want to achive, that the fields of the visualforce like (!Account.Name) are filled with screen flow inputs)

Thank you in advance.
Greetings
Jonathan

My Visualforce code:
<apex:page standardController="Account" renderAs="pdf"  >
    
   
    
    <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>


 
Hello, I made Anonymous window in my dev console to test a apex class to create a text file and save it in files. It does work fine, but when I replace .txt with .pdf, the pdf is created but when I open it, I got an error (I use edge browser, maybe this is the problem)

Could you show me what to change about the code to create a working pdf :)
 
try{
  string textFile = 'This is test data';
  ContentVersion DocVer = New ContentVersion();
  docVer.ContentLocation = 'S';
  docVer.PathOnClient= 'Demo.txt';
  docver.Title= 'Demo.txt';
  Blob textData = Blob.valueOf(textFile);
  docver.VersionData = textData;
  insert DocVer;

  string Versid =[select contentDocumentid from contentVersion where id =: 
  DocVer.id].contentDocumentid;
  ContentDocumentLink Doclink = New ContentDocumentLink();
  doclink.ContentDocumentId =Versid;
  doclink.linkedEntityId = '';
  doclink.sharetype = 'I';
  doclink.visibility = 'AllUsers';
  insert doclink;

}
catch(exception ex)
{
      system.debug(ex.getmessage());
}

 
Hello, I have a quite complicated requirement. I already did some research on it. I want to put a flow component in accounts. In the first screen I do have the field Kontaktprotokoll__c. After that I want to put a apex class in the flow, that creates a apex that displays the input in Kontaktprotokoll__c as the content of a pdf. In the end I want the pdf to be saved in files of the account where it was started.

Could you give me a code sample of the apex class how it should be?

Greetings
Jonathan
Hello, I have a kind of easy requirement but I cant figure out how to make it.
I have a object Mediathek where I have a List "Printmaterial. Now the only thing I want to achive I a datatable component where I do get listet all the names of the files that are saved in the records of this list. Could you give me a small code example to orientate myself with it.

Sincerly,
Jonathan
Hello, I want to make a component that just shows the names of the files (only last version) in all campaigns. on the one column I want the campaign name and on the second the file name. Is it possible in a way?
Hello, I want to make preperations for the upcoming CORS update. I wanted to log into the Event Log File Browser(https://salesforce-elf.herokuapp.com/ (https://salesforce-elf.herokuapp.com/" style="color:#0563c1; text-decoration:underline)) . 

I tried to log in with production but I do get this error:

User-added imageCould you tell me how to fix this?

Sincerly,
Jonathan
Hello, my chefs wants me to inform myself about the steps we need to make befor the CORS release update.
I already looked if we have some URL under setup->CORS, but it was not the case.
Do I have to add every link that I have in salesforce to a page outside?

We use the sales cloud and never had any CORS problem so I am not sure about any needed changes to our org :D 

Greetings
Jonathan
Hello, I want to build a datatable component that shows all files of the records in the custom object "Mediathek. for now I wanted to make a datatable that shows the records on Mediathek where Typ = 'Printmaterial'. Could you show me how to fix my component to achive it?
When saving I do get this error:
Failed to save PrintmaterialDatatableController.js: c.PrintmaterialDatatable: Failed to parse CONTROLLER for js://c.PrintmaterialDatatable: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Expected ',' or '}', got FUNCTION_ARGS_END [25, 2]: 'function(component, event, helper) { component.set('v.mycolumns', [ {label: 'Thema', fieldName: 'Beschreibung__c', type: 'url', typeAttributes: {label: { fieldName: 'Beschreibung__c' }, target: '_blank'}}, {label: 'Thema__c', fieldName: 'Thema__c', type: 'picklist', fixedWidth: 160 }, ]); var action = component.get("c.loadMedia"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { var records =response.getReturnValue(); records.forEach(function(record){ }); component.set("v.media", records); } }); $A.enqueueAction(action); }': Source

COMPONENT
<aura:component controller="MediaController" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" >
    
    <aura:attribute name="recordId" type="Id" />    
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
                                              
   
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>   
    <aura:attribute name="mycolumns" type="List"/>
  
        <div>
            <aura:if isTrue="{!not(empty(v.media))}">
                <lightning:datatable data="{!v.mediathekList }" 
                         columns="{!v.mycolumns }" 
                         keyField="Id"
                         hideCheckboxColumn="true"
                         />
                <aura:set attribute="else">
                    <div Style="text-align : center"> Keine Aufgaben</div>
                </aura:set>
            </aura:if>
        </div>
        
</aura:component>


JS
({
    doInit: function(component, event, helper) {
    
      
        	component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'Beschreibung__c', type: 'url',
            typeAttributes: {label: { fieldName: 'Beschreibung__c' }, target: '_blank'}},
                {label: 'Thema__c', fieldName: 'Thema__c', type: 'picklist', fixedWidth: 160 },
        ]);
        var action = component.get("c.loadMedia");
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                 
                });
                component.set("v.media", records);
            }
        });
        $A.enqueueAction(action);
            
       

})


APEX
public class MediaController {

       
//ÜBERFÄLLIG - Abfrage Tasks, wo das Activity Date abgelaufen und der Status "Not Completed" ist//
@AuraEnabled
public static List<Mediatheken> loadmedia(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Thema__c, Bezeichnung__c FROM Mediathek__c WHERE Typ__c = 'Printmaterial'];
}
}

 
Hi, I have an Object "Mediathek". In this object I do have a List view named "Printmaterial" where I have Files standart component in every record. I want to build a datatable component that shows the names of the record in the first column, the file name in the second column and in 3rd/4th column the file engagements like download number or views of the file. Could you tell me how to achive it?
 
Greetings
Jonathan
 
#Sales Cloud
Hi, I found a GitHub page how to create a xlsx by using apex class. I used the "deploy to salesforce"-button. The deployement was successfull but I do not now what to do, so I can use the code for xlsx-creation.

The side that I used: GitHub - RaymarMonte/apex-create-xlsx: A guide and example on how to create Excel .xlsx files on Apex Programming Language

Greetings
Jonathan
Hello, 
I would like to get a report as a visualforce. For this I made the code:

<apex:page standardController="account"> <analytics:reportChart reportId="00O0Q000000U9CyUAK"></analytics:reportChart> </apex:page>

When adding the visualforce to a page I get the error:

"The report chart is unavailable because the report's format is not summary or matrix."

What do I have to change to make it work?
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 report that I need to automatically save as a pdf at the last day of the month at 23:59 every month. But the pdf schould only include the records which where created in the month, so it is an actual month-report.

This pdf should be created automatically at 23:59 at the last day so i dont have to do anything and be save at files of a custom object

Hello, I have build a task datatable component and added the Who.Name as a column. It is working fine when the Who.Name field has content in it, otherwise I get an error message when leaving the field empty. Could you give me a solution for it?

User-added image


My code:

APEX
//ÜBERFÄLLIG - Abfrage Tasks, wo das Activity Date abgelaufen und der Status "Not Completed" ist//
@AuraEnabled
public static List<Task> loadTasks(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, WhoId, ActivityDate, Status FROM Task WHERE ActivityDate< TODAY AND OwnerId=:userId AND Status !='Completed'];
}


JS
 
component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                 {label: 'Name', fieldName: 'whoName', type: 'text',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        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.whoName = record.Who.Name
                });
                component.set("v.tasks", records);
            }
        });
        $A.enqueueAction(action);

 
Hello friends, I have a task datatable component and added the Who.Name as a column. the problem is, that now I do get error messages whenever there is a task where Who.Name is empty. Could you give me a solution for it?

User-added image
My code:

APEX
@AuraEnabled
public static List<Task> loadTasks3(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TOMORROW AND OwnerId=:userId AND Status !='Completed'];
}



JS
component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                 {label: 'Name', fieldName: 'whoName', type: 'text',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        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.whoName = record.Who.Name
                });
                component.set("v.tasks", records);
            }
        });
        $A.enqueueAction(action);

 
Hello, I want to get the Who.Name in a datatable, but I struggle with it due to the value not displaying in my datatable component.
I'm quite confident that my query in my apex class is working:
@AuraEnabled
public static List<Task> loadTasks2(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TODAY AND OwnerId=:userId AND Status !='Completed'];
}

I think I made a mistake in the Datatable Controller. Could you look in it and tell me what to change, so the Who.Name is shown?

Controller:
component.set('v.mycolumns2', [
            {label: 'Thema', fieldName: 'Subject', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},             
            {label: 'Name', fieldName: 'WhoName', type: 'lookup',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        var action = component.get("c.loadTasks2");
        
        
        
        var whatId = component.get("v.recordId");
        action.setParams({
            "recordId":whatId
        });
          
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                   
                    record.SubjectName = '/'+record.Id;
                    
                });
                component.set("v.tasks2", records);
            }
        });
        $A.enqueueAction(action);

 
Hello, I have a Visualforce template. I want to use an apex class with PageReference.getContentAsPDF() to create a pdf through a flow with the VF template. Could you give me an example of the Apex class to use for my "Visualforce code" that I can add to a flow to create a pdf. (I want to achive, that the fields of the visualforce like (!Account.Name) are filled with screen flow inputs)

Thank you in advance.
Greetings
Jonathan

My Visualforce code:
<apex:page standardController="Account" renderAs="pdf"  >
    
   
    
    <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>


 
Hello, my chefs wants me to inform myself about the steps we need to make befor the CORS release update.
I already looked if we have some URL under setup->CORS, but it was not the case.
Do I have to add every link that I have in salesforce to a page outside?

We use the sales cloud and never had any CORS problem so I am not sure about any needed changes to our org :D 

Greetings
Jonathan
Hi, I want to make a Visualforce table with input fields. The next step would be to convert the visualforce into a xlsx, but I could not find anything helpful. Could you give me a help how I can achive this with a code example or anything in this direction. It is important that the file type is .xlsx
 
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 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