new field-Help

navfreshernavfresher Member Posts: 44
I have 2 fields(F1,F2) in a table where they contain some values.Now i have created a new field(F3) in which i want to store the value of F1-F2.

I have written a code for the on the on validate function of the new field.But the value is not updating.What can be the reason?

The acutal code is this :


GLBE = G/L budget entry

GLBE.SETRANGE(GLBE."G/L Account No.","G/L Account No.");
GLBE.SETRANGE(GLBE."Global Dimension 1 Code","Global Dimension 1 Code");
IF GLBE.FINDFIRST THEN
GLBE.F3:= GLBE.F1-GLBE.F2;

Any help?

Comments

  • vikram7_dabasvikram7_dabas Member Posts: 611
    Dear Concern
    Dont write this code on OnValidate trigger of new field write this code on Onvalidate date trigger of field F2
    Vikram Dabas
    Navision Technical Consultant
  • navfreshernavfresher Member Posts: 44
    Dear Concern
    Dont write this code on OnValidate trigger of new field write this code on Onvalidate date trigger of field F2

    Thank you for your time..but still the problem exists
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Dear Concern
    When u want to enter the value of F1-F2 in F3?
    Vikram Dabas
    Navision Technical Consultant
  • navfreshernavfresher Member Posts: 44
    Dear Concern
    When u want to enter the value of F1-F2 in F3?

    There are 2 cases...
    1)when ever F2 field is effected.It effects when ever i post a purchase order
    2)When ever i create a new budget line in the budget form

    Note: F2 is a flow field.Is it of any problem?
  • vikram7_dabasvikram7_dabas Member Posts: 611
    navfresher wrote:
    Dear Concern
    When u want to enter the value of F1-F2 in F3?

    There are 2 cases...
    1)when ever F2 field is effected.It effects when ever i post a purchase order
    2)When ever i create a new budget line in the budget form

    In Case 1:
    Whenever ur F2 field is effected while Postion PO, just below it(means in next line) write ur above code.

    Case 2:
    u means in Dimension Buffer table.If not then plz specify the Form ID.Then I can help u or determine the source table where u r entering Budget line and then enter ur above code on its OnInsert trigger.
    Vikram Dabas
    Navision Technical Consultant
  • navfreshernavfresher Member Posts: 44
    navfresher wrote:
    Dear Concern
    When u want to enter the value of F1-F2 in F3?

    There are 2 cases...
    1)when ever F2 field is effected.It effects when ever i post a purchase order
    2)When ever i create a new budget line in the budget form

    In Case 1:
    Whenever ur F2 field is effected while Postion PO, just below it(means in next line) write ur above code.

    Case 2:
    u means in Dimension Buffer table.If not then plz specify the Form ID.Then I can help u or determine the source table where u r entering Budget line and then enter ur above code on its OnInsert trigger.

    Case 1:
    I am fetching the value by making it a flow field.So where actually i should write the code?

    Case 2:
    Form 120 and Table is 96
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Case I:
    Write code in codeunit 90 by using Calc Function (used to calculate Flow Field).

    Case II:
    Write code on Onsert trigger of Table 96.
    Vikram Dabas
    Navision Technical Consultant
  • lvanvugtlvanvugt Member Posts: 774
    See my post on the same here: http://dynamicsuser.net/forums/t/30498.aspx

    [why post on both forums? You keep double number of people busy ...)
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
Sign In or Register to comment.