Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Adding Reference field to Time Sheet Lines

Posted on by 225
Hello!
 
I am using the Time Sheets in Business Central to post time entries from work, and send an invoice to the customer. 
I would like to add a Reference field, where we insert the name of the person that requested the job, so that the company getting the invoice knows who requested it.
 
To begin with, I added a field in the Time Sheet Line table called Reference. Then I added the same field to the Time Sheets Line Subform page to display it and insert data.
Next, I realized that to display it in the Invoice report, I need to add it to the Sales Invoice Line table as well. 
 
How do I make sure the Reference from the Time Sheet Line is transferred to the Sales Invoice Line when I post the Time Sheet?
Categories:
  • Hagru Profile Picture
    Hagru 225 on at
    Adding Reference field to Time Sheet Lines
    I think I do, because the way it seems to work now, there is no linkage between Time Sheet Line and the Sales Lines.
     
    The Time Entries are all connected to projects, and that is where I lose track of the Reference field.
     
    The process is as follows:
    - Time Sheet Lines are inserted and submitted with the Reference field by a Resource, on a Project.
    - The Time Sheet is then sent to Approval. The Reference field is still following the Time Sheet Line.
    - Next I go to Project Journals, click Prepare > Suggest Lines from Time Sheets. Then I can see every Time Sheet Line. The Reference field in the Job Journal Lines is a FlowField with a lookup to the Reference field in the Time Sheet Line table. The Reference is still correct here.
    - Then I set line type to Billable for the ones that are Billable, and Budget to the other ones, and enter a Document No. Then I press Home > Post
     
    The Time Sheet Line is now posted to the Project as Jobs. If I go to the project, and click on the Billable number in the Job Task Lines Subform, I can see the Time Sheet Lines. This is where I lose the Reference. Now they are Job Planning Lines, and I have no way of finding the Reference again, because I have no idea how to link it to anything anymore. 
     
    I then create Invoices based on these Job Planning Lines.
     
    I suppose I can get the reference directly from the following Sales Line, but it doesn't seem like I have anything to link it to other than the Description, but there can be multiple lines with the same description on the same project, but with different reference person across a few weeks, which makes me not want to use the Description field to link the two.
     
    The closest I can probably get is to make a FlowField where I find the Reference field through the Job No., Description and Resource No. But even then I am worried it will get a Reference from other Time Sheets, as they are available in the system still.
     
  • Suggested answer
    Amit Profile Picture
    Amit on at
    Adding Reference field to Time Sheet Lines
    Hi,
     
    For adding Reference field in the report, find the linking between Time Sheet line and Sales Line. you do not need to create and flow the reference field as per my understanding.
     
    Regards
    Amit Sharma  
  • Hagru Profile Picture
    Hagru 225 on at
    Adding Reference field to Time Sheet Lines
    I can't seem to find the right way to do this..
    I gave up on the codeunits, and I thought I could just add a flowfield to the Job Journal Line table instead, so I have the reference correctly set up there.
     
    The next step for me is to Post the Job Journal Lines. When they are posted, they are created as Job Planning Lines on the correct project, and they have all the info, except for my reference field. I believe I need an event here to actually get the data into my field, as I no longer have anything to do a lookup to.
     
    I can't seem to find anything that useful in the Time Sheet Management codeunit.
  • gdrenteria Profile Picture
    gdrenteria 12,183 Most Valuable Professional on at
    Adding Reference field to Time Sheet Lines
    Hi I would think this is it
    codeunit 950 "Time Sheet Management"
    Best
    GR
  • Hagru Profile Picture
    Hagru 225 on at
    Adding Reference field to Time Sheet Lines
    Do you know which codeunit is responsible for posting Time Sheets?
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 4,598 on at
    Adding Reference field to Time Sheet Lines
    Add a new field to the Sales Invoice Line table to hold the Reference data from the Time Sheet Line.
    Customize the codeunit responsible for posting Time Sheets to ensure that it copies the Reference data to the Sales Invoice Line.
    Edit the Sales Invoice report to include the new Reference field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans