Onlookup trigger issue

gemini_shootergemini_shooter Member Posts: 149
Hello All,

I created a table and form for multiple customers that can be attached to a job. The link is available from the job card and you can enter multiple customers for a job. However the form has a default lookup mode of false when started from job card, which is what I want

However, I also have the same link on job task line but this time I want the form to start in lookupmode of TRUE, but had some issues with validation and get an error on the validation line on the form trigger? How would do the same code for a page, do I just replace the form variable with a page variable ?
Job Promotion Customer - OnLookup(VAR Text : Text[1024];) : Boolean
//Testing
CLEAR(lrecJobPromoCust);
CLEAR(gjffrmJobPromoCust);
lrecJobPromoCust.SETFILTER(lrecJobPromoCust."Job No.", "Job No.");
gjffrmJobPromoCust.SETTABLEVIEW(lrecJobPromoCust);
//gjffrmJobPromoCust.EDITABLE(FALSE);
gjffrmJobPromoCust.LOOKUPMODE(TRUE);
IF gjffrmJobPromoCust.RUNMODAL = ACTION::LookupOK THEN BEGIN
gjffrmJobPromoCust.GETRECORD(lrecJobPromoCust);
VALIDATE("Job Promotion Customer", lrecJobPromoCust."Customer No.");
MODIFY;
END;

Field validation on table
CLEAR(lrecJob);
IF lrecJob.GET("Job No.") THEN
IF NOT lrecJob.Promotion THEN
ERROR(ltxt002);

IF (("Job Task Type" <> "Job Task Type"::Posting) OR
("Rebate Type" <> "Rebate Type"::" ")) THEN
ERROR(ltxt001);

IF "Job Promotion Customer" = '' THEN
"Promotion Expense Ship-to Code" := '';

Comments

Sign In or Register to comment.