Writing data to a flow field

ptech5443
Member Posts: 28
I am looking for a way to write data to a flow field. I am creating a process only report that updates a flow field. The problem is that after the report runs the flow field is not changed. I have stepped through the code as the report runs. I can see the flowfield value change but as the report loops through the data item the value changes back to zero. I have tried a modify, insert and commit after updating the field and nothing seems to change. Does anyone know if it is even possible to write data to a flow field in code? If it is possible then how?
0
Answers
-
Why would you want to update a flowfield? By definition, a flowfield 'flows' data from somewhere else.
If you want to be able to update the field, then either make a new field or change the field to not be a flowfield.
Or, change the underlying formula.
So if the flowfield is say the customer name, based on the customer number, and it looks up to the customer table, then you cant change the flowfield, but if you go GET the customer record, and update the Name field, then your flowfield will change. Of course it will also change for every other flowfield that looks up to the name...
Maybe you should post more of what you are trying to do.
-a0 -
I have built a custom table for scheduling. The table has a flow field, Mon Avail Hrs, with the following calcformual: Sum("Res. Capacity Entry".Capacity WHERE (Date=FIELD(Mon Date),Resource No.=FIELD(Resource Filter),ResourceOfficeCode=FIELD(Office Filter),Scheduled Resource=FILTER(Yes))). The resource capcity is the underlying table. I am trying to take advantage of the Navision feature that will allow you to enter data in the flow field and it will create the entry in the underlying table. It will save me from writing the process to filter the resource capacity table and loop through each date to find how many hours the resource has for a capcity already and determine the difference to enter.0
-
ptech5443 wrote:I am trying to take advantage of the Navision feature that will allow you to enter data in the flow field and it will create the entry in the underlying table.
awarn and others : it is possible to write data to the DB through a flowfield, but only few people know this obscure feature. And it is easily forgotten. Just a few days ago, a collegue reminded me of the feature. :oops:Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
If for instance you have a sum type flowfield into another table, and you enter a value into the flowfield, then Navision will create an entry in the target table to make the flowfield true.
So if you make the customer balance editable, and the customer balance is 0, and you enter 25 into the field, Navision will write a Customer Ledger Entry for the "missing" 25.0 -
This feature is often used to easily create budgets or job/resource planning.0
-
DenSter wrote:So if you make the customer balance editable, and the customer balance is 0, and you enter 25 into the field, Navision will write a Customer Ledger Entry for the "missing" 25.0
-
Have a look at the Job module. Escpecially the Job Budget Entry.
This functionality is a good example of standard Navision. You can make a Job planning and create entry records by modifying data in a matrix.0 -
-
for ptech5443:
in my opinion it is not possible do that by C/AL. You will need to insert the entry in standard way through the C/AL. This behavior is only for entering the data through visual components...0 -
-
I got it to work. Thanks for your help. The "it" is that I am "loading" the capacity for resource for scheduling. I am writing the capacity to flowfileds in a custom table where the flow is coming from the Res. Capacity Entry table. The Navision feature is taking care of the entry. There was a current process in place that was writing to the Res. Capacity Entry table. The problem was that users where running the process multiple times for the same resource. This would cause the capacity to double. The new design allows for the process to be run multiple times without the doubling.
The design of the report is as follows: I created a process only report that has two data items. The first being the Resource and the second being the Date. In the date data item is the logic for finding the period name and date. after determining that I have a case statement
CASE "Period Name" OF
'Monday':
BEGIN
CompanySchedule.CALCFIELDS("Mon Avail Hrs");
CompanySchedule.VALIDATE("Mon Avail Hrs",DailyHours[1]);
END;
'Tuesday':
......
The DailyHours[1] is coming from the options tab of the request form of the report. With this report I am creating a capcity for the resource on a daily basis. I am able to populate 8 hours per day for an entire year in about 8 seconds.0 -
-
That is the fun of this board. It beats any training course0
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