cancel
Showing results for 
Search instead for 
Did you mean: 

External Autofill Keyset Scripts and MIKGs

Alvaro_Paniagua
Champ in-the-making
Champ in-the-making

I'm writing External Autofill Keyset Script and the issue I ran into while writing the script is ability to update/add multiple MIKGs.

I found the following example in the API SDK:

public void OnExternalAutofillKeysetScriptExecute(Hyland.Unity.Application app, Hyland.Unity.ExternalAutofillKeysetEventArgs args)
{
      
   try
   {
       app.Diagnostics.Write( string.Format( "Autofill: Primary keyword {0} = {1}", args.PrimaryKeyword.KeywordType.Name, args.PrimaryKeyword.Value ) );
       app.Diagnostics.Write( "Autofill Keywords: ");

       foreachKeywordType kt in args.KeywordTypes )
       {
           app.Diagnostics.Write( string.Format("\t{0}:{1}", kt.Name, kt.DataType ) );
       }

       KeywordType descType = args.KeywordTypes.Find(1); //description

       ExternalAutofillKeysetData data = args.Results.CreateExternalAutofillKeysetData();

       data.SetKeyword( args.PrimaryKeyword );
       data.SetKeyword( descType.CreateKeyword"TESTING" ) );

       args.Results.AddExternalKeywordAutofillKeysetData( data );

   }
   catch( Exception ex )
   {
       app.Diagnostics.Write( ex );
   } 

It works fine when you are just updating/adding single instance keyword types but I don't see how you can update/add MIKGs.

Adding/Updating MIKGs through an External Autofill Keyset Script is probably not an option but I just wanted to run it the you guys to see if anyone knows if this is possible and hopefully guide me towards the correct direction.

Thanks in advance!

1 ACCEPTED ANSWER

Tyler_Sorber
Star Collaborator
Star Collaborator

Hi Alvaro

The code within the OnBase SDK should be compatible with MIKGs as well.  I ran a quick test within my system, and was able to populate a MIKG value using this script. 

From the args.KeywordTypes property, it looks as though only the KeywordTypes within the PrimaryKeyword's KeywordRecordType can be obtained.  In this case, the example may be a bit lacking, as the KeywordType should be ontained through this property.  In this case, the Primary KeywordType will need to be within the keywordRecord that the Autofill is running against; essentially this is causing the Autofill to only be applicable for a single record type.

View answer in original post

3 REPLIES 3

Tyler_Sorber
Star Collaborator
Star Collaborator

Hi Alvaro

The code within the OnBase SDK should be compatible with MIKGs as well.  I ran a quick test within my system, and was able to populate a MIKG value using this script. 

From the args.KeywordTypes property, it looks as though only the KeywordTypes within the PrimaryKeyword's KeywordRecordType can be obtained.  In this case, the example may be a bit lacking, as the KeywordType should be ontained through this property.  In this case, the Primary KeywordType will need to be within the keywordRecord that the Autofill is running against; essentially this is causing the Autofill to only be applicable for a single record type.

Thank you for the quick response Tyler.

In my case I'm trying to autofill Legal Documents for example documents related to Lease documents.

The Primary KeywordType is the "Lease ID"
It should autofill the following KWs:
Branch
Corp Number
LMM – Branch City

This is a MIKG & might be multiple Landlords
{LMM – Landlord Vendor Number
LMM – Landlord Tax ID
LMM – Landlord Name}

This is a MIKG & might be multiple PMCs
{LMM – PMC Vendor Number
LMM – PMC TIN
LMM – PMC Name}
Vendor Number

Base on your response, the script is not going to be able to populate the Landlord and PMC MIKGs since the Primary KeywordType is not within neither of the Keywordrecords?

One more quick question I don't see how you were able to retrieve the MIKGs when the args.KeywordRecordTypes is not an option.

This is what I'm trying:
KeywordRecordType keywordRecordType = args.KeywordRecordTypes.Find("LMM - Landlord MIKG");

and I get this error:
'Hyland.Unity.ExternalAutofillKeysetEventArgs' does not contain a definition for 'KeywordRecordTypes' and no ext
ension method 'KeywordRecordTypes' accepting a first argument of type 'Hyland.Unity.ExternalAutofillKeysetEventArgs' could be found (are you missing a using directive or an assembl
y reference?)




The KeywordRecordType is not a property from the EventArgs. In this case, if you would like an Autofill to trigger on one of the MIKGs, the Primary Keyword will need to be within that MIKG, the args.KeywordTypes will contain only the KeywordTypes within that KeywordRecordType.

It seems like two Autofills will need to trigger, since there are two different MIKGs on the document.