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

Notifications

Announcements

No record found.

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 244
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,447 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,132

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 675 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 665 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans