Open the Page that you created, for my demo i used page 46 and write the below code in
No. - OnLookup(VAR Text : Text[1024] : Boolean Trigger
No. - OnLookup(VAR Text : Text) : Boolean
//>>BKS - 102017
IF Type = Type::Item THEN BEGIN
ItemL.SETFILTER(“Inventory Posting Group”,‘FINISHED’);
IF PAGE.RUNMODAL(0,ItemL) = ACTION::LookupOK THEN
“No.” := ItemL.“No.”;
END;
IF Type = Type::“G/L Account” THEN BEGIN
IF PAGE.RUNMODAL(0,GLAccountL) = ACTION::LookupOK THEN
“No.” := GLAccountL.“No.”;
END;
IF Type = Type::" " THEN BEGIN
IF PAGE.RUNMODAL(0,StandardTextL) = ACTION::LookupOK THEN
“No.” := StandardTextL.Code;
END;
IF Type = Type::Resource THEN BEGIN
IF PAGE.RUNMODAL(0,ResourceL) = ACTION::LookupOK THEN
“No.” := ResourceL.“No.”;
END;
IF Type = Type::“Fixed Asset” THEN BEGIN
IF PAGE.RUNMODAL(0,FixedAssetL) = ACTION::LookupOK THEN
“No.” := FixedAssetL.“No.”;
END;
IF Type = Type::“Charge (Item)” THEN BEGIN
IF PAGE.RUNMODAL(0,ItemChargeL) = ACTION::LookupOK THEN
“No.” := ItemChargeL.“No.”;
END;
//<<BKS - 102017
Note:
Here ItemL is a local variable of Item Table.
GLAccountL is a local variable of G/L Account Table.
StandardTextL is a local variable of Standard Text Table.
ResourceL is a local variable of Resource Table.
Similarly you have to create a variable for Item Charge and Fixed Asset, and write below code for lookup as per your requirement.
Hello,
I think you had some customization, if it so then you have to VALIDATE “No.” so SalesLine.“No.” Field can be validated, and it will be populated, If you see Table 37 Field “No.” OnValidate then you can understand.
if you don’t want to validate “No.” Field then you have to add little bit more, something like: