an edit form or document form that invokes another feature
Uses
smartformintf, Smartdllprovider, customed, Smartshare
View
Var
Form1:tform;
Customchild:icustomchild;
Begin
If the called form is in the same DLL, then ' XXX_CRM ' can save
Form1: = Smartcreateform (' Xxx_crm ', ' tfrmaskvseditor ');
If Assigned (FORM1) Then
Begin
Specify MasterID directly. When set tfrmcustomed (Form1). Sourcedataset can also.
tfrmcustomed (FORM1). MasterID: = Self.MasterDataSet.FieldByName (' Askvsid '). Asvariant;
If Supports (Form1, Icustomchild, Customchild) Then
Begin
Customchild.loadformdata;
Customchild.openformdata;
End
Smartshowmdiform (FORM1);
End
End
"new"
var
form1:tform;
customchild:icustomchild;
Begin
FORM1: = Smartcre Ateform (' Xxx_crm ', ' tfrmaskvseditor ');
If Assigned (Form1) then
BEGIN
//cannot be directly editkind: = Ckappend, Because the tfrmcustomed.onopenformdata process is not handled well, errors occur.
//Only use the following processor.opendata (null) and processor.new to implement the new
//tfrmcustomed ( FORM1). Editkind: = Ckappend;
The dataset opens with a fake ID. If the tfrmcustomed.onopenformdata process is corrected, it is possible to set Editkindt directly to Ckappend without this line.
tfrmcustomed (FORM1). MasterID: = NewGuid;
If Supports (Form1, Icustomchild, Customchild) Then
Begin
Customchild.loadformdata;
Customchild.openformdata;
If the tfrmcustomed.onopenformdata process is corrected, it is possible to set Editkindt directly to Ckappend without this line.
CustomChild.Processor.New;
End
Smartshowmdiform (FORM1);
End
End
To learn more, you can see the tfrmcustomed.onopenformdata process in unit customed.