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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Erro while posting data in Job Table via API

(0) ShareShare
ReportReport
Posted on by 269
Hi All,
I'm getting a problem in this while posting this. 
page 71983589 CFS_ProjectsAPI
{
    APIGroup = 'integration';
    APIPublisher = 'cs';
    APIVersion = 'v1.0';
    ApplicationArea = All;
    Caption = 'cfs';
    DelayedInsert = true;
    EntityName = 'projects';
    EntitySetName = 'projects';
    PageType = API;
    SourceTable = Job;
 
    layout
    {
        area(Content)
        {
            repeater(General)
            {
                field(no; Rec."No.")
                {
                    Caption = 'No.';
                }
                field(description; Rec.Description)
                {
                    Caption = 'Description';
                }
                field(billToCustomerNo; Rec."Bill-to Customer No.")
                {
                    Caption = 'Customer No.';
                }
                field(customerName; Rec."Sell-to Customer Name")
                {
                    Caption = 'Customer Name';
                }
                field(startingDate; Rec."Starting Date")
                {
                    Caption = 'Starting Date';
                }
                field(endingDate; Rec."Ending Date")
                {
                    Caption = 'Ending Date';
                }
                field(status; Rec.Status)
                {
                    Caption = 'Status';
                }
                field(lastDateModified; Rec."Last Date Modified")
                {
                    Caption = 'Last Date Modified';
                }
                field(projectManager; Rec."Project Manager")
                {
                    Caption = 'Project Manager';
                }
                field(currencyCode; Rec."Currency Code")
                {
                    Caption = 'Currency Code';
                    TableRelation = Currency.Code;
                    trigger OnValidate()
                    var
                        CurrencyRec: Record Currency;
                    begin
                        if not CurrencyRec.Get(Rec."Currency Code") then begin
                            CurrencyRec.Init();
                            CurrencyRec.Code := Rec."Currency Code";
                            CurrencyRec.Description := 'New Currency';
                            CurrencyRec.Insert();
                        end;
                    end;
                }
            }
        }
    }
 
}
 
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,821 Super User 2026 Season 1 on at
    Hi,
     
    I think the No. must not be empty, since it's the table primary key.
    try to set value in No. field.
     
    Best regards,
    Mohamed Amine MAHMOUDI

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 520 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 384 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 363 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans