M
Mike G.
I need to get a project guid given a value for an enterprise custom field.
For example: let's say I have an enterprise custom field for phone number. I
would need to find the project that has a phone number value of xxx-xxx-xxxx.
I assume both fields are stored in a database table somewhere, and so a
lookup against the table should be very fast.
Using PSI, I can get the project guid for the given phone number with the
following:
1. read the list of custom fields
2. loop through the above list to get the guid of the field for the phone
number field
3. read the list of projects
4. for each project on the list of projects:
a. call the readproject method to access info about each project
b. loop through the ProjectCustomFields, find the phone number field, and
get the value
c. if the phone numbers match, get the project uid and break out of the
loop.
The above works, but is SLOW (especially considering I could have thousands
of phone numbers to match). Certainly I'm overlooking a better way?
For example: let's say I have an enterprise custom field for phone number. I
would need to find the project that has a phone number value of xxx-xxx-xxxx.
I assume both fields are stored in a database table somewhere, and so a
lookup against the table should be very fast.
Using PSI, I can get the project guid for the given phone number with the
following:
1. read the list of custom fields
2. loop through the above list to get the guid of the field for the phone
number field
3. read the list of projects
4. for each project on the list of projects:
a. call the readproject method to access info about each project
b. loop through the ProjectCustomFields, find the phone number field, and
get the value
c. if the phone numbers match, get the project uid and break out of the
loop.
The above works, but is SLOW (especially considering I could have thousands
of phone numbers to match). Certainly I'm overlooking a better way?