problem adding field from second table to a form

tzikitzaketzikitzake Member Posts: 13
I try to add fields from "Ledger Entry Dimension" to a form based on "Job Ledger Entry" by this code on the OnAfterGetRecord() of the form (t355 var. points to "Ledger Entry Dimension":

t355.reset;
t355.setrange(t355."Table ID",169);
t355.setrange(t355."Entry No.","Entry No.");
t355.setrange(t355."Dimension Code",'ACTIVIDAD');
IF t355.FIND('-') THEN;

then I added the t355."Dimension Value Code" field to the form, but when I run the form, this field is empty. What is wrong with that?

thanks.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I tried with the below code in Form-OnAfterGetRecord trigger and working fine
    CLEAR(t355);
    t355.RESET;
    t355.SETRANGE(t355."Table ID",169);
    t355.SETRANGE(t355."Entry No.","Entry No.");
    t355.SETRANGE(t355."Dimension Code",'AREA');
    IF t355.FIND('-') THEN;
    
  • raveendran.sraveendran.s Member Posts: 119
    tzikitzake wrote:
    I try to add fields from "Ledger Entry Dimension" to a form based on "Job Ledger Entry" by this code on the OnAfterGetRecord() of the form (t355 var. points to "Ledger Entry Dimension":

    t355.reset;
    t355.setrange(t355."Table ID",169);
    t355.setrange(t355."Entry No.","Entry No.");
    t355.setrange(t355."Dimension Code",'ACTIVIDAD');
    IF t355.FIND('-') THEN;

    then I added the t355."Dimension Value Code" field to the form, but when I run the form, this field is empty. What is wrong with that?

    thanks.

    Check the trigger and the variables once again...
    --
    Regards,
    Raveendran.BS
  • tzikitzaketzikitzake Member Posts: 13
    I tried with the below code in Form-OnAfterGetRecord trigger and working fine
    CLEAR(t355);
    t355.RESET;
    t355.SETRANGE(t355."Table ID",169);
    t355.SETRANGE(t355."Entry No.","Entry No.");
    t355.SETRANGE(t355."Dimension Code",'AREA');
    IF t355.FIND('-') THEN;
    

    I have tried adding "clear(t355);" like you, but still have the same problem.

    when I add the field to the form, I just fill the "SourceExpr" with t355."Dimension Value Code". Do you change anything else on the field or anywhere else?

    thanks
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    No..i didnt modify anything else except adding source expr t355."Dimension Value Code"

    BTW, which version you are using?

    Are you sure you have data with your filter? :-k
  • tzikitzaketzikitzake Member Posts: 13
    sorry,
    problem solved it was as expected a stupid problem: 'ACTIVIDADES" instead of 'ACTIVIDAD'

    Thanks
Sign In or Register to comment.