This topic is locked

Set defaults When adding a detail record

10/21/2014 1:08:14 PM
ASPRunner.NET General questions
M
mroman98 author

Hi Forum,
I am trying to add default values to fields when adding a new row.

I added the following script to the Custom Add of the Add Page:
//** Check if specific record exists ****
var tblUsers = GlobalVars.dal.Table("vCommonData");

tblUsers.Param["ID"] = 2201;

XVar rs = tblUsers.FetchByID();

XVar data;

while(data = CommonFunctions.db_fetch_array(rs));
if(data)

{

XSession.Session["Split%1"] = data["BonusSplit%1"];

XSession.Session["Dept1"] = data["BonusSplitDept1"];

XSession.Session["CurrID1"] = data["CurrencyID1"];
MVCFunctions.EchoToOutput("Read data OK ...");

}

else

{

MVCFunctions.EchoToOutput("Nothing to Read ...");

}
// Place event code here.

// Use "Add Action" button to add code snippets.
Is this the correct syntax?.. i am not getting errors.
What i am doing is placing the XSession.Session values as defaults on the fields that i need to populate.

I get nothing.
Any suggestions?
Regards,

Manuel Roman