Cfront findrec problem

vyanku
Member Posts: 791
I create a application in VB having textbox-findcust and button search.
Please tell me how can write findrec so that I can search the inserted record from the table?
Private Sub Command1_Click() findcust1 = findcust cust = Customer custTableId = 18 FIELDNO = 1 Call CFRONT2.OpenTable(cust, custTableId) custrec = CFRONT2.AllocRec(cust) [b]tmpvar = CFRONT2.FindRec(cust, custrec, findcust1)[/b] TxtCustName = CFRONT2.GetFieldData(cust, custrec, 2) TxtCustNo = CFRONT2.GetFieldData(cust, custrec, 1) End SubProblem is when I insert customer code in textbox and click on button bit it will not search that no. in customer table.
Please tell me how can write findrec so that I can search the inserted record from the table?
0
Comments
-
You first need to assign the customer number to the record, then find using the '=' search method, like:
CFRONT2.AssignField(cust, custrec, 1, findcust1) tmpvar = CFRONT2.FindRec(cust, custrec, "=")
This works for finding primary key values. Otherwise you need to use SetRange or SetFilter to first apply a filter, then use the "-" search method to get the first mathing record.Dean McCrae - Senior Software Developer, NAV Server & Tools
This posting is provided "AS IS" with no warranties, and confers no rights.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