I have Shield Platform Encryption turned on for Account.Name
and a server-side field describe call:
System.debug(JSON.serializePretty(Account.Name.getDescribe()));
returns as expected these properties amongst many others:
aggregatable: false
encrypted: true
filterable: false
groupable: false
label: "Account Name"
But my LWC code that is doing this:
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
import ACCOUNT_OBJECT_NAME from '@salesforce/schema/Account.Name';
@wire(getObjectInfo, { objectApiName: ACCOUNT_OBJECT })
wiredOpportunityObjectInfo({ error, data }) {
if (data) {
console.log(data.fields[ACCOUNT_OBJECT_NAME.fieldApiName]);
} else if (error) {
console.log(error);
}
}
displays data (below) that shows no evidence of the encryption being turned on which is pretty disappointing. I'm trying to turn off lightning-datatable
column sorts when such sorts are not possible in the database.
I see no mention of Shield Platform Encryption in the User Interface API Developer Guide.
Am I stuck with writing a dedicated Apex API to return the list of encrypted fields that I need?
apiName: "Name"
calculated: false
compound: true
compoundComponentName: null
compoundFieldName: "Name"
controllerName: null
controllingFields: [] (0)
createable: true
custom: false
dataType: "String"
extraTypeInfo: "SwitchablePersonName"
filterable: true
filteredLookupInfo: null
highScaleNumber: false
htmlFormatted: false
inlineHelpText: null
label: "Account Name"
length: 255
nameField: true
polymorphicForeignKey: false
precision: 0
reference: false
referenceTargetField: null
referenceToInfos: [] (0)
relationshipName: null
required: true
scale: 0
searchPrefilterable: false
sortable: true
unique: false
updateable: true
Best Answer
Did some more Googling and didn't find anything documented or a standard platform alternative. Happy to accept an alternative answer, but for now I've added this code:
and at the client-side the column sorting is modified using that: