web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Creating Item Journal from Custom Requisition

(0) ShareShare
ReportReport
Posted on by

Dear All,

This code below is for creating an Item Journal from a customized requisition. But cannot work.

It refuses to recognize the Journal template and the batch and if I comment both Journal template and the batch, it refuses to recognise the posting date and lock the document. 

what could be the issue.

procedure CreateItemJournal()
var
ItmJnl: Record "Item Journal Line";
PRQHeader: Record "Purchase Requisition Header";
PRLine: Record "Purchase Requisition Lines";
NextLineNo :Integer;
//counter:Integer;
//counter := counter + 10000;

begin
if PRQHeader.Find then

ItmJnl.INIT();

ItmJnl.VALIDATE("Journal Template Name",'GENERAL');
ItmJnl.VALIDATE("Journal Batch Name",'Default');

IF ItmJnl.FINDLAST THEN
NextLineNo := ItmJnl."Line No." + 10000
ELSE
NextLineNo := 10000;

//NextLineNo := NextLineNo + 10000;
//ItmJnl.validate("Line No.",NextLineNo);

ItmJnl.VALIDATE("Posting Date",PRQHeader."PRQ Date");
ItmJnl.VALIDATE("Entry Type",ItmJnl."Entry Type"::"Negative Adjmt.");
ItmJnl.VALIDATE("Document No.",'Issue'+PRLine."PRQ No.");
ItmJnl.VALIDATE("Item No.",PRLine."No.");
ItmJnl.VALIDATE(Description,PRLine.Description);
ItmJnl.VALIDATE("Variant Code",'');
ItmJnl.VALIDATE("Location Code",'HQ');
ItmJnl.VALIDATE(Quantity,PRLine.Quantity);
ItmJnl.VALIDATE("Quantity (Base)",PRLine.Quantity);
ItmJnl.VALIDATE("Unit of Measure Code",PRLine."Unit of Measure Code");
ItmJnl.VALIDATE("Unit Amount",PRLine."Unit Cost");
ItmJnl.VALIDATE(Amount,PRLine.Quantity*PRLine."Unit Cost");
ItmJnl.VALIDATE("Unit Cost",PRLine."Unit Cost");
ItmJnl.VALIDATE("Applies-to Entry",0);
ItmJnl.Insert();
end;
}

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    The template name for Item Journal is ITEM not GENERAL,  change this ItmJnl.VALIDATE("Journal Template Name",'GENERAL'); to ItmJnl.VALIDATE("Journal Template Name",'ITEM');

  • Romryan Profile Picture
    on at

    Suresh,

    Thank you for your response.

    Your suggestion worked, but on item field, its shows a message that's empty while there is data from my requisition lines item field i.e. I can pick the data from requisition lines but I can pick from requisition header.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,091 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,032 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 946 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans