Page 1 of 1

Custom Row Inserted Add Success Messages for related tables

PostPosted: Fri Apr 05, 2013 5:01 am
by xgis
The basic success message from the samples shows how to display the new ID on ADD, using the Row Inserted event;

Page.SuccessMessage = "The unique ID number is " & rsnew("ID")

To change the success message to display the name and the number the following modification be applied;

Page.SuccessMessage = "The unique ID number for " & rsnew("Name") & " is " & rsnew("ID")

The above sample works for the primary table, but to get it display in Foreign Key related tables the following example will get the name for the row from the parent table;

Name = ew_ExecuteScalar("SELECT <FieldName> FROM <ParentTable> WHERE ID = " & ID.CurrentValue)
Page.SuccessMessage = "The unique number for the " & Name & " is " & rsnew("ChildID")