Menu

Action Form Notes

Action Form is a module developed by DNNSharp.com for the DNN Content Management System and Development Platform. The developers at LetItShine.biz have used the Action Form module for countless projects and solutions for a number of years. The following is an modest collection of notes that we have started to record about techniques to take advantage of the strengths of this module. We record this here not to become a secondary help system for Action Form users or DNNSharp. But if you can find something here that helps you, that makes us happy too.

Return to the list

Push a Grid Selection to a Form

Mark Buelsing 0 112 Article rating: No rating

You can pop up a grid that will display records to choose from and then take the values from the chosen row and put them into the fiels on the form. This is a multiple column drop-down list box.

(Something that I have asked for in the past)

Use the following JS to move the field data from the grid to the form

/* Insert the module id of your FORM in the line below */

var module = '#dnn458root';

 

/* Use your form field names on the left side, and values from your grid row on the right */

angular.element($(module)).scope().form.fields.FirstName.value = '[FirstName]';

angular.element($(module)).scope().form.fields.LastName.value = '[LastName]';

angular.element($(module)).scope().form.fields.Email.value = '[Email]';

/* Trigger the form to update by applying the field changes */

angular.element($(module)).scope().$apply();

See a nice video that demonstrates building the popup components here: https://www.youtube.com/watch?v=hw_zY1Vdp14&list=PL67RlTAxc73HwiL13W1nvYZ_Wgb2jhWwd&index=4

 

HasRole SP

Mark Buelsing 0 0 Article rating: No rating

This stored procedure will return true or false after testing that a userid is in a given role

 

USE [DatabaseName]
GO
/****** Object:  StoredProcedure [dbo].[_LIS_ListArticlesCB]    Script Date: 8/12/2020 8:37:29 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE procedure [dbo].[_LIS_HasRole]

    @UserID int 
    ,@RoleName nvarchar(150) 

AS


    --DECLARE @UserID int = 1
    --DECLARE @RoleName nvarchar(150) = 'Administrators'


    SELECT CAST(CASE WHEN COUNT(*) > 0 THEN 'True' ELSE 'False' END AS nvarchar(10)) AS HasRole
    FROM UserRoles INNER JOIN
    Roles ON UserRoles.RoleID = Roles.RoleID INNER JOIN
    Users ON UserRoles.UserID = Users.UserID
    WHERE Roles.Rolename IN (@RoleName, 'Administrators') AND Users.UserID = @UserID
 

Remove the ActionGrid URL Parameters

Mark Buelsing 0 0 Article rating: No rating

ActionGrid adds parameters to the URL for Page settings even when paging is turned off and not needed. I like those parameters to not be in the URL. This script can be used to clean up the URL. Be careful though, this removes all URL parameters, so if there are parameters needed for something else on the page, don't use this.

 

setTimeout(function (){ history.pushState(null, null, 'dashboard');}, 5000);

You can put the script in the ActionGrid module settings, Advanced UI Settings, On Init Javascript

More than Just Text

Mark Buelsing 0 404 Article rating: No rating

When you make an announcement on your Home page, add something more than just the text. Optimally add an image or clipart to emphasize or just beautify the text. In the least, provide a title and format it differently than the announcement text below it. 

Remember if you format your announcement title, make sure you use consistent formatting to the other content on the page. Consistent formatting = Professionalism.

Extend the Worship Experience into the Home

Mark Buelsing 0 470 Article rating: No rating

Now that churches are not permitted to worship together in the church building, we are all figuring out how to extend the worship experience into the online environment. Here are some ideas and examples to get you going. This is one that LstItShine.biz can offer both advice and direct assistance. Read more.

RSS
12345