I am getting this error "'Page' does not contain a definition for "APIV2 - Purchase Invoices" when i am trying to use the below method in my custom API, any clue why this is happening?
error line : ActionContext.SetObjectId(Page::"APIV2 - Purchase Invoices");
local procedure SetActionResponse(var ActionContext: WebServiceActionContext; InvoiceId: Guid)
var
begin
ActionContext.SetObjectType(ObjectType:: Page);
ActionContext.SetObjectId(Page::"APIV2 - Purchase Invoices");
ActionContext.AddEntityKey(FieldNo(Id), InvoiceId);
ActionContext.SetResultCode(WebServiceActionResultCode::Deleted);
end;