Untitled Document
 
 
Forums
Subject: Applicate Modules
Prev Next
You are not authorized to post a reply.

Author Messages
host
Posts:93

03/23/2007 2:00 PM  
One of the main features of DNNMB is the many-to-one or master/detail (parent/child) ability. We call it “applicate”

The “applicate” feature works like this.

Create Parent Module
1) Create the master module
For this example we created Employees
Make note of the Response Variable found on the Module Options page (You can change this as needed) For this example we use EmployeeID.

Create a Child Module
For this example we use PhoneNumbers
1) Create the Child module
Include in your table a field (Text Type) that will store the relationship between modules. We use fldEmployeeID in this examplt
In the Field Properties set the default value of fldEmployeeID to request.querystring(“EmployeeID”)

Build and Install both modules

In the Parent module (Employees) we need a way to select the record for which our phone numbers will apply. We Use the {SelectLink}EmployeeName{/SelectLink} to acheive this.


“Applicate” the Child module
1) Edit the Template Header of the PhoneNumbers module to include
{Filter:Static}
{StaticFilter:By}fldEmployeeID{/StaticFilter:By}
{StaticFilter:Op}={/StaticFilter:Op}
{StaticFilter:QueryStringVariable}EmployeeID{/StaticFilter:QueryStringVariable}
{/Filter:Static}

2) Edit the Template Footer of the PhoneNumbers module to include
{Application}EmployeeID{/Application}

When a user selects an Employee, only the phone numbers for that employee show up in the Phone Numbers module and when a phone number is added the relationship is created to the selected employee.

To see this in action view Step 5 of the Demo on the SoCanI site.

All of the modules on the page are detail modules of the master Employees module.
TMurphyPA
Posts:5

05/17/2007 4:19 PM  
The "Applicate" feature is incredibly powerful. Althoug, this message was extremely helpful I still need some additional guidance.

The URL that for the "Add" link of the Child module does not include the necessary QueryString that I need. As a result all new records are not properly linked to the selected record of the Parent module. Here is a sample of the URL that I get from the "Add" link:

http://www.biausa.net/Testing/tabid/55/ctl/AddBIAA_CallInfo/mid/379/Default.aspx

The URL for the "Edit" link does include the necessary Query String. Here is a sample of the URL that I get from the "Add" link:

http://www.biausa.net/Testing/tabid/55/ctl/AddBIAA_CallInfo/ItemID/5/CallerID/6/mid/379/SortBy/IndivFamily/Default.aspx

As you can see the "CallerID" (which is equivalent to the "EmpID" in your demo is passed by the Edit link and not the Add link.

Can you please provide some guidance as to how to get the Add link working?
host
Posts:93

05/17/2007 4:30 PM  
Try putting the {Application}CallerID{/Application} in the footer of the template as opposed to the header. We have had some strange instances where it will only work that way.

Try that and let me know if your add link then contains the parameter for callerid.
TMurphyPA
Posts:5

05/17/2007 5:10 PM  
Thanks for replying so fast. The Add Link works like a charm now.

DNN Module Builder is a wonderful concept. I've only been using it a short while but it eliminated an awful lot of tedious programming. I'm looking forward to how much time it will save me when I understand it even more.

Thanks again!
talal
Posts:31

06/07/2007 1:00 PM  
The QueryString is disabled in the Default Value screen.

TaLaL
host
Posts:93

06/07/2007 1:50 PM  
That's likely because you are attempting to set the default of a non-string (integer, date etc.) field to the querystring variable which is always treated as a string
talal
Posts:31

06/07/2007 2:14 PM  
but i can see the need for having the querystring for numeric value (maybe add validation?)

typically forgn keys are numeric.. not string.

TaLaL
host
Posts:93

06/07/2007 2:19 PM  
I'm sure that will come eventually, but it's not high on the priority list.
talal
Posts:31

07/07/2007 9:18 PM  
Hello Brian;
I am working on making a project with MB now. I have gotten to know much more about the source files and what gets created. Hopefully i will be providing help to other members and maybe a walkthrough using my experience with this.

I will work on that as soon as i am done.

For now i need your help.

I am stuck at the point of linking the 2 modules.
I followed the steps here.

I have the follwoing in the CHILD module Template Header:
{Filter:Static}
{StaticFilter:By}fldListID{/StaticFilter:By}
{StaticFilter:Op}={/StaticFilter:Op}
{StaticFilter:QueryStringVariable}TalalApplicationListID{/StaticFilter:QueryStringVariable}
{/Filter:Static}


The field name is ListID and it reads the query string TalalApplicationListID

The module list does not seem to filter anything.

I added a debug code to the module to check the value of the FILTER string and there was nothing.

Am i missing something?

TaLaL
SoCanI
Posts:47

07/08/2007 4:45 PM  
Looks like a bug was introduced in 4.5.11 RC2

in the PassesFilter Function

to Fix

In the file [MODULENAME]View.ascx.vb

in the PassesFilter function

3 or 4 lines down, find the line

strTemplate= ProcessReplacements(strFullTemplate)

and change to

strTemplate = strFullTemplate

Try that and let me know if it worked for you
talal
Posts:31

07/08/2007 4:59 PM  
Thanks; I will test in the next few hours with the next module ( for this one i ended up adding the criteria manually in the code).

Thank you

TaLaL
brianc
Posts:29

09/04/2007 2:29 PM  
Did this get fixed in the download?
SoCanI
Posts:47

09/04/2007 3:42 PM  
A new build of RC2 was posted, correcting this issue
brianc
Posts:29

09/05/2007 12:50 AM  
Posted By talal on 06/07/2007 2:14 PM
but i can see the need for having the querystring for numeric value (maybe add validation?)

typically forgn keys are numeric.. not string.




I have to agree.. foreign keys are numeric... so if we wanted to use these tables for other purposes this makes it more difficult.

this is also the first step to being able to use existing tables (which really shouldnt be too difficult to do)..

Typically schemas are set .. and people want to create forms..

I hope this can be moved up.. thanks.
brianc
Posts:29

09/05/2007 1:16 AM  
there needs to be a way to know what build we are on .. RC2, RC2.1 that is never shown..

I am using RC2 and this is still there..
strTemplate = ProcessReplacements(strTemplate)

also the other bugs I emailed to you

I looked in the code to see friendlynames

However, the Select link does not work... if I modify it manually then DNN likes it

SoCanI
Posts:47

09/05/2007 8:17 AM  
Thanks brianc

This strTemplate = ProcessReplacements(strTemplate) was cleared in our tracker but not corrected. It will be in the next available download.

I've addressed your other "bugs" via email.
You are not authorized to post a reply.
Forums > Module Builder > How Do I? > Applicate Modules



ActiveForums 3.7
 



Join Now!

 
 
Copyright 2007 by SoCanI
Privacy Statement  Terms Of Use