This topic is locked

add new to the non visable fields

7/17/2009 2:45:18 AM
ASPRunnerPro General questions
T
tone21705 author

I am having trouble adding a record to my tables in the correct format.
One of my SQL queries:

SELECT

ID,

ObjectLabelName,

ObjectName,

FormName,

SectionName,

ObjectType,

OrderId,

Facility,

StopDate

FROM supDynamicFormSectionGenerator

WHERE FormName ='MedErrorForm' AND SectionName ='Prescribing' AND Facility ='SFGHCOPC'


But I only allow the user to see the fields ObjectLabelName, OrderId, and StopDate. When I click add new I am able to type in values for those 3 but it doesnt show up in the ASPRunner page because it doesnt have values for FormName, SectionName, and Facility. I would like ASPRunner to autofill in the FormName as 'MedErrForm' and the SectionName as 'Prescribing' and Facility as 'SFGHCOPC'. So the frontend user does not have to see that part of the db.
Is this possible? It would be such a great help if it was. Thanks for the great app and your help. If you need any more info from me just ask.

J
Jane 7/17/2009

Hi,
use Before record added event on the Events tab for this purpose.

Here is a sample:

values("FormName") = "MedErrorForm"

values("SectionName") = "Prescribing"

values("Facility") = "SFGHCOPC"

T
tone21705 author 7/21/2009

Hi Jane,
Thanks for your help.
I added the suggested code and I still get the same result.
Here is the code that I am putting in the Prescribing - Before record added:

' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair
'********** Custom code ************

' put your custom code here

values("FormName") = "MedErrorForm"

values("SectionName") = "Prescribing"

values("Facility") = "SFGHCOPC"
BeforeAdd = True
' set BeforeAdd to True if you like to proceed with adding new record

' set it to False otherwise


When I goto the db I see a new record in the correct table (supDynamicFormSectionGenerator) with the values for ObjectLabelName, OrderId, and StopDate that I put in, but the FormName, SectionName, and Facility are still blank.
I am using ASPrunner 6.0 if that makes any difference.

J
Jane 7/22/2009

Here is code for ASPRunnerPro 6.0:

dict("FormName") = "MedErrorForm"

dict("SectionName") = "Prescribing"

dict("Facility") = "SFGHCOPC"