Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Add line automatically in form

Posted on by 782
 Hi 
 
I try to create Record attendance and absence for the course .
 
first i create new form in Course participants form  It contains field 
 
course id , employee name , date , attendance status( Present , Absent ) .
 
first it will be check start date and end date for the course .
 
such as start date 1/1/2023 and end date 1/3/2023 
 
i need to create automatically line in my form  for each date 
 
1/1/2023 
1/2/2023
1/3/2023 
 
how i cane mack this 
  • Hawra Profile Picture
    Hawra 782 on at
    Add line automatically in form
    Hi 
     
    any idea
  • Hawra Profile Picture
    Hawra 782 on at
    Add line automatically in form
     
    i see the link but this is only count row not insert line by line, so i want to create similar proses in calendar form 
  • Mohit Rampal Profile Picture
    Mohit Rampal 12,540 Super User on at
    Add line automatically in form
    I have shared the article which explains how to use temporary table as form datasource. The logic to populate the records should be added in executeQuery method (as specified in article).
     
  • Hawra Profile Picture
    Hawra 782 on at
    Add line automatically in form
     hi GirishS 
     
    Do you know the calendar form i want to create similar proses but Depends on the start and end date of the course 
     
    I thought of using the agenda so that weekend days would not be counted .
     
     
     
    In the end, the goal of this screen is to record the attendance and absence of the participants and to calculate the attendance percentage of the course based on the total days of the course
     
     
  • Hawra Profile Picture
    Hawra 782 on at
    Add line automatically in form
     
    Thank you for your replay can you give me more details how to use tmp table after create 
  • GirishS Profile Picture
    GirishS 27,826 Super User on at
    Add line automatically in form
    I am little confused here. You are getting the start and end date from the details form of "Attendance" form.
    Now you are telling that based on the setup field you need to insert record in the Attendance form.
    I can't get this point. Why you want to insert the record in the Attendance form itself?
     
    Thanks,
    Girish S.
  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,540 Super User on at
    Add line automatically in form
    Hi Hawra, Since your requirement is to auto populate records on opening Attendance form, I suggest to create temporary table for Attendance and populate it on runtime in form. Reason is that Start or End date of course or Agenda can be changed and in that case, you need to insert records accordingly. With temporary table, data will be cleared when form is closed and will be populated when its opened.
     
    Check this article on how to use temporary table as form datasource.
     
  • Hawra Profile Picture
    Hawra 782 on at
    Add line automatically in form
     Hi GirishS 
     
    Thank you for your replay 
     
    1- create new form ( Attendance ) in Course participants form
     
    2- contains field 
     
    course id , employee name , date , attendance status( Present , Absent ) .
     
    3 - it should be check the setup in course form if != Agenda 
     
    check the stat date and end date and add line automatically in (Attended ) from for each date .
     
     
     
    4- else if the setup = Agenda 
     
    insert the date from Agenda from to attended from 
  • GirishS Profile Picture
    GirishS 27,826 Super User on at
    Add line automatically in form
    Hi Hawra,
     
    Your requirement is not clear. Can you elaborate with some screenshots.
    Also, if you want to create lines automatically you need to add the logic to loop through the start and end date and insert into the respective tables.
    For identifying where to write the code you need to explain your scenario or explain it with screenshots.
     
    Thanks,
    Girish S.
     
     
     

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans