General X++ Development
How do I check if a record exists in X++?
How do I check if a record exists in X++?
1 answer
Write an answerUse firstOnly and check RecId.
SalesTable salesTable;
select firstOnly RecId from salesTable
where salesTable.SalesId == 'SO-000001';
if (salesTable.RecId)
{
info('Record exists.');
}If existence is all you care about, only select the field you actually need.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer