Hi Team,
I am trying to make employee contribution and employer contribution non- editable base on my selection from the dropdown table called Receipt.
The selection includes as follow: EE&ER CONT, MGT/ER-CON, PENS-ENHAN, STAFF/EMP and UPFRONT. When I select EE&ER CONT and UPFRONT, employee and employer contribution editable should be true. If I select MGT/ER-CON and PENS-ENHAN only employer contribution should be editable why if I select STAFF/EMP only employee contribution should be editable. And I tried the option datatype for this approach, it did'nt work because it was calling another table, Receipt.
Thanks.
0
Answers
Have a look at how this is done in standard NAV on the Item Card, Planning fasttab.
Please check this out.
Verify it if found helpful.
Regards,
Bharath K
I have already created the boolean and I also set IncludeInDataset property to YES. I wrote these in the OnAfterValidate of the field with the lookup to the Recipt table
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND (TypeofReceipt."No." = 'STAFF/EMP') THEN BEGIN
EmployeeContEnable := TRUE;
EmployerContEnable := FALSE;
END ELSE
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND (TypeofReceipt."No." = 'MGT/ER-CON') THEN BEGIN
EmployeeContEnable := FALSE;
EmployerContEnable := TRUE;
END;
It's not working and what else can i do. Thanks
I tried your approach but it was not working because the dropdown is not an option datatype but table relation.
Thanks
You would also want to call that code on the OnAfterGetCurrentRecord trigger
OnAfterGetCurrRecord()
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND (TypeofReceipt."No." = 'STAFF/EMP') THEN BEGIN
EmployeeContEnable := TRUE;
EmployerContEnable := FALSE;
END ELSE
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND (TypeofReceipt."No." = 'MGT/ER-CON') THEN BEGIN
EmployeeContEnable := FALSE;
EmployerContEnable := TRUE;
END;
It is not working, am using NAV2018
It is working now, I have to choose the Staff/emp and close the page after reopen the page before it reflected.
"Receipt type code" is the field where the dropdown values save into.
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND ("Receipt type code"= 'STAFF/EMP') THEN BEGIN
EmployeeContEnable := TRUE;
EmployerContEnable := FALSE;
END ELSE
IF ("Type of Receipt" = "Type of Receipt"::Contribution) AND ("Receipt type code"= 'MGT/ER-CON') THEN BEGIN
EmployeeContEnable := FALSE;
EmployerContEnable := TRUE;
END;
Thanks
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!