Hi Experts,
I have a form template 'auto_strategy_frm' that is created based on a cutom docbase type 'auto_strategy', which in turn extends dm_sysobject. Apart from the custom attributes of the type 'auto_strategy'', I added 5 attachment controls to enable users to attach documents. Effectively, when a user creates a new form using the template 'auto_strategy_frm', a form gets saved with custom attributes and the attachments.
I need to find a way to programatically create instances of the form 'auto_strategy_frm'. Using the below code, I'm able to create instance and set the values for custom attributes of the type 'auto_strategy'.
IFormService frmService = (IFormService) client.newService(IFormService.class.getName(), sMgr);
IDfId templateId = session.getIdByQualification("dm_xfm_form where object_name ='auto_strategy_frm' and definition_state =2");
IDfId instanceID = frmService.createFormInstance(templateId, "ProductZ", "/Temp/GPDWorkSpace", docbase);
IDfSysObject autoStgy = (IDfSysObject) session.getObject(instanceID);
autoStgy.setString("auto_code", "B");
autoStgy.setString("strategy", "s2");
autoStgy.save();
But I am unable to figure out how to attach documents to the created form instance. Could anyone suggest a way to accomplish this?
Regards
Naga Sayana Kumar