The property to check
true if the property is a relation type, false otherwise
import { PlatformServiceName, isRelation } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeTypeRepository);
const limetype = repository.getLimeType('deal');
const relationProps = Object.values(limetype?.properties ?? {}).filter(
isRelation
);
for (const property of relationProps) {
const relatedType = property.relation?.getLimetype();
console.log('Links to:', relatedType?.name);
}
Check if a property is a relation type that links to another LimeType.
Relation types are:
hasone,hasmany,belongsto, andhasandbelongstomany. These properties establish relationships between different object types in the CRM.Use this helper to determine if a property value will be a LimeObject or array of LimeObjects rather than a simple value.