Modify sorting code

AgnethefAgnethef Member Posts: 18
Hi,
This report (see below) is used when we need a list of contact persons who are not in a specific marketing group.
How do I modify this code to make it select those contact person who are in specific marketing group.
I must be very simple. However, I am new to this and is still learning.
Thank you very much for any help.


Documentation()

Contact - OnPreDataItem()

Contact - OnAfterGetRecord()
IF CheckForGruppe(Contact, Gruppe) THEN
CurrReport.SKIP;
KontCtr := 0;

Contact - OnPostDataItem()

CheckForGruppe(Emne : Record Contact;Gruppe : Code[10]) Ans : Boolean
IF NOT Contact."Exclude from Segment" THEN
BEGIN
Kontakt.SETFILTER(Kontakt."Company No.",Contact."No.");
Antal := Kontakt.COUNT;
IF Antal = 0 THEN
Ans := FALSE
ELSE
BEGIN
MkGrupOK := FALSE;
IF Kontakt.FIND('-') THEN
REPEAT
IF Markedsgruppetilknytning.GET(Kontakt."No.", Gruppe) THEN
BEGIN
Ans := TRUE;
MkGrupOK := TRUE;
EXIT;
END
ELSE
Ans := FALSE;
UNTIL Kontakt.NEXT = 0;
Ans := FALSE
END;
END
ELSE
Ans := FALSE;

KontaktiGruppe(Kontaktpers : Record Contact;Gruppe : Code[10]) Ans : Boolean
IF NOT Kontakt."Exclude from Segment" THEN
BEGIN
IF Markedsgruppetilknytning.GET(Kontaktpers."No.", Gruppe) THEN
Ans := TRUE
ELSE
Ans := FALSE;
END
ELSE
Ans := FALSE;

Comments

  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    I think like this

    IF NOT CheckForGruppe(Contact, Gruppe) THEN
    CurrReport.SKIP;
  • AgnethefAgnethef Member Posts: 18
    Dear Yaroslav,

    Thank you for the reply. Unfortunately it did not work.

    Kind regards,
    Agnethef
  • AgnethefAgnethef Member Posts: 18
    The problem has been solved.
    Thanks.
    Agnethef
Sign In or Register to comment.