auto show text from other table in a form

Hi All,

refer to the print screen, the test performed field is link to ""Raw Materials Testing Plan" table, is it possible when i choose testing Plan 50, it will show out Test Name "Particle Density (Apparent)" and show the "TestResult UOM" for example Mg/m3 in the forms?

When i choose Testperform 10, it will show "Weight Test" and the TestResult UOM show kg.

The Test Name  and UOM is all located to ""Raw Materials Testing Plan" Table.

Anyone get what i meant?

  • Hi,

    as per understanding, you can get the value from "Raw Materials Testing Plan" Table and store it in variable and display it
    on form where ever you want to display and make it EDITABLE:= No.
  • In reply to shyam pandey:

    Hi,
    how to get the value from the table? Any guide for me?
  • In reply to jliang84:

    you can use GET or Setrange with common field.
    and in design you can add fields in table.
    Please take help of any senior person or programmer who is near by.
  • In reply to shyam pandey:

    Hi Shyam,
    My nearest senior person is this forum now.
    As for your information, i am the only guy need to handle the navision system at the moment.
  • If you can get the desire data, assign it to the respective field and update the form. The values will allocate as soon as you select the Testperform.
  • In reply to devdrone:

    Hi Devdrone,
    I don't know how to do it... any guide / tutorial ?
  • In reply to jliang84:

    Hi,
    You need to perfrom setrange.
    In OnValidate of the TestPerfomed field, you need to setrange between the common field like below:
    define your table Raw Materials Testing Plan as a variable say RawMaterialsTestingPlanTable

    RawMaterialsTestingPlanTable.reset;
    RawMaterialsTestingPlanTable.setrange(TestPerfomed,Rec.TestPerformed);
    if RawMaterialsTestingPlanTable.Findfirst then begin
    Rec.TestResult:=RawMaterialsTestingPlanTable.TestResult;
    rec.name:=RawMaterialsTestingPlanTable.name;
    end;
  • In reply to Tina_Menezes:

    Hi Tina,

    Thanks for replying.. i am still headache on this issue.....

     

    Here is the table design for "Raw Material Testing Plan" and "Raw Material Testing Results"Table...

    I am not really understand on the coding...
    RawMaterialsTestingPlanTable.reset;
    RawMaterialsTestingPlanTable.setrange(TestPerfomed,Rec.TestPerformed);
    if RawMaterialsTestingPlanTable.Findfirst then begin
    Rec.TestResult:=RawMaterialsTestingPlanTable.TestResult;
    rec.name:=RawMaterialsTestingPlanTable.name;
    end;

    From my understanding, i need to set a C/AL Global:

    then put the code in "OnValidate" of the testperformed field?

    Sorry, i really new in NAV and no where for me to ask already except here..........

  • In reply to jliang84:

    That codes Tina wrote you was for getting the value from a table.
    Also, use a global variable for the value you get from the different table then set it in the box to show from the view, I think it would be in the property of the box.
  • In reply to maihuishin:

    Yeahh!! finally i get the way to display the thing..
    i change some of the code and put it in "on after get currRecord". .. it helps!!
    thanks everyone.
  • In reply to jliang84:

    Remember to set the new control as Editable=FALSE - or you need to make functionality to update also?
  • In reply to Erik P. Ernst:

    Hi Erik,
    Yeap, i set the editable to "No" and focusable to "No"....
    thanks for reminder!
    by the way, what is functionality update?
  • In reply to jliang84:

    With "functionality to update" I mean, that you would need to have functionality to update the field. If required, then you could create a function, called by the OnVerify trigger to update the variable, not just show it.
  • In reply to Erik P. Ernst:

    Yeap, i had put the coding in onverify for "testPerformed" also..... once change the testperformed the "variable" will change as well.
    Thanks a lot for reminder!
Related