(function openLouie() { let louie = document.getElementById("Dropdown-Toggle-14"); louie.classList = "host-toggle w-dropdown-toggle w--open"; console.log(louie); })();
Preparation of custom actions with SQL Queries

We have 2 different data tables as Todo and its categories. Let's quickly create the screens using CRUD screens for the category.

Select CRUD from the Screens panel New Screens popup. Select the database and its table. Then make additional adjustments and have KuikaGo prepare the screens in 1-2 seconds. 

We prepared the list, add and display screens for the application. Now let's create Custom actions for these screens.

Switch to the Datasources view. 

Create new action under database. Update its name to Select_TodoItem. We have had a search field in the list. There is also a filter with datetime. Paste the script below into this section.

select * from TodoItem  WHERE  (Description LIKE ‘%’ + @searchFor +‘%’ OR Title LIKE ‘%’+@searchFor+‘%’   OR @searchFor is null OR @searchFor = '') and 

Format (DueDateTime, ‘yyyy,MM,dd’) = format(@Date,‘yyyy,MM,dd’) 

or DueDateTime = Null  or  DueDateTime = ’’

  ORDER BY Description OFFSET (@currentpage-1)*@pagesize ROWS FET

CH NEXT @pagesize ROWS ONLY

Save the custom action.

Now let's create a custom action for new records and record updates. Name it Save_TodoItem. Then in the editor area

 UPDATE TodoItem SET Category = @Category, Description = @Description, DueDateTime = @DueDateTime, Title = @Title WHERE Id = @Id

IF @@ROWCOUNT = 0

BEGIN

INSERT INTO TodoItem (Category, Description, DueDateTime, Id, Title) VALUES (@Category, @Description, @DueDateTime, @Id, @Title);

END

Paste the code. Here, with the relevant input screen, both the new data record and the calling and editing of the items belonging to the relevant data and updating operations can be performed.

Now, finally, let's create a custom action for the delete function.

Here we must add a query that will allow the selected ID to be deleted. 

DELETE FROM TodoItem WHERE Id = @Id

Add the code and save it as Delete_TodoItem.

Simplicity Meets High Performance

Free edition subscription
Keep your work
No credit card required to try