Fetching data in header and line table based on text box

smshyd
Member Posts: 72
Hi,
Can any body give me idea on this. I have form based on the tables similar to sales header and sales line which contains data in it. But the requirement is that , when we open form, we should not able to see any records in it. User will be given one text box in which users enters the primary key of that table then data from both in header and line should be fetched. can any body give me idea how to achieve this
Can any body give me idea on this. I have form based on the tables similar to sales header and sales line which contains data in it. But the requirement is that , when we open form, we should not able to see any records in it. User will be given one text box in which users enters the primary key of that table then data from both in header and line should be fetched. can any body give me idea how to achieve this
0
Comments
-
Why you want to do this and what you have tried as of now?0
-
Look at the General Journal form as a place to start. Where the Batch Name is you could set this to blank or some value which will never exist each time the form is opened. Then this would be where the user enters or even looks up the record they want to display.Gerry Kistler
KCP Consultores0 -
this code in general journal is not working in the above forms
GenJnlLine.FILTERGROUP := 2;
GenJnlLine.SETRANGE("Journal Batch Name",CurrentJnlBatchName);
GenJnlLine.FILTERGROUP := 0;
can any body suggest how to block showing of all records when form is opened or until that primary key is specified0 -
We have a form that has 1 textbox where an PO# is entered (scanned into)
It searchs the sales orders and if it finds a match it bings up that order.
If it doesn't find a match it then searches the posted invoices.
If it finds a match it then brings up that invoice.
else it says order not found.
We call it our quick search form.
Sounds like you are looking for something like that. or you can study the code to see how it works and then implement your own.
InvCount->Integer
SalesInvoiceHeader->Record->Sales Invoice Header
SalesHeader->Record->SalesHeader
ScanOrderNo->Code20
SalesForm->Form->Sales Order
InvoiceForm->Form->Posted Sales Invoice
SourceExp of textbox = ScanOrderNoOnAfterValidate() of the textbox IF ScanOrderNo = '' THEN BEGIN MESSAGE('You Cannot Search A Blank Number!'); END ELSE BEGIN SalesHeader.SETCURRENTKEY("Document Type","No."); SalesHeader.SETRANGE("External Document No.",ScanOrderNo); IF SalesHeader.FIND('-') THEN REPEAT InvCount := InvCount +1; UNTIL SalesHeader.NEXT = 0; IF SalesHeader.FIND('+') THEN BEGIN MESSAGE('Number Of Open Order(s) Found= %1',InvCount); CLEAR(SalesForm); SalesForm.LOOKUPMODE(TRUE); SalesForm.SETTABLEVIEW(SalesHeader); SalesForm.RUNMODAL; CLEAR(ScanOrderNo); END ELSE BEGIN SalesInvoiceHeader.SETCURRENTKEY("Sell-to Customer No.","External Document No."); SalesInvoiceHeader.SETRANGE("External Document No.",ScanOrderNo); IF SalesInvoiceHeader.FIND('-') THEN REPEAT InvCount := InvCount +1; UNTIL SalesInvoiceHeader.NEXT = 0; IF SalesInvoiceHeader.FIND('+') THEN BEGIN MESSAGE('Number Of Posted Order(s) Found= %1',InvCount); CLEAR(InvoiceForm); InvoiceForm.LOOKUPMODE(TRUE); InvoiceForm.SETTABLEVIEW(SalesInvoiceHeader); InvoiceForm.RUNMODAL; CLEAR(ScanOrderNo); END ELSE BEGIN MESSAGE('Order Not Found'); CLEAR(ScanOrderNo); CurrForm.UPDATE; END; END; END; CLEAR(InvCount);
0 -
Can't we do in one form, above code requires two forms0
-
It's one form with 1 textbox - then if calls already existing forms to pull the order you are looking for.
now that's just an example - I don't know the exact requirement you are trying solve.
I happen to put the textbox on a seperate form but you can try it anywhere you like.
All the code is OnAfterValidate of the textbox so it's all inclosed in one thing.
We use it to search posted & non posted orders - you might not need this - so you can use snipits if you like - it was just an example.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