- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to get Contact Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-12-2012 08:45 AM
I have the following snippet from VBScript that is being run from Customer Maint.
The results is '0' which I suspect is null.
I am trying to GET the full name from Customer Conacts, for the Main Contact, into variable contName
I tried nGetValue for fields in AR_Customer too, and get '0'
Any ideas?
ARCustomer = oSS.nLookupTask("AR_Customer_ui")
retVAL = oSS.nSetProgram(ARCustomer)
Set oCustomer = oScript.NewObject("AR_Customer_svc", oSS)
Set oContact = oScript.NewObject("AR_CustomerContact_svc", oSS)
retVal = oContact.nSetKeyValue("ARDivisionNo$", "00")
retVal = oContact.nSetKeyValue("CustomerNo$", AR_Customer_bus_CustomerNo)
retVal = oContact.nSetKeyValue("ContactCode$", AR_Customer_bus_ContactCode)
retVal = oContact.nGetValue("ContactName$",contName)
Solved! Go to Solution.
Re: How to get Contact Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-12-2012 08:49 AM
Looks like you need the following after you last SetKeyValue:
retVal = oContact.nFind()
Re: How to get Contact Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-12-2012 08:51 AM
Hi vtsmike,
There are a couple of things I would do.
First in your script you need to tell the object you are finished setting the key, so after the last nSetKeyValue you have there, you need to do.
retVal = oContact.nFind() ' this tells the object to fire off the search for the key specified.
Secondly, I would initialize the contName variable as a string just above the nGetValue()
contName = "" ' declares as a string
Give this a try and hopefully it works for you.
Elliott
Re: How to get Contact Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-12-2012 09:01 AM
Both responses were technically correct, but Elliott did assume I had not declared/initialized contName and that was also required.
Thanks to both of you for SUPER QUICK responses (within minutes of posting)


