Hi Archer,
Thanks for the input, but I am not getting any further.
I looked at this Microsoft page.
It says: All calls fail if the user does not have the relevant permissions, and if the relevant property on the page, InsertAllowed, ModifyAllowed, or DeleteAllowed, is set to No.
When I use SOAP to Read/Insert/Update/Delete records, it all works fine. So ….Allowed must be set correctly (and I didn't make any changes to this)
It also says that Triggers are activated:
POST |
Creates a new entity. |
OnNewRecord and OnInsert |
PATCH |
Modifies the specified existing entity. |
OnModify |
DELETE |
Deletes the specified existing entity. |
OnDelete |
In all the samples I learned from the internet they remove these triggers, so this could be something.
I added triggers (unfortunately I have no idea what to put in them)
This is my table:
table 50109 "Workers"
{
DataClassification = ToBeClassified;
fields
{
field(1; "No."; Code[20])
{
DataClassification = ToBeClassified;
}
field(10; "First name"; Text[50])
{
DataClassification = ToBeClassified;
}
field(20; "Last Name"; Text[50])
{
DataClassification = ToBeClassified;
}
field(40; FunctionName; Text[50])
{
DataClassification = ToBeClassified;
}
}
trigger OnInsert()
var
myInt: Integer;
begin
end;
trigger OnModify()
var
myInt: Integer;
begin
end;
trigger OnDelete()
var
myInt: Integer;
begin
end;
}
When I try this with the empty triggers I still get the error: Method not allowed, which is (I think) a bit strange.
I would have expected to not give an error but at the same time also do nothing as the trigger is empty.
To be complete I will add the Card Page
page 50108 "Workers Card"
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = Workers;
layout
{
area(Content)
{
group(General)
{
field("No."; "No.")
{
ApplicationArea = Basic;
Importance = Promoted;
}
field("First name"; "First name")
{
ApplicationArea = Basic;
}
field("Last name"; "Last name")
{
ApplicationArea = Basic;
}
field(FunctionName; FunctionName)
{
ApplicationArea = Basic;
}
}
}
}
}
The List Page
page 50109 "Workers List"
{
PageType = List;
ApplicationArea = All;
UsageCategory = Lists;
SourceTable = Workers;
layout
{
area(Content)
{
repeater(Group)
{
field("No."; "No.")
{
ApplicationArea = Basic;
}
field("First name"; "First name")
{
ApplicationArea = Basic;
}
field("Last Name"; "Last Name")
{
ApplicationArea = Basic;
}
field(FunctionName; FunctionName)
{
ApplicationArea = Basic;
}
}
}
}
}
And the XML file for the web service:
<?xml version = "1.0" encoding = "utf-8" ?>
<ExportedData>
<TenantWebServiceCollection>
<TenanatWebService>
<ObjectType>Page</ObjectType>
<ObjectID>50108</ObjectID>
<ServiceName>WorkersWebService</ServiceName>
<Published>true</Published>
</TenanatWebService>
</TenantWebServiceCollection>
</ExportedData>
As mentioned when using SOAP it all works fine.
But as ODATA is faster I would also like to be able to use ODATA.
Kind regards,
Clemens Linders