This topic is locked
[SOLVED]

 Detail Table Event Condition Statement using Main table

5/16/2018 2:03:09 PM
ASPRunner.NET General questions
S
swiersman author

Hi ,
Wondering if anyone can assist.

  1. I have a main table named CONSOLE
  2. I have a details table named TASKS
  3. They are associated by a foreign key column call "CONSOLE_ID".
    In EVENTS\TASKS\EditPage\Process record values - I would like it to use the "Status" value in the CONSOLE table for the following if statement:
    if(values["Status"]!= "Keep As Draft")

    {

    values["Request Deployer"]="";

    values["Request Task Issue"]="";

    values["Request Task Deployed"]="";

    }
    I know this statement would work if the "Status" column existed in the TASKS table, but the "Status" column exists in the CONSOLE table.
    Any help would be greatly appreciated.

I
i.NoLim 5/16/2018

You have to use something like this,



XVar data = pageObject.getMasterRecord();
if (data != null)

{

string strConsoleExists = "select * from dbo.Console where Console_ID='"+data["Console_ID"].ToString()+"'";

XVar ConsoleInfo = CommonFunctions.db_query(strConsoleExists, null);

XVar data2 = CommonFunctions.db_fetch_array(ConsoleInfo);
if(data2)

{

if(values["Status"]!= "Keep As Draft")

{

values["Request Deployer"]="";

values["Request Task Issue"]="";

values["Request Task Deployed"]="";

}

}
else

{

}

}


https://xlinesoft.com/asprunnernet/docs/getmasterrecord.htm

https://xlinesoft.com/asprunnernet/docs/db_query.htm

S
swiersman author 5/21/2018



You have to use something like this,



XVar data = pageObject.getMasterRecord();
if (data != null)

{

string strConsoleExists = "select * from dbo.Console where Console_ID='"+data["Console_ID"].ToString()+"'";

XVar ConsoleInfo = CommonFunctions.db_query(strConsoleExists, null);

XVar data2 = CommonFunctions.db_fetch_array(ConsoleInfo);
if(data2)

{

if(values["Status"]!= "Keep As Draft")

{

values["Request Deployer"]="";

values["Request Task Issue"]="";

values["Request Task Deployed"]="";

}

}
else

{

}

}


https://xlinesoft.com/asprunnernet/docs/getmasterrecord.htm

https://xlinesoft.com/asprunnernet/docs/db_query.htm