From 1c017c8be5d599fe4e68380232bd21a66a0b0ee2 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 17 Oct 2024 12:20:24 +0200 Subject: [PATCH 1/4] Update outdated documentation on working with Forms record data. --- .../developer/working-with-data.md | 8 ++--- .../developer/working-with-data.md | 26 ++++++++-------- .../developer/working-with-data.md | 30 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/10/umbraco-forms/developer/working-with-data.md b/10/umbraco-forms/developer/working-with-data.md index 2a8f1e5a7da..3ebc68c64fd 100644 --- a/10/umbraco-forms/developer/working-with-data.md +++ b/10/umbraco-forms/developer/working-with-data.md @@ -22,7 +22,7 @@ Returns all records with the state set to approved from all Forms on the Umbraco ### GetApprovedRecordsFromFormOnPage ```csharp -PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. @@ -30,7 +30,7 @@ Returns all records with the state set to approved from the Form with the id = ` ### GetApprovedRecordsFromForm ```csharp -PagedResult GetApprovedRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. @@ -46,7 +46,7 @@ Returns all records from all Forms on the Umbraco page with the id = `pageId` as ### GetRecordsFromFormOnPage ```csharp -PagedResult GetRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. @@ -54,7 +54,7 @@ Returns all records from the Form with the id = `formId` on the Umbraco page wit ### GetRecordsFromForm ```csharp -PagedResult GetRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` Returns all records from the Form with the ID = formId as a `PagedResult`. diff --git a/13/umbraco-forms/developer/working-with-data.md b/13/umbraco-forms/developer/working-with-data.md index 3dbcd3c156d..efc171cb19e 100644 --- a/13/umbraco-forms/developer/working-with-data.md +++ b/13/umbraco-forms/developer/working-with-data.md @@ -13,7 +13,7 @@ The methods can be found by injecting the `Umbraco.Forms.Core.Services.IRecordRe ### GetApprovedRecordsFromPage ```csharp -PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` Returns all records with the state set to approved from all Forms on the Umbraco page with the id = `pageId` . @@ -21,48 +21,48 @@ Returns all records with the state set to approved from all Forms on the Umbraco ### GetApprovedRecordsFromFormOnPage ```csharp -PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetApprovedRecordsFromForm ```csharp -PagedResult GetApprovedRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. ### GetRecordsFromPage ```csharp -PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` -Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromFormOnPage ```csharp -PagedResult GetRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromForm ```csharp -PagedResult GetRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the ID = formId as a `PagedResult`. +Returns all records from the Form with the ID = formId as a `PagedResult`. ## The returned objects -All of these methods will return an object of type `PagedResult` so you can iterate through the `IRecord` objects. +All of these methods will return an object of type `PagedResult` so you can iterate through the `Record` objects. -The properties available on a `IRecord` are: +The properties available on a `Record` are: ```csharp int Id diff --git a/14/umbraco-forms/developer/working-with-data.md b/14/umbraco-forms/developer/working-with-data.md index 822b76417b1..efc171cb19e 100644 --- a/14/umbraco-forms/developer/working-with-data.md +++ b/14/umbraco-forms/developer/working-with-data.md @@ -13,7 +13,7 @@ The methods can be found by injecting the `Umbraco.Forms.Core.Services.IRecordRe ### GetApprovedRecordsFromPage ```csharp -PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` Returns all records with the state set to approved from all Forms on the Umbraco page with the id = `pageId` . @@ -21,48 +21,48 @@ Returns all records with the state set to approved from all Forms on the Umbraco ### GetApprovedRecordsFromFormOnPage ```csharp -PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetApprovedRecordsFromForm ```csharp -PagedResult GetApprovedRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. ### GetRecordsFromPage ```csharp -PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` -Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromFormOnPage ```csharp -PagedResult GetRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromForm ```csharp -PagedResult GetRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the ID = formId as a `PagedResult`. +Returns all records from the Form with the ID = formId as a `PagedResult`. ## The returned objects -All of these methods will return an object of type `PagedResult` so you can iterate through the `IRecord` objects. +All of these methods will return an object of type `PagedResult` so you can iterate through the `Record` objects. -The properties available on a `IRecord` are: +The properties available on a `Record` are: ```csharp int Id @@ -77,7 +77,7 @@ Guid UniqueId Dictionary RecordFields ``` -In order to access custom Form fields, these are available in the `RecordFields` property. Furthermore there exists an extension method named `ValueAsString` on `Record` in `Umbraco.Forms.Core.Extensions`, such that you can get the value as string given the alias of the field. +In order to access custom Form fields, these are available in the `RecordFields` property. Furthermore there exists an extension method named `ValueAsString` on `Record` in `Umbraco.Forms.Core.Services`, such that you can get the value as string given the alias of the field. This extension method handle multi value fields by comma separating the values. E.g. "A, B, C" @@ -88,7 +88,7 @@ Sample script that is outputting comments using a Form created with the default ```csharp @using Umbraco.Core; @using Umbraco.Cms.Core.Composing; -@using Umbraco.Forms.Core.Extensions; +@using Umbraco.Forms.Core.Services; @inject IRecordReaderService _recordReaderService;
    From 0cfeca0daa3b4ca5180e209e7a98e430f391133c Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 17 Oct 2024 12:23:09 +0200 Subject: [PATCH 2/4] Reverted incorrect update. --- 14/umbraco-forms/developer/working-with-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/14/umbraco-forms/developer/working-with-data.md b/14/umbraco-forms/developer/working-with-data.md index efc171cb19e..eb4ef07555a 100644 --- a/14/umbraco-forms/developer/working-with-data.md +++ b/14/umbraco-forms/developer/working-with-data.md @@ -77,7 +77,7 @@ Guid UniqueId Dictionary RecordFields ``` -In order to access custom Form fields, these are available in the `RecordFields` property. Furthermore there exists an extension method named `ValueAsString` on `Record` in `Umbraco.Forms.Core.Services`, such that you can get the value as string given the alias of the field. +In order to access custom Form fields, these are available in the `RecordFields` property. Furthermore there exists an extension method named `ValueAsString` on `Record` in `Umbraco.Forms.Core.Extensions`, such that you can get the value as string given the alias of the field. This extension method handle multi value fields by comma separating the values. E.g. "A, B, C" @@ -88,7 +88,7 @@ Sample script that is outputting comments using a Form created with the default ```csharp @using Umbraco.Core; @using Umbraco.Cms.Core.Composing; -@using Umbraco.Forms.Core.Services; +@using Umbraco.Forms.Core.Extensions; @inject IRecordReaderService _recordReaderService;
      From c06fc226d91864afe716dd5d2693f5119ddc8ad0 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Fri, 18 Oct 2024 10:00:06 +0200 Subject: [PATCH 3/4] Updated 15 version of page --- .../developer/working-with-data.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/15/umbraco-forms/developer/working-with-data.md b/15/umbraco-forms/developer/working-with-data.md index 822b76417b1..eb4ef07555a 100644 --- a/15/umbraco-forms/developer/working-with-data.md +++ b/15/umbraco-forms/developer/working-with-data.md @@ -13,7 +13,7 @@ The methods can be found by injecting the `Umbraco.Forms.Core.Services.IRecordRe ### GetApprovedRecordsFromPage ```csharp -PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` Returns all records with the state set to approved from all Forms on the Umbraco page with the id = `pageId` . @@ -21,48 +21,48 @@ Returns all records with the state set to approved from all Forms on the Umbraco ### GetApprovedRecordsFromFormOnPage ```csharp -PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetApprovedRecordsFromForm ```csharp -PagedResult GetApprovedRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetApprovedRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. +Returns all records with the state set to approved from the Form with the ID = `formId` as a `PagedResult`. ### GetRecordsFromPage ```csharp -PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) +PagedResult GetRecordsFromPage(int pageId, int pageNumber, int pageSize) ``` -Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from all Forms on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromFormOnPage ```csharp -PagedResult GetRecordsFromFormOnPage(int pageId, Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromFormOnPage(int pageId, Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. +Returns all records from the Form with the id = `formId` on the Umbraco page with the id = `pageId` as a `PagedResult`. ### GetRecordsFromForm ```csharp -PagedResult GetRecordsFromForm(Guid.Parse("formId"), int pageNumber, int pageSize) +PagedResult GetRecordsFromForm(Guid formId, int pageNumber, int pageSize) ``` -Returns all records from the Form with the ID = formId as a `PagedResult`. +Returns all records from the Form with the ID = formId as a `PagedResult`. ## The returned objects -All of these methods will return an object of type `PagedResult` so you can iterate through the `IRecord` objects. +All of these methods will return an object of type `PagedResult` so you can iterate through the `Record` objects. -The properties available on a `IRecord` are: +The properties available on a `Record` are: ```csharp int Id From 778f5985d7258a5e300f5b6ec5498d7a0b8ae6d2 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Fri, 18 Oct 2024 11:26:10 +0200 Subject: [PATCH 4/4] Minor change to trigger GitBook checks --- 10/umbraco-forms/developer/working-with-data.md | 1 - 1 file changed, 1 deletion(-) diff --git a/10/umbraco-forms/developer/working-with-data.md b/10/umbraco-forms/developer/working-with-data.md index 3ebc68c64fd..0647845168f 100644 --- a/10/umbraco-forms/developer/working-with-data.md +++ b/10/umbraco-forms/developer/working-with-data.md @@ -1,5 +1,4 @@ --- -meta.Title: Working with Umbraco Forms data description: Developer documentation on working with Forms record data. ---