An edit form or document form that invokes another feature

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.