Skip to content

Validate configuration on save #2

@tprouvot

Description

@tprouvot

We have to ensure that the configuration is valid.

For example if we configure a MaskSObjectField to erase Account name field, we must throw an error because this field cannot be empty.

SObject sobj = [SELECT Id FROM Contact LIMIT 1];

Schema.DescribeSObjectResult r = sobj.Id.getSObjectType().getDescribe() ;
Map<String,Schema.SObjectField> fields = r.fields.getMap();

//System.debug(LoggingLevel.INFO, fields);
Schema.DescribeFieldResult dfr = fields.get('email').getDescribe();
System.debug(LoggingLevel.INFO, 'email is nillable ' + dfr.isNillable());

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions