I tried this using page API and it works well but the response is empty for unspecified fields
for example :
This is the code
{
PageType = API;
Caption = 'Analytical Accounts';
APIPublisher = 'XEETEK';
APIGroup = 'Payroll';
APIVersion = 'v2.0';
EntityName = 'AnalyticalAccount';
EntitySetName = 'AnalyticalAccounts';
SourceTable = /XEE Group-Analytical Account/;
DelayedInsert = true;
ODataKeyFields = /Primary Key/;
// DataAccessIntent = ReadWrite;
// Editable = false;
ModifyAllowed = true;
InsertAllowed = true;
{
area(Content)
{
repeater(GroupName)
{
field(/Primary_Key/; rec./Primary Key/)
{
Caption = 'ID';
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Primary Key/));
end;
field(/Group_Account/; rec./Group Account/)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Group Account/));
end;
}
field(/Group_Account_Name/; rec./Group Account Name/)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Group Account Name/));
end;
}
field(/Analytical_Account_No_/; rec./Analytical Account No./)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Analytical Account No./));
end;
}
field(/Analytical_Account_Name/; rec./Analytical Account Name/)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Analytical Account Name/));
end;
}
field(/Group_Blocked/; rec./Group Blocked/)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Group Blocked/));
end;
}
field(Blocked; rec.Blocked)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(Blocked));
end;
}
field(/Analytical_Blocked/; rec./Analytical Blocked/)
{
ApplicationArea = all;
trigger OnValidate()
var
RegisterFieldSet(rec.FieldNo(/Analytical Blocked/));
end;
}
}
}
trigger OnInsertRecord(Xrec: Boolean): Boolean
var
GropAna: Record /XEE Group-Analytical Account/;
begin
GropAna.SetRange(/Primary Key/, rec./Primary Key/);
if GropAna.FindFirst() then begin
if TempFieldSet.Get(Database::/XEE Group-Analytical Account/, Rec.FieldNo(Blocked)) then
GropAna.Blocked := rec.Blocked;
if TempFieldSet.Get(Database::/XEE Group-Analytical Account/, Rec.FieldNo(/Group Blocked/)) then
GropAna./Group Blocked/ := rec./Group Blocked/;
if TempFieldSet.Get(Database::/XEE Group-Analytical Account/, Rec.FieldNo(/Analytical Blocked/)) then
GropAna./Analytical Blocked/ := rec./Analytical Blocked/;
GropAna./Analytical Account No./ := GropAna./Analytical Account No./;
GropAna./Analytical Account Name/ := GropAna./Analytical Account Name/;
GropAna./Group Account/ := GropAna./Group Account/;
GropAna./Group Account Name/ := GropAna./Group Account Name/;
GropAna.Modify();
end
else begin
if (rec./Analytical Account No./ = '') and (rec./Group Account/ = '') then
Error('There should be at least one account');
rec.Insert(true);
end;
exit(false);
end;
TempFieldSet: Record 2000000041 temporary;
local procedure RegisterFieldSet(FieldNo: Integer)
begin
if TempFieldSet.Get(Database::/XEE Group-Analytical Account/, FieldNo) then
exit;
TempFieldSet.TableNo := Database::/XEE Group-Analytical Account/;
TempFieldSet.Validate(/No./, FieldNo);
TempFieldSet.Insert(true);
end;
}
Note: I dont want to send patch request, I want update and insert using POST request