Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMS Bulk VDN Dictionary Import- VDNs already exist... 1

Status
Not open for further replies.

tomcy03

Technical User
Jul 12, 2010
6
GB
thread690-1554969

Using the very impressive work outlined in the above/attached thread (thanks Stinney!) I have been trying to get the CMS Bulk VDN Dictionary Import to work but with little success.

Even though the VDNs are blank or don't exist, every time I run the script it always returns with 'Following vdns already exist'.

Any idea's why this is happening? My CMS Version is currently R15.

Thanks for any assistance
 

If the VDN number exists in the CMS dictonary in any way the script won't work because it's using the add feature. If try to manually add one of the VDNs you are trying to define what does the CMS system return? Success or same error?

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
This is what I use to Bulk Modify VDNS:

'LANGUAGE=ENU
'SERVERNAME=[your cms servername]
Public Sub Main()


'Place a ";" separated file name vdns.txt on the root of C drive
'This file needs to have the vdn format: 1234;VDN Name;Description on every line
'This line will be read and split on the ";" and put in an array to add into CMS
'************If you do not have a description to enter/modify, you still need to enter the ";" after the VDN name*************
'Script writen by sgroepie for agent logins (modified by Stinney for VDN modifications)

l=0 'loop value for read loop
result=0 'Answer on adding
c=0 'counter for giving the messagebox

dim regel, a 'variable for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for vdn name. All data is read into this from vdns.txt
dim NumberArray(999) 'define array for vdn number
dim DescArray(999) 'define array for vdn description
dim fs, f 'define filesystem stuff for read

cvsSrv.Dictionary.ACD = 1

'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\vdns.txt", 1)


Do While f.AtEndOfStream <> True
regel = f.ReadLine
a = split(regel,";")
NumberArray(l) = a(0)
NameArray(l) = a(1)
DescArray(l) = a(2)

l=l+1
Loop 'keep reading in data until EOF hit.

f.Close 'close vdns.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Read all vdns into string and display it in a messagebox

for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Modify these vdns?")
if result = 1 then

sString = "" 'make string empty for next use

'Add entries

b = cvsSrv.Dictionary.CreateOperation("VDNs",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 3500

for c = 0 to l-1

If b Then
Op.SetProperty "number", NumberArray(c)
Op.SetProperty "name", NameArray(c)
Op.SetProperty "descr", DescArray(c)

On Error Resume Next

if b = Op.DoAction("Modify") then
else
sString = sString & " " & NumberArray(c) & (Chr(13) & Chr(10))
end if

End If

next

if sString <> "" then
msgbox sString, 64, "VDNs not found..."
else
msgbox "All vdns Modified", 64, "Operation Succesfull"
end if

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing

end if

end Sub


- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
Thanks for a such a speedy response and also the modify config.

I'm left even more confused now though as both fail with conflicting errors. The add fails by telling me the vdns already exist, and the modify fails by telling me vdns not found... This is the case whether the vdns exist or not.

When I add/modify manually it always completes the request successfully. I greatly appreciate your help as we're spending so much time managing the directory!
 

If you just put in one VDN to add in the txt file does it still happen?

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 

Also, what happens if you try to add an agent using sgroepie's script: thread690-1366533


- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
Hi Stinney,

I have tried both vdn and agent scripts again this morning with just a single entry within the text file(s) and both still return with the same output that the vdn or agent already exist. Any idea's what could be causing this? Just a shame as the script is so close to working then falls at the final hurdle. :'(
 
Have you check the names you use are less than 20 characters ? I had the same outcome cause my VDN name where too long and using only a number at the end to differenciate each, as CMS was shortening them to 20 letters, they were all the same... so only the first one was created and all the other were list as already existing.
 
Hi MPerocheau - yeah I've tried with all types of lengths to make sure I'm not hitting the upper limit. Still no joy to date though.
 

It's times like these I wish we had a way to contact each other directly through this forum. If there is someone please tell me how. I'd love to setup a webex and help out. Or at least get a copy of the .txt file or something to test with.

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
Thanks for the offer of webex assistance.

I shall find some time this week to proceed with the head scratching, however if I still don't find a resolution and you're willing to spend some time to work with me I'd be more than happy to set up a private group on here (well worth $9.99 a month for the privilege) for us to discuss in private as working scripts would save me so much time and effort in the future.

I shall feedback with my progress (or lack of) at some point next week.

Thanks again
 

Did you ever get this working?

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
My apologies, really should have posted something so others didn't stumble at the same point.

I can confirm that the script is working well, the problem arose because CMS doesn't allow duplicate names or ID's. The details I provided were duplicate names therefore when I went to add CMS wouldn't allow as the names already existed in the database. However when I went to modify/delete it failed as the VDN's didn't exist...

It took a little testing to prove but I have now successfully uploaded VDN's and agents using variations of your scripts.

Many thanks for checking back and Merry Christmas!! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top