This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable" controller="CreditCardSettingsController"> | |
<aura:attribute name="data" | |
type="Object"/> | |
<aura:attribute name="columns" | |
type="List"/> | |
<aura:attribute name="record" | |
type="Object"/> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement, api } from 'lwc'; | |
import saveTheChunkFile from '@salesforce/apex/FileUploadService.saveTheChunkFile'; | |
import { ShowToastEvent } from 'lightning/platformShowToastEvent'; | |
const MAX_FILE_SIZE = 4500000; | |
const CHUNK_SIZE = 750000; | |
export default class UploadFile extends LightningElement { | |
@api recordId; | |
fileName = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class FileUploadService { | |
@AuraEnabled | |
public static Id saveTheChunkFile(Id parentId, String fileName, String base64Data, String contentType, String fileId){ | |
base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8'); | |
if ( String.isBlank(fileId) ) { | |
fileId = saveFiles(parentId, fileName, base64Data ); | |
} else { | |
appendToFile(fileId, base64Data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ContentVersion cVersion = [select id,ContentBodyId, FileType from contentversion where id = '0685t000000WNJEAA4']; | |
//This could be created by enabling the public link or by creating the record via flow or apex | |
ContentDistribution cDist = [select id,DistributionPublicUrl from ContentDistribution where id = '05D5t000000DFpYEAW']; | |
String fileType = cVersion.FileType.toLowerCase().capitalize(); | |
String cVersionId = cVersion.Id; | |
String cBodyId = cVersion.ContentBodyId; | |
String originalUrl = String.valueOf(cDist.DistributionPublicUrl); | |
String cDistParam = originalUrl.substring(originalUrl.indexOf('/a/')); | |
String orgId = ConnectApi.Organization.getSettings().orgId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { api, LightningElement, track, wire } from 'lwc'; | |
import getContentDetails from '@salesforce/apex/ContentManagerService.getContentDetails'; | |
import deleteContentDocument from '@salesforce/apex/ContentManagerService.deleteContentDocument'; | |
import getLoginURL from '@salesforce/apex/ContentManagerService.getLoginURL'; | |
import { NavigationMixin } from 'lightning/navigation'; | |
const columns = [ | |
{ label: 'Title', fieldName: 'Title', wrapText : true, | |
cellAttributes: { | |
iconName: { fieldName: 'icon' }, iconPosition: 'left' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String linkedEntityId = 'a05B000000ACLmYIAX'; | |
List<ContentDocumentLink> cdl = [ | |
SELECT | |
ContentDocument.Id, ContentDocument.Title, ContentDocument.FileType, ContentDocumentId | |
FROM ContentDocumentLink | |
WHERE LinkedEntityId =: linkedEntityId | |
]; | |
ContentDocumentLink cdl1 = cdl[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="false" sidebar="false"> | |
<!-- | |
Replace <your_resource> with the name of the static resource with | |
your application files in it. This assumes that you are using a zipped static | |
resource with your javascript files in a 'js/' folder. | |
--> | |
<apex:includeScript value="{!URLFOR($Resource.<your_resource>, '/js/transfer-session.js')}" /> | |
</apex:page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility class for common operations | |
* | |
* Any classes that use Schema.SObjectField, this property is object by calling "Schema.Account.Description" | |
* This allows type safety to ensure that code will not break if fields are changed | |
* this will not work with person accounts | |
* | |
* (c) Advanced Technology Group, 2019 | |
* This code may be used and modified freely as long as this copyright attribution | |
* is included with the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create these Custom Labels: | |
Preview_URL: | |
/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId= | |
Download_URL: | |
/community_name/sfc/servlet.shepherd/document/download/ |
NewerOlder