Можно
X++:
// If '_mapField' and '_tableField' are empty: true if the '_mapId' map have a mapping for table '_tableId'
// If '_mapField' is not empty: true if the '_mapId' map have a mapping for it's field '_mapField' for table '_tableId'
// If '_tableField' is not empty: true if the '_mapId' map have a mapping for table's field '_tableField' for table '_tableId'
// If '_mapField' and '_tableField' are not empty: true if '_mapField' is a mapping for '_tableField' on map '_mapId' for table '_tableId'
static public boolean mappingExists_RU(tableId _mapId,
tableId _tableId,
fieldId _mapField = 0,
fieldId _tableField = 0)
{
boolean ok;
Map map = MappingsInfo_RU::createMapWithFieldId( _tableId, _mapId);
identifiername fieldName;
;
if (! map.empty())
{
if (_mapField || _tableField)
{
if (_mapField && _tableField)
{
fieldName = fieldid2name(_mapId, _mapField);
if (map.exists(fieldName) && (map.lookup(fieldName) == _tableField))
{
ok = true;
}
}
else if (_mapField)
{
if (map.keySet().in(fieldid2name(_mapId, _mapField)))
{
ok = true;
}
}
else if (_tableField)
{
if (map.valueSet().in(_tableField))
{
ok = true;
}
}
}
else
{
ok = true;
}
}
return ok;
}