Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

how we can add a comment to sales invoice created from job planning lines according to the MONTH of planning date [JAN,FEB] folks please help!!

Posted on by Microsoft Employee

Bemerkung=comment 

3124.45f05333_2D00_6fcb_2D00_4256_2D00_9ac1_2D00_2751ecef6040.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how we can add a comment to sales invoice created from job planning lines according to the billing type [quarter] folks please help!!

    here the requirment is different the above mentioned code only create a blank comment line.  I need the  comment line  based on the MONTH of planning date [jan,februvary] !!! thats the problemm any suggestions?

    • JAN
    • FEB
    • MARCH
  • Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: how we can add a comment to sales invoice created from job planning lines according to the billing type [quarter] folks please help!!

    Hi,

    Pls take reference form below code.

    [EventSubscriber(ObjectType::CodeunitCodeunit::"Job Create-Invoice", 'OnAfterCreateSalesLine''', false, false)]

        local procedure OnAfterCreateSalesLineAddCommentLine(Job: Record Job; SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var JobPlanningLine: Record "Job Planning Line")
        var
            SalesLineL: Record "Sales Line";
            LineNo: Integer;
        begin
            LineNo := 10000;
            SalesLineL.Reset();
            //SalesLine.SetRange(Description, SalesLine.Description);
            SalesLineL.SetRange("Document Type", SalesLine."Document Type");
            SalesLineL.SetRange("Document No.", SalesLine."Document No.");
            if SalesLineL.FindLast() then
                LineNo := SalesLineL."Line No." + 10000;
            SalesLineL.Init();
            SalesLineL."Document Type" := Enum::"Sales Document Type"::Invoice;
            SalesLineL."Document No." := SalesLine."Document No.";
            SalesLineL."Line No." := LineNo;
            SalesLineL.Insert(true);
            SalesLineL.Type := Enum::"Sales Line Type"::" ";
            SalesLineL.Description := JobPlanningLine."Invoice Description";
            SalesLineL.Modify(true);

        end;
    Regards
    Amit Sharma
  • Suggested answer
    Ben Baxter Profile Picture
    Ben Baxter 4,591 Super User 2024 Season 2 on at
    RE: how we can add a comment to sales invoice created from job planning lines according to the billing type [quarter] folks please help!!

    Do a look-up on the table data of your Job Planning Line (Ctrl + Alt + F1).  Make sure the Unit Price fields all validated with the correct amounts.  It could be the field you have displayed is not properly populating the required Unit Price fields that are transferred to the Sales Invoice.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how we can add a comment to sales invoice created from job planning lines according to the billing type [quarter] folks please help!!

    inside the job planning line line type = billable but still there is  no any value coming

    here inside JPL the line type= billable but still therer is no any  changes?

    Validation Results:
    Type must not be Text in Job Planning 

    how to resolve this?

  • Ben Baxter Profile Picture
    Ben Baxter 4,591 Super User 2024 Season 2 on at
    RE: how we can add a comment to sales invoice created from job planning lines according to the billing type [quarter] folks please help!!

    On your Job Planning Lines, set the Line Type to Billable and the Type to Text.  This will transfer as a comment line to a sales invoice the same as it does for the other types of Billable JPLs.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans