Home
TeamSite
IMANEXT Import dialog question
System
Hi, I hope this is an appropriate place for this question:
I'm using the ImportCmd object in IMANEXT to display an import dialog to the user. It works great, but I would like some control over what the defaults are. In particular, I know the document type before displaying the dialog and I would like to set that before displaying it to the user. Does anyone have any guidence?
The alternatives I am considering:
1. Send win32 messages to the dialog to set the control to what I want.
2. Try to duplicate the dialog using the INRTForm/INRTControl api.
3. Do the import using the API with some bogus required values, then display the CheckinCmd dialog to the user. This way the fields that I'm interested in would be set correctly.
Thanks for your help.
Find more posts tagged with
Comments
STodd
My understanding is that the Import process uses the NewProf.nrs script file, in the same way a save does from within an integrated application. On the NewProfileDlg_OnInitDialog event, use the SetAttributeValueByID function of the dialog to set the value - the parameters are the custom field value (nrCustomX), the value itself (must be the correct data type), and a True/False option to say whether the field is enabled or disabled.
That way, the dialog will be populated before it is displayed.
Steve
jny
If you're implementing the ImportCmd Object to bring up the New Profile dialog, these contextitems may be used to prepopulate certain profile fields in the dialog:
"IManExt.Import.DocType" '// preset document type
"IManExt.Import.DocDescription"
"IManExt.Import.DocAuthor"
"IManExt.Import.DocClass"
"IManExt.Import.DocSubclass"
"IManExt.Import.Custom13"
"IManExt.Import.Custom14"
"IManExt.Import.Custom15"
"IManExt.Import.Custom16"
"IManExt.Import.Custom21"
"IManExt.Import.Custom22"
"IManExt.Import.Custom23"
"IManExt.Import.Custom24"
Hope this help.
Migrateduser
This is so cool. Where do I find a list of all the context items that can be used? I didn't see them in the documentation I have.
Thanks a lot,
Nate Swenson
jny
Unfortunately, this is not documented as ContextItems are supposed to be used as an internal source of communication between front-end and back-end layers of code. These ContextItem name-value pairs are subject to change.
Migrateduser
Well, thanks. This is exactly what I needed. I knew there had to be something like this (or at least I hoped there was).
Migrateduser
You can't really use SetAttributeValueByID inside OnInitDialog event because SetAttributeValueByID writes directly to controls in NewProfile dialog, which are most likely not even created/ initialized at that point. You can either use the undocumented context items or the dialog properties (for example, see INewProfileDlg and INewProfileExtra interfaces for available properties in NewProfile dialog).
STodd
Sorry guys, just to qualify my inaccuracy - we have used the _OnChange event in Online mode, but used _OnInit in Portable mode, as the _OnChange event does not fire in Portable mode.
The problem with undocumented context items is that they are just that - undocumented.