Skip to main content

Notifications

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 84
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;
                }
            }
        }
    }
 
}
 
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    23,789 Super User 2025 Season 1 on at
    Erro while posting data in Job Table via API
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans