Before I start about the following post, I would like to extend my deep sympathy towards the Japanese people who are stuck by the disaster and am continuously keeping them in my prayers.
Requirement : A Service Request cannot be closed without filling in comments in the Summary control. An error message should be thrown "Please enter Summary information before closing the Service Request."
Solution:
We solve this problem by using PreWriteRecord event which is called before a row is written to the database.
The event can perform any final validation necessary before any internal record-level validation is performed.
function BusComp_PreWriteRecord ()
{
var Status=this.GetFieldValue("Status");
var Abstract=this.GetFieldValue("Abstract");
if (Status == 'Closed')
{
if (Abstract=='')
{
TheApplication().RaiseErrorText("If Status is closed then Summery must be entered");
}
}
}
Requirement : A Service Request cannot be closed without filling in comments in the Summary control. An error message should be thrown "Please enter Summary information before closing the Service Request."
Solution:
We solve this problem by using PreWriteRecord event which is called before a row is written to the database.
The event can perform any final validation necessary before any internal record-level validation is performed.
function BusComp_PreWriteRecord ()
{
var Status=this.GetFieldValue("Status");
var Abstract=this.GetFieldValue("Abstract");
if (Status == 'Closed')
{
if (Abstract=='')
{
TheApplication().RaiseErrorText("If Status is closed then Summery must be entered");
}
}
}