can we change flowfield in the header, and then affect line

julkifli33julkifli33 Member Posts: 1,087
hi all
i have a case
for example i create new flowfield in purchase header
which sum from purchase line

i have 3 items. the line amount is 100, 200 and 300
so total 600

this 600 will be showed in the header
when i change this 600 become 610, so the line become 110,200,300
can we do that?
thanks

Comments

  • GRIZZLYGRIZZLY Member Posts: 127
    If you use flowfield and edit the value, the new line would be created.
    In your case a new line with value 10 would be created.
    I suppose you should use a field on the form, which would be calculated on open form or editing subform. And proceed with trigger OnValidate of the control, you should check the modification of the value and modify the line, update the form.
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • BeliasBelias Member Posts: 2,998
    a "sum" type flowfield is editable and affect the lines on which is calculated by default.
    anyway, it does not work as you like, because it creates a new line (positive or negative) instead of increasing/decreasing an existing line.
    moreover, not every field is populated but just those defined in the flowfield definition. you can try with the budget functionality to see how does it work (form 113)...as i always say: "a line of code worth 1000 words" ;)
    p.s. my 2 cents: this standard functionality won't fit your business need perfectly in my opinion...please explain why you want to do this modification...
    GRIZZLY was faster :(
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • julkifli33julkifli33 Member Posts: 1,087
    i need amount in 3 currencies
    so i add new field amount
    to avoid mistake rounding, so i want to made it editable

    how to create new line automatically if we modify it?
  • BeliasBelias Member Posts: 2,998
    I suppose you should use a field on the form, which would be calculated on open form or editing subform. And proceed with trigger OnValidate of the control, you should check the modification of the value and modify [OR INSERT] the line, update the form.
    it has been already explained... :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • julkifli33julkifli33 Member Posts: 1,087
    Belias wrote:
    a "sum" type flowfield is editable and affect the lines on which is calculated by default.
    anyway, it does not work as you like, because it creates a new line (positive or negative) instead of increasing/decreasing an existing line.
    moreover, not every field is populated but just those defined in the flowfield definition. you can try with the budget functionality to see how does it work (form 113)...as i always say: "a line of code worth 1000 words" ;)
    p.s. my 2 cents: this standard functionality won't fit your business need perfectly in my opinion...please explain why you want to do this modification...
    GRIZZLY was faster :(
    i dont get the code where it insert a new line
  • BeliasBelias Member Posts: 2,998
    you CAN'T get it, because there isn't: it's how nav works: if you try the budget form you'll notice that everything happens "magically". If you want to do a custom solution (which is probably better for you) you won't need a flowfield, but a normal field (or maybe even a variable is enough for you), and then follow GRIZZLY's suggestion
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    This function is a left over from the DOS version of Navision, back then you didn't have triggers the same as we have now, so it was difficult to create this type of functionality.

    You can still use it, though you almost always need to put code in the OnInsert trigger of the underlying table. But in my opinion, if you are creating something new like this, better is to code the whole thing manually, that way you have much better control.
    David Singleton
Sign In or Register to comment.