PDA

View Full Version : Session Value on DataAssist page with DFP


bjgarner241692
12-13-2009, 09:50 PM
I am trying to set a Session Value so that when a user inserts a record, it sets the value from a drop down list on the Insert Page as a Session Value, so that I can then use that Session Value to preset the selected value of that dropdown when they return to the page to insert the next record.

I have tried to set it on the Insert Page, triggered by Insert.
I have tried to set it on the Details Page, triggered by any form post as well as before page load.

Nothing seems to work. I cannot trigger the Session Value.

I cannot use Request.Form because of Digital File Pro and WA_DFP_UploadObj.Form will not work either.

Jason Byrnes
12-14-2009, 02:58 PM
It may be that the Insert record behavior is redirecting the page before the session can be set.


Send a copy of your page so I can take a look at the code to get an idea of where the problem is.

bjgarner241692
12-15-2009, 12:46 PM
Detail page attached.

bjgarner241692
12-15-2009, 12:55 PM
Insert page attached.
These attempts were not implemented together. It's one or the other.
By default the Session code is inserted just after the include statements on the Insert page but the page will not load if I leave it there so I moved it down to just above </head>.

That allows it to load, but the Session Value does not set.

Jason Byrnes
12-15-2009, 02:27 PM
There is no form past being made to the detail page, so the code on the detail page for setting the session value will never be triggered.


On the insert page, the code for setting the session variable needs to be after the Upload File code , but before the Inssert Record code.


move the code at lines 98 - 102:

<%
if (cStr(WA_DFP_UploadObj.Form("Insert.x")) <> "") then
Session("AddressID") = "" & cStr(WA_DFP_UploadObj.Form("cAddressID")) & ""
end if
%>



to line 44 so that the session is created after the file is uploaded and before the record is inserted.

bjgarner241692
12-15-2009, 02:42 PM
Great thank-you.
I will give that a try and post back.

bjgarner241692
12-15-2009, 08:33 PM
Worked great.
With that, I am able to preselect the values of a couple of fields to ease entering lots of repeated data.

Jason Byrnes
12-16-2009, 09:37 AM
Glad to hear it is working.