Alright, I managed to reverse engineer the outline codes.
First of all, look up the FieldID in MSP_CONVERSIONS. The
MSP_CODE_FIELDS table will then link you to the appropriate entry in
MSP_OUTLINE_CODES.
FieldID from MSP_CONVERSIONS corredponds to CODE_FIELD_ID in
mps_code_fields. So if you want for instance task enterprise task
outline code 5 (fieldid = 188744427) for the task with a task_uid
@mytaskid and in the project with project ID @myprojectID, the sql
query would be:
select oc_name, oc_description from msp_outline_codes moc
inner join msp_code_fields mcf on moc.code_uid = mcf.code_uid
where moc.proj_id = @myprojectid and moc.code_category = 0 and
code_field_id = 188744427 and moc.code_ref_uid = @mytaskid
you can of course add additional joins to make the lookup easier but
you need the project id, task uid and the field id and then you can
look up the outline code. Similarly, I figure adding an outline code
would just correspond to making an entry in the msp_code_fields table
which links the pre-existing msp_outline_codes entries (those come from
the enterprise global).
Hope that helps
Stephan