How to pop up form multiple times on opening the company

vyankuvyanku Member Posts: 791
I want to pop up a form at the time of opening company having infomation of birth day of client.
I want this information on FORM not on the message window.
So I create a form and call this form from Codeunit 1.
What I want if today there are two customer's birth day the form should be popup two times with one customers name at a time like message window.
How can do this?
Please suggst.

Comments

  • idiotidiot Member Posts: 651
    Why not have a list or tabular type form?
    That way you only need to pop up once...
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • vyankuvyanku Member Posts: 791
    I added a table box on the form and then added a text box in that form . But it shows nothing. If I add only text box on the form then only it shows me the name of one client.
    What I write.........OnOpenForm()

    Name	DataType	Subtype	Length
    cust	Record	Customer	
    custname	Text		50
    wdate	Date		
    dayw	Integer //for todays day		
    dayb	Integer//for custmomers birth day		
    monthw	Integer//for todays month		
    monthb	Integer//for customers birth month		
    custdate	Date		
    		
    
    wdate := WORKDATE;
    monthw:=DATE2DMY(wdate,2) ;
    dayw:=DATE2DMY(wdate,1) ;
    
    
    IF cust.FIND('-') THEN
    REPEAT
    IF cust."Date of Birth" <> 0D THEN BEGIN
    custdate :=cust."Date of Birth";
    dayb:=DATE2DMY(custdate,1) ;
    monthb:=DATE2DMY(custdate,2) ;
    END;
    IF (monthw = monthb ) AND(dayw = dayb) THEN
    BEGIN
    
    custname := cust.name;
    END;
    UNTIL cust.NEXT=0;
    

    Please suggest any solution.. ](*,)
  • diptish.naskardiptish.naskar Member Posts: 360
    I have tested this...hope this works for you
    wdate := WORKDATE; 
    monthw:=DATE2DMY(wdate,2) ; 
    dayw:=DATE2DMY(wdate,1) ; 
    Count:=1;
    Cust.RESET;
    IF Cust.FINDFIRST THEN BEGIN
    REPEAT 
       IF Cust."Birth Day" <> 0D THEN BEGIN
          custdate :=Cust."Birth Day";
          dayb:=DATE2DMY(custdate,1) ;
          monthb:=DATE2DMY(custdate,2);
          IF (monthw = monthb ) AND(dayw = dayb) THEN BEGIN
             CustName[Count]:=Cust.Name;
             Count:=Count+1;
          END;
       END;
       
    UNTIL Cust.NEXT=0;
    END;
    NextCount:=1;
    REPEAT
      CLEAR (RunTestForm);
      RunTestForm.GetName(CustName,NextCount);
      NextCount:=NextCount+1;
      RunTestForm.RUNMODAL;
    UNTIL NextCount=Count;
    

    Some new variables
    Count - Integer
    nextCount - Integer
    RunTestForm - The Form that you want to run

    Code/Properties of the RunTestForm

    OBJECT Form test cust
    {
    OBJECT-PROPERTIES
    {
    Date=11/08/07;
    Time=[ 6:06:30 PM];
    Modified=Yes;
    Version List=;
    }
    PROPERTIES
    {
    Width=8000;
    Height=8000;
    }
    CONTROLS
    {
    { 10012000;TextBox ;2640 ;2970 ;1700 ;440 ;SourceExpr=GVName }
    { 10012001;CommandButton;6490;6600;990;440 ;OnPush=BEGIN
    CurrForm.CLOSE;
    END;
    }
    }
    CODE
    {
    VAR
    GVName@10012000 : ARRAY [100] OF Text[50];
    i@10012001 : Integer;

    PROCEDURE GetName@10012000(VAR LVName@10012000 : ARRAY [100] OF Text[50];VAR counter@10012001 : Integer);
    BEGIN
    i:=counter;
    GVName[counter]:=LVName[counter];
    END;

    BEGIN
    END.
    }
    }

    Check this out... \:D/
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
  • vyankuvyanku Member Posts: 791
    Sorry its not working ...
    Name DataType Subtype Length
    cust Record Customer
    custname Text 50
    wdate Date
    dayw Integer //for todays day
    dayb Integer//for custmomers birth day
    monthw Integer//for todays month
    monthb Integer//for customers birth month
    custdate Date


    wdate := WORKDATE;
    monthw:=DATE2DMY(wdate,2) ;
    dayw:=DATE2DMY(wdate,1) ;


    IF cust.FIND('-') THEN
    REPEAT
    IF cust."Date of Birth" <> 0D THEN BEGIN
    custdate :=cust."Date of Birth";
    dayb:=DATE2DMY(custdate,1) ;
    monthb:=DATE2DMY(custdate,2) ;
    END;
    IF (monthw = monthb ) AND(dayw = dayb) THEN
    BEGIN

    custname := cust.name;
    END;
    UNTIL cust.NEXT=0;
    If we create this form on customer table .
    can we apply filter on the date of birth field by month and day.(monthw,dayw)? How?
  • jlandeenjlandeen Member Posts: 524
    Are you sure this is a really good idea? I've worked on clients that have popups & windows when users log in and I tend to only think it's a good idea if really really required.

    Normally (i.e. in my experience) it's something thats only specific to a small set of users and if you pop it up for everyone that may annoy users and degrade their user experience. Or it's really more a setup thing that needs to be done once.

    If it's a birthday thing is this something that only the HR users in the system would need? Could it maybe be handled differently (i.e. outside Navision through Reporting services or auto publishing of a report thats emailed to key employees?)
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
Sign In or Register to comment.