Simple question

ayamas
Member Posts: 15
Hi guys,
Its just one week that i have moved to navision development.What I want to know is that how can i check whether a record exists in the table.
Thanks in advance
Its just one week that i have moved to navision development.What I want to know is that how can i check whether a record exists in the table.
Thanks in advance
0
Comments
-
Hi,
IF RECORD.GET(KEY) THEN "Record exist"
ELSE "There is no such a record".Andrejs Muraskins0 -
If you are looking for 1 record based on primary key, then use Rec.GET.
If you are checking to see if any records are in table, then use Rec.ISEMPTY.
Example:
Rec.SETFILTER(....)..
IF Rec.ISEMPTY THEN
MESSAGE('No Records')
ELSE
MESSAGE('Records Found');There are no bugs - only undocumented features.0 -
Thanks for all the replies,
But still i am not able to get the needed output.
I have a date filter where the user enters the date & then the application treis to find the record in the table named Purch. Inv. Line & if does not finds the dates in the Purch. Inv. Line table it tries to find it in another table named as Item ledger entry.
Can I pls get the exact syntax.
Any help is greatly appreciated0 -
Two qustions
1. Is the user entering a single date or a range of dates?
2. Do you need to handle the record after finding it, or just check if it exist.There are no bugs - only undocumented features.0 -
The user enters just the single date & I just want to check the record if it exists
I would greately appreciate if u help me in doing the same thing if user selects a range of dates.0 -
How are you filtering the "Purch. Inv. Line" table? The "Item Ledger Entry" table has a "Posting Date" that would probably correspond to the date entered by the user, but the "Purch. Inv. Line" table does not.
I need to work with a customer now $$$, but will respond when I can.There are no bugs - only undocumented features.0 -
OK now please let me give u the details of what i am trying to acheive.
I am trying to write the stock ageing report.
Here for each item I want to find a last purchase date which is present in purchase.Inv.Line table & for tat item if there is no last purchase date then i want to find the last positive adjustment date which is present in the Item ledger entry.
Thanks In advance0 -
If user enters a single date then.............
Store userdate in a varaible. let's say SearchDate.
then create a record variable of purchase Invoice line. let's say PurchInvLine.
PurchInvLine.setrange(PurchInvLine.Field,SercahDate);
If PurchInvLine.find('-') then
Begin
Write ur logic here.
End
Else
Begin
ItemLedentry.setrange(ItemLedentry.Field,SercahDate);
If ItemLedentry.find('-') then
Begin
Write ur logic here.
End
End;0 -
An outline:
CLEAR(PurchInvHeader); PurchInvHeader.SETCURRENTKEY("Posting Date"); //create the key if it does not exist PurchInvHeader.SETFILTER("Posting Date",UserDateFilter); // invoice lines do not contain posting date IF PurchInvHeader.FIND('-') THEN BEGIN CLEAR(PurchInvLine); PurchInvLine.SETRANGE("Document No.",PurchInvHeader."No."); IF PurchInvLine.FIND('-') THEN REPEAT //do something END; END ELSE BEGIN CLEAR(ItemLedgEntry); //same key-key-filtering-repeat stuff END;
0 -
Thank you guys for all the replies
But since I am new to navision development can anyone pls tell me in what report trigger to write all the code.Can anyone please categorise for me.
I know I am asking for spoon feeding but I am very new to this kind of enviroment0 -
See, I won't work this way. It's not possible to remote control a beginner over the forum to perform a development task of approximately medium difficulty. Just tell your boss you need to learn this stuff first, and spend at least three days reading Application Designer's Guide, Solution Developer's Guide, searching for all report triggers in the C/SIDE help etc.0
-
Ok I understand.
Thanks for all the help.I greatly appreciate it.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions