How to Filter a field based on another field value in business central al

How to filter Gen. Bus. posting Group based on the value of Gen. Prod. posting Group which is setup in the General posting Setup?

GenPostingSetup.SETRANGE(GenProdPostingGroup,OtherRecord.GenProdPostingGroup)
IF GenPostingSetup.FINDSET THEN