Hi,Problem: my software imports documents, that have required fields: Custom1, Custom2. I have read a TechArticle: 52768 , which says:"Validated custom fields, 1-12, 29-30, ...[cut] are not supported by ContextItems.You may, however, catch the OnInitDialog Event of the dialog then call SetAttributeValueByID to preset validated fields 1-12, 29-30 ...", but in my case I have no OnInitDialog Event, because I have no Dialog. Am I right ? Any solutions? Thank you,A-S
...you should be able to set up a dialog (which is the NewProfileDlg Object) off the ImportCmd Object.
Yes. You are right, but the problem is : if document has required fields then I need to give them to the context items. These are for example, custom1 and custom2. Till context doesn't recieve these fields I will see Profile Dialog. It's written in Article 52768 "Validated custom fields, 1-12, 29-30, ...[cut] are not supported by ContextItems"
Unfortunately, there are no contextitems for any of the validated lookup fields.I see two approaches to get around this for you:1. Use the low-level (imanage.dll) api's to create a document object and checkin the file. Like so:[C#]=========================[cut]=========================2. If your Custom1/2 fields are required by a particular doc class, then you could add a non-required class first when invoking your ImportCmd. After the document is imported successfully, you may use the imanage.dll API's to update the profile with the intended doc class and custom 1/2 fields that are required by it. You may do so by calling the SetAttributeByID Method (as demonstrated above) off of the imported document object returned by the "ImportedDocument" ContextItem. Don't forget to call Update() afterwards.