Hello RHODPR
Whenever we perform a fetch operation using the axapta table object if data
are returned by the database then the table object used is alive which can
be verified using the recid or checking if the object is not null
for example
InventTable InventTable_Tst ; // declare a table object
select InventTable_Tst where InventTable_Tst.itemID = "It001";
if (InventTable_Tst)
{
// the database has returned matching records
// processing
}
else
{
// no records return by the Database that is table object is null
// processing like create records etc.....
}
however all the basic axapta tables have a method on the table level
named exist() which can also be used for the above purpose mentioned by you
In the example of inventtable you can proceed as
if (InventTable::exist("It001"))
{
// matching record exists
// processing
}
else
{
// no matching records exists in the Database
// processing like create records etc.....
}
Njoy your work.....
Deeps
>From: "RHODPR" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [development-axapta] empty select statement
>Date: Mon, 06 Dec 2004 17:44:00 -0000
>
>
>
>Hi,
>
>how can I make sure that a select statement is not empty? For
>example if I make a statement
>
>select firstonly from inventTable where inventTable.itemID = "It001";
>
>how can I know whether inventTable is containing any records? If
>the record It001 doesn't exist yet, I should create it. Yet
>therefor I need to be able to check if it exists or not...
>
>
>
>
>
>
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

