From a Form retrieve a Value from a Table

mnewmedia
Member Posts: 13
Hello togheter! I'm new to Navision and to Mibuso.
I made a Form, on this Form i put a TextBox this should show me the invoiced price/cost of all jobs.
I found the table "Job Task 1001" and there is the value i want the field "Contract (Invoiced Cost)".
I tried to put in the SourceExp: JobTaskRec."Contract (Total Price)" but the value is then ever 0.00. maybe because it's a flowfield
and I have to insert somewhere a clalcfield statement?
So now, how do i get this value showed in my TextBox?
Thanks for any help or hint.
I made a Form, on this Form i put a TextBox this should show me the invoiced price/cost of all jobs.
I found the table "Job Task 1001" and there is the value i want the field "Contract (Invoiced Cost)".
I tried to put in the SourceExp: JobTaskRec."Contract (Total Price)" but the value is then ever 0.00. maybe because it's a flowfield
and I have to insert somewhere a clalcfield statement?
So now, how do i get this value showed in my TextBox?
Thanks for any help or hint.
mnewmedia
NAV 2009 R2
NAV 2013 R2
NAV 2009 R2
NAV 2013 R2
0
Comments
-
Welcome to Mibuso
What is the source table of the form?
did you try something?0 -
Thanks for Replymohana_cse06 wrote:did you try something?
Yes, I tried to put in the SourceExp: JobTaskRec."Contract (Total Price)" but the value is then ever 0.00. maybe because it's a flowfield
I could get it work, but with C/AL Code. And i think there must be an other way with the SourceExp :-k .Vars: -JobInvoiced = dezimal -JobTaskRec = Record, Job Task JobTaskRec.GET('1','WEB'); JobTaskRec.CALCFIELDS("Contract (Invoiced Price)"); JobInvoiced := JobTaskRec."Contract (Invoiced Price)"
I didn't define a SourceTable because, i make for learning purposes a Form like a Quickview of open bills, payed bills, invoiced jobs, amount of articels and so on. To do this i need a lot values of different tables so i could not decide me for a SourceTable.mnewmedia
NAV 2009 R2
NAV 2013 R20 -
Some points to note:
1. first you should get all the jobs from Jobs table
2. repeat the jobs and then get the Job tasks for the above jobs
3. repeat job tasks and save the value in variable..
Please try and let me know..0 -
dadaaa \:D/
Trigger: Form - OnOpenForm: IF JobTaskRec.FIND('-') THEN REPEAT JobTaskRec.CALCFIELDS("Contract (Invoiced Price)"); TotalJobInvoiced := TotalJobInvoiced + JobTaskRec."Contract (Invoiced Price)"; UNTIL JobTaskRec.NEXT = 0;
And then i did the TotalJobInvoiced variable in the SourceExp of the TextBox. That works now fine..
1. but is this a clean way?
2. Isn't there a way to get this without writing C/AL Code?
3. And do i have to define a SourceTable or is it in my case bette to leave it blank?
4. is it possible to insert this Code in a function and pass the Record and Field with a paramater?
Thanks!mnewmedia
NAV 2009 R2
NAV 2013 R20
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