Use array for two corresponding fields

Hi Gurus,

I have to write a code for agent which marks delete flag

Here is the logic for tha and i am not able to use array.can any one please help me to white the code.

Logic:

i. Get the collection of all the Keyword documents and create an array for categories & corresponding record retention periods in days

ii. Get the current date & time

iii. For each COS document in the database compare the document creation date with the current date

iv. If the difference is greater than the record retention period then set the delete flag to “1” in the COS Document. Here use the record retention period for the category mentioned in the COS document

v. Save the COS document

there are two forms COS and Keyword…

category and retention period is field in keyword form…

category field is also in COS form …the value of category field in COS form fetched by keyword form…

any one can please help me as i hav to do it by tomarrow morning…

thanks,

Subject: RE: use array for two corresponding fields

I suggest you use a List datatype rather than an array.

Dim retentionTimeList List As Integer ’ key is category, value is retention period in days.

Now as you read the Category documents, you can just use an assignment such as:

retentionTimeList(categoryname) = retentionDays

Later on, as you’re processing documents and want to know what the retention period is for the current document, you could write:

retentionPeriod = retentionTimeList(doc.Category(0))