Loading
Versicherung
Inhalt
Filter auswählen

          Keine Ergebnisse
          Keine Ergebnisse
          Hier sind einige Suchtipps

          Überprüfen Sie die Schreibweise Ihrer Stichwörter.
          Verwenden Sie allgemeinere Suchbegriffe.
          Wählen Sie weniger Filter aus, um Ihre Suche auszuweiten.

          Gesamte Salesforce-Hilfe durchsuchen
          Einbringen von Notizen in Anspruchsverlaufszeitachsen

          Einbringen von Notizen in Anspruchsverlaufszeitachsen

          Fügen Sie eine Apex-Klasse mit dem Namen GetContentNoteAsStory hinzu und stellen Sie sie für die Verwendung mit der Artikelkonfigurationseinstellung "Claim_ContentNote" bereit.

          1. Aktivieren Sie Notizen. Geben Sie unter "Setup" im Feld "Schnellsuche" den Text Notizeneinstellungen ein und wählen Sie dann Notizeneinstellungen aus. Bestätigen Sie, dass Notizen aktivieren ausgewählt ist.
          2. Klicken Sie auf das Schnellzugriffsmenü (Zahnradsymbol) und wählen Sie Developer Console aus.
          3. Klicken Sie auf Datei | Neu | Apex Klasse.
          4. Geben Sie GetContentNoteAsStory als Namen der Apex-Klasse ein und fügen Sie dann diesen Code hinzu. Speichern Sie Ihre neue Apex-Klasse.
            global with sharing class GetContentNoteAsStory implements VlocityOpenInterface2
            {
                global Object invokeMethod(String methodName,Map<String,Object> inputs, Map<String,Object> output, Map<String,Object> options)
                {
                    Boolean success = true;
                    try
                    {
                        if(methodName == 'getContentNotes')
                        {
                            success = getContentNotes(inputs, output, options);
                        }
                    }
                    catch (Exception e)
                    {
                        System.debug('Error invoke method: ' + methodName + ' with error: '+ e);
                        success = false;
                        throw e;
                    }
                    return success;
                }
            
                private Boolean getContentNotes(Map<String,Object> input, Map<String,Object> output, Map<String,Object> options)
                {
                    String parentObjName = (String) input.get('parentObjName');
                    String objName = (String) input.get('storyObjType');
                    List<Object> objIdList1 = (List<Object>) input.get('objIds');
                    List<Id> objIdList = new List<Id>();
                    integer queryRecordLimit = (integer) input.get('pageSize');
                    DateTime lastDate = (DateTime) input.get('lastActivityDate');
                    List<Object> listOfStories = new List<Object>();
            
                    if (queryRecordLimit == null) queryRecordLimit = 10;
            
                    for (Object objId : objIdList1) objIdList.add((Id) objId);
            
                    //query for content note for parentObject
                    List<ContentDocumentLink> docLinks = [
                        SELECT ContentDocumentId, Id, LinkedEntityId
                        FROM ContentDocumentLink
                        WHERE LinkedEntityId IN :objIdList
                    ];
                    // ShareType, SystemModstamp, Visibility
            
                    List<Id> docIdList= new List<Id>();
                    Map<Id, Id> objIdContentDocIdMap = new Map<Id, Id>();
                    if (docLinks != null && docLinks.size() > 0)
                    {
                        for (ContentDocumentLink docLink :docLinks )
                        {
                            docIdList.add(docLink.ContentDocumentId);
                            objIdContentDocIdMap.put(docLink.ContentDocumentId, docLink.LinkedEntityId);
                        }
            
                        List<String> fields = new List<String>
                        {
                            'Id',
                            'FileExtension',
                            'FileType',
                            'Title',
                            'Content',
                            'TextPreview',
                            'LastModifiedBy.Name',
                            'LastModifiedDate',
                            'CreatedById',
                            'CreatedBy.Name',
                            'CreatedBy.Title',
                            'OwnerId',
                            'Owner.Name',
                            'Owner.Title'
                        };
            
                        String objQuery = 'SELECT ' + String.join(fields, ', ') + ' ';
                        objQuery += 'FROM ContentNote ';
                        objQuery += 'WHERE Id IN :docIdList ';
                        objQuery += 'AND LastModifiedDate != null ';
                        if (lastDate != null)
                        {
                            objQuery += ' AND LastModifiedDate <= :lastDate ';
                        }
                        objQuery += ' LIMIT '+String.valueOf(queryRecordLimit);
            
                        List<ContentNote> listContentNote = Database.query(objQuery);
            
                        for (ContentNote cnote : listContentNote)
                        {
                            Map<String, Object> resultMap = new Map<String, Object>();
                            DateTime LastActDate = cnote.LastModifiedDate;
            
                            Map<String, String> summaryLabelMap = new Map<String, String>();
                            summaryLabelMap.put('Title', 'Title');
                            summaryLabelMap.put('Subtitle', 'Content');
            
                            Map<String, String> summaryValueMap = new Map<String, String>();
                            summaryValueMap.put('Title', cnote.Title);
                            summaryValueMap.put('Subtitle', cnote.Content.toString());
            
                            Map<String, String> detailMap = new Map<String, String> ();
                            String ownerValId = String.valueOf(cnote.OwnerId);
                            User owner = cnote.Owner;
                            Map<String, Object> ownersMap = new Map<String, Object>
                            {
                                'ID' => cnote.OwnerId,
                                'Owner' => owner.Name,
                                'Title' => owner.Title
                            };
            
                            Boolean isDate = false;
                            String idValue = String.valueOf(cnote.Id);
                            String lastModify = (String) cnote.getSObject('LastModifiedBy').get('Name');
                            String image;
                            String parentRecId = objIdContentDocIdMap.get(cnote.Id);
                            String parentRecName;
                            String navPath;
                            String objDef = 'ContentNote';
                            String parObjType=parentObjName;
                            String ownerId = cnote.LastModifiedBy.Id;
            
                            resultMap.put('lastActDate', LastActDate);
                            resultMap.put('summaryLabelMap', summaryLabelMap);
                            resultMap.put('summaryValueMap', summaryValueMap);
                            resultMap.put('detailValueMap', detailMap);
                            resultMap.put('IdValue', idValue);
                            resultMap.put('imageRef', image);
                            resultMap.put('sortFieldIsDate', isDate);
                            resultMap.put('parentId',parentRecId);
                            resultMap.put('parentName', parentRecName);
                            resultMap.put('navigateLink', navPath);
                            resultMap.put('objAPIName', objDef);
                            resultMap.put('parentObjAPIName', parObjType);
                            resultMap.put('owner', cnote.LastModifiedBy.Id);
                            resultMap.put('modified', lastModify);
                            resultMap.put('ownerValueMap', ownersMap);
                            listOfStories.add(resultMap);
                        }
                    }
            
                    if (listOfStories != null && listOfStories.size() > 0)
                    {
            
                        output.put('stories', listOfStories);
                    }
                    return true;
                }
            }
            
          5. Geben Sie unter "Setup" im Feld "Schnellsuche" den Text Benutzerdefinierte Einstellungen ein und wählen Sie dann Benutzerdefinierte Einstellungen aus.
          6. Suchen Sie nach Artikelobjektkonfiguration und klicken Sie auf Verwalten.
          7. Geben Sie in der Artikelobjekteinstellung "Claim_ContentNote" für "Name des übergeordneten Objekts" den Text Claim ein.
           
          Laden
          Salesforce Help | Article