Retrieve WRES_ID for a Resource via VBA

A

Anatess

Hi all,
I wrote a macro to retrieve resource rates information from the enterprise
resource pool and writing it to a text file. I used the Resources object to
retrieve the information. I need the WRES_ID for the Resource as well, but I
don't see that field in the Resources object. How do I extract the WRES_ID?

Here's a sample of how I'm retrieving resource data. I need to add WRES_ID
to the MsgBox...
Sub GetRates()
Dim r As Resource
Dim rs As Resources
Dim prs As PayRates
Set rs = ActiveProject.Resources
For Each r In rs
Set prs = r.CostRateTables("A").PayRates
Dim dtFromDate
Dim dblStdRate
Dim dblOTRate
dtFromDate = prs(1).EffectiveDate
dblStdRate = prs(1).StandardRate
dblOTRate = prs(1).OvertimeRate
MsgBox ("From:" & dtFromDate & " Std Rate: " & dblStdRate & " OT Rate:
" & dblOTRate)
Next
End Sub

regards,
Anatess
 
A

Anatess

I did. And it only shows me the same data as resource.ID which is the row
number of the resource on the Enterprise Resource Pool listing.
 
J

Jack Dahlgren

And what is the problem with that?
I don't see any lines in your code which reference the ID...
Are you saying you need the ID from the project server database?
What will you do with that?

-Jack
 
A

Anatess

I need the WRES_ID (that is in MSP_WEB_RESOURCES) in the extract so that it
can be used on downstream processes. I didn't post the entire script below.
I was just trying to show where I got the Resource Rates from. I cannot use
SQL to get the resource rates because the enterprise version of the rates is
stored in binary format. So, I'm using a script to get all the information.
But, I can't find WRES_ID in the resource object.

regards,
Anatess
 
J

Jack Dahlgren

WRES_ID is not a property of the resource. You might look at the resource
table in the database to determine if there is some sort of join you can make
using resource unique ID. I think also that resource name should be unique so
perhaps you can use that as the key. I don't have a copy of the database
handy to look it up, but look around at the tables and I think you should
find a way.

-Jack Dahlgren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top