Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Record filtration in OnOpenPage trigger

$
0
0
I want to show projects which have some specific permissions to the user which opening Projects list page.

I have written below code to calculate the permissions and store records in tempJob table.

what is the best way to apply those jobs from temporory variable to rec variable?


JobTMP.DELETEALL;
Job.RESET;
Job.SETFILTER(Blocked,'%1|%2',Job.Blocked::" ",Job.Blocked::Posting);
IF Job.FINDSET THEN
REPEAT
IF (Job."Person Responsible" = UserSetupRec."Resource Code") OR (Job."Project Manager" = UserSetupRec."Resource Code") THEN BEGIN
JobTMP := Job;
IF JobTMP.INSERT THEN
JobTMP.MODIFY;
END ELSE BEGIN

IF LimitProjectsandTasksLookup(UserSetupRec."Resource Code",Job."No.",'') THEN BEGIN
JobTMP := Job;
IF JobTMP.INSERT THEN
JobTMP.MODIFY;
END;

END;

UNTIL Job.NEXT = 0;

Viewing all articles
Browse latest Browse all 10032

Trending Articles