Refreshing documents on creation

I have a for…loop that creates documents just fine…but they do not show up in the default views, only from the custom one. I have to run manually from the pull down actions menu… @Commands([ToolsRefreshAllDocs]) from

a custom view otherwise the documents do not show up in the required default view.

I’m using a addressbook to populate entries for use in directory assistance

I use one already for vendors, but those entries are manually created and works fine with directory assistance.

But for this new project, it needs to be done programmically.

I figure computewithform would do the refresh, but documents do not show up until I manually

run the other agent from the customized view.

Any ideas anyone how to refresh all docs so i don’t have to run a agent manually?

For EntryNumber = 0 To AstroSize

EntryName = “Joe User”

'now we have our astro user, let’s do our sqlquery to get the rest of the user’s email info.

Call pullUserFromSQL ( EntryName, sqlConnection)

Set doc = db.Createdocument

doc.Form = “Person”

doc.FirstName = userFirst

doc.LastName = userLast

doc.InternetAddress = userPrimary

doc.CompanyName = “CompanyName”

doc.MailSystem= “Other”

doc.HTTPPassword = “p@ssw0rd”

doc.FullName = MergedArray ’ this populates full name field values just fine.

Call doc.Computewithform( True, False) ’ this should refresh the doc, but doesn’t

Call doc.Save(True, True)

'clear values for our next loop…

Set doc = Nothing

userFirst = “”

userLast = “”

userPrimary = “”

userAliases = “”

MergedArray = “”

Next

thanks…

Brett

Subject: Did You try Call view.Refresh? /eom

Subject: First thing I tried…

Yes… view.refreshalso created a separate agent, with @command([ToolsRefreshAllDocs]) and called that agent…

if (agent.run = …

still nothing.

If I open the document individually and add a space then save a close…it becomes viewable in all views.

Subject: Question

So you can see the document so you can edit the document. Once you edit and force a save it then appears in the other views?

I would check the view selection that the document is not appearing in and make sure you document has all that criteria in the fields. It seems to me that by editing and saving the doc it values other fields.

Subject: My another idea is…

to rebuild all views in db by Ctrl+Shift+F9 or purge all views on Domino Administrator level.

Subject: Wrong field value

The MailSystem field should not be set to “Other” it should be “3”.

I just checked all the person doc views selection formula in the pubnames.ntf and you need to set Type=“Person” on the person doc for them to appear in the views

Subject: I’ll try that…

I’ll set the doc.type = “Person” tonight on the next import…

I’ll post back with a update.

TY.

Subject: that was it

setting type=“Person” was the deal.

Thank you