How to update TaskEnterpriseText?

V

Vincent

Please help me on this.
Is there any way (from PDS or PJQuery) to update TaskEnterpriseText(n) for
certain task. I have tried functions that are provided by PDS, it has only
functions to update Enterprise Project Custom Field, not to the Task
Enterprise Field. Thank you.
 
R

Rod Gill

I think you have to create a PDS extension to do that. Search
msdn.microsoft.com for examples and instructions.
 
V

Vincent

Thank you. I have looked at SAP PDS Extension, and found out we can do this
just by updating to the database. Here is the solution I take, and if you
think that this way is vulnerable, please comment :
CREATE PROCEDURE dbo.MSP_WEB_SP_CUSTOM_UpdateTextField (
@projID int,
@refUID int,
@textFieldID int,
@textValue varchar(255)
)
AS
BEGIN TRANSACTION
IF (SELECT COUNT(Text_ref_uid) FROM msp_text_fields
WHERE (TEXT_REF_UID = @refUID)
AND (TEXT_FIELD_ID = @textFieldID)
AND (PROJ_ID = @projID)) > 0
BEGIN
UPDATE MSP_TEXT_FIELDS SET TEXT_VALUE = @textValue
WHERE (TEXT_REF_UID = @refUID)
AND (TEXT_FIELD_ID = @textFieldID)
AND (PROJ_ID = @projID)
END
ELSE
INSERT into MSP_TEXT_FIELDS (PROJ_ID, TEXT_CATEGORY, TEXT_REF_UID,
TEXT_FIELD_ID, TEXT_VALUE)
VALUES(@projID, 0, @refUID, @textFieldID, @textValue)
-- Mark Project Server that text fields have been updated outside
UPDATE MSP_PROJECTS SET PROJ_EXT_EDITED = 1, PROJ_EXT_EDITED_TEXT = 1
WHERE (PROJ_ID = @projID)
COMMIT TRANSACTION
GO

Thanks
Gunady
 

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