Hi i am new to navision. I have a problem. I have to add two values from the same field from the same table which has lots of data. They have the same document no. and supplier no. .
For e.g
Docu no. supplier no. value
34652 234 15
34652 234 0.01
How do i filter the two values' document and supplier no. out so that I can add them together. Please advice.
0
Comments
Please put following formula.
value :='34652 234 15';
FirstValue := COPYSTR(value,1,5);
secondvalue := copystr(value,7,3);
message('First Value=%1 Second Value =%2',firstvalue,secondvalue);
Hope this will help you
That can be done by making a flowfield to the table itself, just calculate the sum of the field "value" of all lines with the same document no. and supplier no.
Assume you have a Record variable called MyRec that relates to your data table, as well as a decimal variable called MySum.
Now of course this is simple sample code. You would want to use SETCURRENTKEY to select a better key for the record if the primary key doesn't include those two fields and you would never want to hardcode your filter criteria into the code in real use. I hope this helps, without more specific information it is hard for me to give a more targeted example.
I traded my sanity for a railgun