Find Method

public static _PropertyTable find(_PropertyId _propertyId, boolean _forUpdate = false)
{
    _PropertyTable  propertyTable = null;

    propertyTable.selectForUpdate(_forUpdate);

    if (_propertyId)
    {
        select firstonly propertyTable where propertyTable.PropertyId == _propertyId;
    }

    return propertyTable;
}






static _BuildingUnitDetailsDim findPropertyDescFlat(_PropertyId      PropertyId,
                                          Description          Description,
                                          _FlatNumber       FlatNumber,
                                          boolean     _forUpdate = false)
{
    _BuildingUnitDetailsDim  BuildingUnitDetailsDim;

    if (PropertyId)
    {
        BuildingUnitDetailsDim.selectForUpdate  (_forUpdate);
        BuildingUnitDetailsDim.selectLocked     (_forUpdate);

        select firstonly BuildingUnitDetailsDim
            index hint PropertyIdx
            where BuildingUnitDetailsDim.PropertyId       == PropertyId  &&
                  BuildingUnitDetailsDim.Description   == Description   &&
                  BuildingUnitDetailsDim.FlatNumber    == FlatNumber;
    }

    return BuildingUnitDetailsDim;
}

Comments

Popular posts from this blog

Create RFQ through X++

Base enum values in Dynamics 365

Project Id through X++ code