Page design in Microsoft Dynamics NAV 2017

Hi,

I have two table called: Commutation Matrix and Membership Exit, in commutation matrix table are fields as follow: Schedule (code 10), Age (integer), Gender (option: Male,Female), Nx (decimal), Dx (decimal), why Membership Exit table are fields as follow: No. (code 10), Member No. (code 20 link to vendor table), member name (text 80), Age (decimal), Gender (Option: Male,Female), NxDx (decimal), nc (decimal).

From Commutation Matrix table, I design a page called Commutation which contains data for both male and female separately.

Schedule Age Gender Nx Dx Nx/Dx
F 40 Male 479,949.2862 39,615.3130 12.115246590
F 40 Female 493,761.6769 39,701.1114 12.436973650
From the Membership Exit table under C/AL of Age, I wrote these code

The definition in the Global variable;

CommutationTable Record Commutation Matrix

member Record Membership Exit

CommutationTable.RESET;
CommutationTable.SETRANGE(CommutationTable.Age,AgeatExit);
IF member.GET(MemberNo) THEN
//MESSAGE('%1',member.Gender);

IF member.Gender = member.Gender::Male THEN

CommutationTable.SETRANGE(CommutationTable.Gender,CommutationTable.Gender::Male)
ELSE
CommutationTable.SETRANGE(CommutationTable.Gender,CommutationTable.Gender::Female);


IF CommutationTable.FIND('-') THEN
BEGIN
CommFactor:=CommutationTable."Nx/Dx"
END
ELSE
MESSAGE('The Pencom table has not been imported for this age please check and import');

nc:=NxDx-(11/24);

I designed a page called Membership Exits from Membership Exit table:

From page, when i inputted the Age. It gave me the value for Female even when i chose Male as a Gender.

Please help me out,

Thanks,

Answers

  • Slawek_GuzekSlawek_Guzek Posts: 1,234Member
    Lets try to precise what have you done so far and what you'd like to achieve

    Fro your description I understood that you have designed two tables: Commutation Matrix and Membership Exit.

    you have also designed two forms (forms? or pages? this is the NAV/Navision Classic Client forum so I assume you are talking about forms). One form shows the data from the Commutation Matrix table and another show the data from the Membership Exit.

    Lets leave the code aside as it seems irrelevant at the moment.

    My question is -are these forms independent, and you are showing the 2nd form from the 1st using some code, or a button with defined object id and link?

    or

    are these form organized like the Sales Order form (document header + a subform with document lines) - your form 1 is (shoudl be) the header, and it contains a subform, which is the form 2?





    Slawek Guzek
    PECB Certified Data Protection Officer - DPCDPO1025070-2018-03
    AXELOS PRINCE2 Practitioner - GR657010572SG
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
Sign In or Register to comment.