[Fix] Prevent fields name conflicts with composite subfields names (#6713)
At field creation we are checking the availability of the name by comparing it to the other fields' names' on the object; but for composite fields the fields' names' as indicated in the repository do not exactly match the column names' on the tables (e.g "createdBy" field is actually represented by columns createdByName, createdBySource etc.). In this PR we prevent the conflict with the standard composite fields' names. There is still room for errors with the custom composite fields: for example a custom composite field "address" of type address on a custom object "listing" will introduce the columns addressAddressStreet1, addressAddressStreet2 etc. while we won't prevent the user from later creating a custom field named "addressAddressStreet1". For now I decided not to tackle this as this seem extremely edgy + would impact performance on creation of all fields while never actually useful (I think).
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
export class InvalidStringException extends Error {
|
||||
constructor(string: string) {
|
||||
const message = `String "${string}" is not valid`;
|
||||
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
export class NameNotAvailableException extends Error {
|
||||
constructor(name: string) {
|
||||
const message = `Name "${name}" is not available`;
|
||||
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
export class NameTooLongException extends Error {
|
||||
constructor(string: string) {
|
||||
const message = `String "${string}" exceeds 63 characters limit`;
|
||||
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user