How to Edit Custom Fields of Project Server 2010 Programatically

Hello,
I want to change the Custom field value of Project Server 2010. I am following the brain article. My problem is the code run successfully but the changes did not reflect to the Project server. Following is my code, Any Help??
private void UpdateRecordInProjectServer(string newValue, string projGuid, string propertyToEdit)
            ProjectSoapClient projectSvc = new ProjectSoapClient();
            CustomFieldsSoapClient customfieldSvc = new CustomFieldsSoapClient();
            CustomFieldDataSet fieldDefs = customfieldSvc.ReadCustomFields(string.Empty, false);
            LookupTableSoapClient loockuptableSvc = new LookupTableSoapClient();
            Guid projectId = new Guid(projGuid);
            ProjectDataSet projectDs = projectSvc.ReadProject(projectId, ListProjects.Project.DataStoreEnum.WorkingStore);
            foreach (ProjectDataSet.ProjectCustomFieldsRow cfRow in projectDs.ProjectCustomFields.Rows)
               // projectDs.ProjectCustomFields.RemoveProjectCustomFieldsRow(cfRow);
                CustomFieldDataSet.CustomFieldsRow fieldDefinition = fieldDefs.CustomFields.Single(
                        cfd => cfd.MD_PROP_UID == cfRow.MD_PROP_UID);
                if (fieldDefinition.MD_PROP_NAME == propertyToEdit)
                    cfRow.TEXT_VALUE = newValue;
                //projectDs.ProjectCustomFields.AddProjectCustomFieldsRow(cfRow);
                projectDs.ProjectCustomFields.AcceptChanges();
            Guid sessionUid = Guid.NewGuid();
            Guid jobUid = Guid.NewGuid();
            if (!IsProjectCheckedOut(projectId))
                projectSvc.CheckOutProject(projectId, sessionUid, "Updating
CF");
                jobUid = Guid.NewGuid();
                projectSvc.QueueUpdateProject(jobUid, sessionUid, projectDs, false);
                System.Threading.Thread.Sleep(4000);
            jobUid = Guid.NewGuid();
            projectSvc.QueueCheckInProject(jobUid, projectId, false, sessionUid, "Updating
CF");
            System.Threading.Thread.Sleep(4000);
            jobUid = Guid.NewGuid();
            projectSvc.QueuePublish(jobUid, projectId, true, SPContext.Current.Site.Url);
            System.Threading.Thread.Sleep(4000);
Muhammad Ali

Try this instead of your last section(after last "if" statement):
jobUid = Guid.NewGuid();
            projectSvc.CheckOutProject(projectId,
sessionUid, "Updating CF");
            System.Threading.Thread.Sleep(4000);
            projectSvc.QueueUpdateProject(jobUid, sessionUid,
projectDs, false); 
System.Threading.Thread.Sleep(4000);
            projectSvc.QueuePublish(jobUid, projectId, true, SPContext.Current.Site.Url);
            System.Threading.Thread.Sleep(4000);
Here is QueueUpdateProject inserted before Publish and checkIn replaced with checkOut

Similar Messages

  • How to define a unique project level custom field in project server 2010?

    Hi every one;
    is it possible to define a unique project level custom field?
    our client wants to have a unique custom field( project code) which doesn't allow users to save and publish projects with the same value.
    for example if user A define a project and set "project code = 1" if user B define another project and wants to save "project code =1" for it, the server doesn't allow him to save this value and he has to change value for example to 2
    thanks for any help

    First of all you need to have Project server development environment also for coding visual studio hands on is required.
    To start with PSI (Project Server interface)you need to have Development Environment of Project Server 2010.
    you can get the overview from http://msdn.microsoft.com/en-us/library/office/ms457477(v=office.14).asp
    You
    can get the information about SDK: Download SDK.
    http://msdn.microsoft.com/en-us/library/office/ms512767(v=office.14).aspx
    Below mentioned link is having code and reuqired information about :
    Generate Unique ID for Project using a webpart
     http://epmxperts.wordpress.com/2012/05/21/generate-unique-id-for-project-using-a-webpart/

  • How to find Project Level Text Custom Fields in Project Server 2010 databases?

    Hello,
    We are using Project Server 2010 SP2 in SEM Mode. We are planning to use Project Level Local Custom fields and we want to pull them in reports using SSRS, so I am wondering which table these "Local" (non enterprise) custom fields are stored in
    database.
    Any suggestions?
    Regards,
    Kishore Dodda
    Kishore Dodda

    Hi,
    Please see this
    similar thread about reading local custom fields though the PSI.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Updating custom fields in project server 2010/2013 using psi

    Hi,
    I have two custom fields . Lets call them A and B.
    A has some content. Now i want B to have the same content as A . B is a formula custom field wher b=[A] .
    now b is empty data and A has data.
    how do i get column in B be populated.
    i tried manual publish. IT worked but i have several projects.so iam looking for a script to do bulk publish so that data in B can be populated with data in A
    a) i checked out project (CheckOutProject)
    b) published project (QueuePublish())
    c) checked in project (QueueCheckInProject())
    however i donot get the value of A reflected in B using. Am i doing something wrong?
    Pls help.Any pointers towards a script would behighly appreciated.
    i am using project server 2010
    Thanks
    Su

    Hello,
    You probably want to use Project Pro to do the publish so the calculation happens and updates field B. For bulk publish using project pro use VBA to automate project pro to open each project then do save and publish etc.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS |
    MVP | Downloads

  • Delete Enterprise Custom Fields in Project Server 2010

    Hello,
    We have Project Server 2010, SP2, in SEM mode. We recently removed some legacy unused Project Level enterprize custom fields from system, and observed that, the fields are not visible via PWA System Settings, but still see them in Project Pro, Project Information
    dialog and also available as a field that I can add it to a view.
    I have already tried following:
    - Clear the roaming profile (global.mpt) and exit out of Project Pro, and reconnect to Project Server... but still see those fields.
    Any ideas, why we see it, and is there any additional steps we need to perfome to remove from Project Pro?
    Please suggest.
    Regards,
    Kishore Dodda
    Kishore Dodda

    Hello,
    They should have removed automatically. I have seen this before and carried out these steps:
    http://pwmather.wordpress.com/2012/02/22/projectserver-2010-msproject-enterprise-global-custom-fields-out-of-synch-ps2010-ps2007/
    Fully backup the system before doing this and test on a DEV / Test system first.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Create a Custom View in Project Server 2010 that is Visible in MS Project

    Hello All,
    We want our PMs to consistently report Physical % Complete, but couldn't find an existing "Status" or "EVM" view.  So, in Project Server 2010, using Server Settings > Look and Feel > Manage Views, I created a customized project
    view using existing fields (no customized fields, if that matters).  The problem is that I cannot find the view when I open MS Project.  Under Manage Views, in the Format View section, I have selected "Gantt Chart (Views)" for the Gantt
    Chart format field.  The view defaulted to "Timesheet" for the Grouping format field.  Under the Security Categories section, I have selected My Projects and My Tasks.  I have not applied a Filter.  Any ideas why I cannot find
    this new custom view in MS Project?  
    Was I supposed to create the new customized view directly in MS Project?  If so, where would I find the steps to do that?  Thank you!
    Julie

    Julie --
    Nice try, my friend.  Your only mistake was trying to create the Microsoft Project view in PWA.  You have to open the Enterprise Global for editing in Microsoft Project, and then create the custom view and table in the Enterprise Global. To
    open the Enterprise Global for editing, click File > Info > Manage Enterprise Global.  When you finish creating the custom view and table, then save, close, and check in the Enterprise Global file, and then exit Microsoft Project completely.
    The next time you or any of your PMs launch Microsoft Project and connect to Project Server, the custom view and table will be visible for every current and future project.  Hope this helps.
    Dale A. Howard [MVP]

  • Cannot edit Enterprise Calendar in Project Server 2010

    I am configuring a new instance of Project Server 2010, have full administrator rights, and have run into a problem with the Standard Enterprise Calendar. If I try to edit it from PWA, after about 30", I get the "Unknown Error" Message, whether I actually
    open the "Change Working time" screen in Project Pro or not. If I do get there, whether I start in PWA or in Project Pro, I cannot enter any exceptions to the calendar.
    I have looked at solutions to similar issues here in the forum and they do not solve my problems. Any suggestions would be appreciated.
    Thanks.
    Jeff

    jcu123,
    I have the exact same problem, it seemed to coincide with the installation of December CU; was this the same for you?
    I am a user in the Administrators group which certainly has permissions to change Enterprise calendars. I went in my user settings and happened to change the value of some unrelated ECF's and it somehow started working again.
    I tried similar changes in my QA environment but it still has the error there, so I cannot tell you really how to resolve it, but perhaps try some user changes and saving.
    Brad

  • Project server 2010 What are the number of Custom fields and views allowed?

    How many customizations are permitted in Project Server 2010?
    Thanks in advance

    Hi
    new findings on that issue...
    There is an article for Project Online that speaks about limits for reporting: https://support.office.com/en-US/Article/Project-Online-software-boundaries-and-limits-5a09dbce-1e68-4a7b-b099-d5f1b21ba489?ui=en-US&rs=en-US&ad=US
    Apart from that you will have an issue if you like to upgrade to Project Server 2013. When trying to convert the 2010 databases to a 2013 database a SQL stored procedure will fail if you have more custom fields than fit into the UserViews.
    Error message will be something like this:
    System.Data.SqlClient.SqlException (0x80131904): INIT METADATA ERROR!  At least one mismatch found between SQL schema for view MSP_EpmProject_UserView and reporting metadata.  Call to MSP_Epm_CheckIntrinsicAttributes failed for Projects  INIT
    METADATA ERROR.    
     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)    
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)    
     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)    
     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)    
     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)    
     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()    
     at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command)  ClientConnectionId:21f11abd-7388-48a0-a029-b5161fcb2dc8
    Workaround for the issue (UNSUPPORTED !!!!!!)
    Execute the Convertto-SPProjectDatabase script. Now you need to be fast or well prepared. You need to find the MSP_Epm_CheckIntrinsicAttributes stored procedure. Execute an ALTER statement for it and change the last lines of code to something like this:
    LblError:
       PRINT @ErrorMessage
        --changed RETURN code if an error occurs to be able to proceed with migration 
        --RETURN 1
         RETURN 0
    END
    I hope that helps someone out there - when I came across the issue last night, a google query returned nothing for INIT METADATA ERROR....
    Regards
    Christoph
    Christoph Muelder | Senior Consultant, MCTS, MCSE | SOLVIN information management GmbH, Germany

  • Missing values of Enterprise Custom Field in Project Professional and Project Web Access

    Hi all,
    In Project Server 2010 SP2 we created a custom field called Iteration Path (without a lookup table).
    We're in an environment where Project Server task data gets synched from TFS and we've mapped the Iteration Path from TFS to the Enterprise Custom Field in Project Server.
    We've triggered synch of all synchronized work items from TFS to Project Server
    Then, in the database we can see the Iteration Path values coming across
    When I open these projects in Project Profssional, the entire column of Iteration Path is empty.
    When I open these projects in Project Web App (from Project Center), the entire column of Iteration Path is empty.
    When I open the master project which contains all these projects, no values are shown.
    Any ideas what can be wrong?
    I did already clear my cache, global.mpt, but nothing changed. We don't have this issue with other Enterprise Custom Fields that are mapped to TFS fields.
    Cheers,
    Bram
    www.projectexpert.nu

    Hi Bram,
    In the 4th item, when you say "database", which one are you talking about? Project Server DB? Draft or reporting DB? 
    If the value are not showing up in Project Pro, it is no need to clean your cache, since the value are obviously not stored in the Project Server Draft DB. The issue is more likely to come from the TFS sync for this particular field. Do you have any logs
    for the sync process? If your field in anyway different from the others, containing specific characters?
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Function works in MS Project Pro 2010, but not in MS Project Server 2010

    I have an custom enterprise text field in Project Server 2010 that uses the "Instr" function and it works fine.  I created a local custom text field in MS Project Pro 2010 that was similar, but uses the "InstrRev" function and
    it works fine.  I then go to project server 2010 and try to create a custom enterprise text field using the "InstrRev" function and I get a message that says, "This formula contains errors.  Correct the formula and try again." 
    It's the exact same formula that I tried in project pro - copied and pasted.  Why is that?  Does Project Pro allow for a wider range of VBA functions in local custom fields than Project Server does when creating enterprise custom fields? 
    Is there some way around this? 
    Thanks,
    Joe

    Hi Joe,
    There is a way around it.
    Logon to MS Project Professional.
    Creat that field there
    Add Field to Enterprise while in MS Project.
    It has just worked for me.
    Please let me know if it worked for you.
    Best Regards,
    Alex

  • Best practice for patching ( Feb 2014 CU) of Project Server 2010

    Hi,
    Please advise.
    Thanks
    srabon

    Hi,
    My current environment is,
    # VM -1 (Project Server 2010) Enterprise Edition
    - Microsoft SharePoint and Project Server 2010 SP1
    - Configuration Database Version 14.0.6134.5000
    - Patch installed - KB2767794
    # VM -2 (SQL Server 2008 R2)
    Now my plan is,
    - Taking Snapshot for the VM-1
    - Should I also take VM snapshot for VM-2 ?
    - Taking Farm Backup
    - Taking /pwa site collection backup
    For your information I do see in your articale MS says that I may have SP1 or SP2 before running this patch but you mentioned I have to have SP2 as well ?
    Fyi....
    Prerequisites
    To install this cumulative update, you must have one of the following products installed:
    Microsoft Project Server 2010 Service Pack 1 (SP1) or Service Pack 2 (SP2)
    Microsoft SharePoint Server 2010 Service Pack 1 (SP1) or Service Pack 2 (SP2)
    Microsoft SharePoint Foundation 2010 Service Pack 1 (SP1) or Service Pack 2 (SP2)
    Please advise if I miss something in my plan.
    Thanks
    srabon

  • Display Custom Fields in a SharePoint 2010 Content Query Web Part?

    Using SharePoint 2010, Having Custom List With 4 Columns, Now I am Using Content Query Web-part To Display List Data ,But Currently It Display Only First Column, SO How to Display Custom Fields in a SharePoint 2010 Content By Query Web Part
    AKshay Nangare

    Hi,
    By default CQWP shows only one column. However, if you want to show more than one column, then CQWP needs to be customized. The property which you are looking for is CommonViewFields. It is used to specify the additional fields that you want to display in
    the Web Part. See this for more information:
    https://msdn.microsoft.com/en-us/library/ms497457%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • How to set a default date for a custom field of Date type in project server 2010.

    hi,
    can somebody help  me.
    How Can i set the default date for a custom field of date type in project server 2010 ?

    Dear Rohan,
    You can set default value to custom field thru Lookup table. Assign lookup table to custom field and set default value to some lookup value (Note: check the “Choose a value to use as a default when adding new item” checkbox).
    Regards,
    Avinash kumar | Blog:http://avigr8.wordpress.com | If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.

  • How to disable the edit Permission after the task approval in project server 2010.

    Hi ,
    Can this be done.
    How to disable the edit Permission after the task approval in project server 2010.
    I mean How to Disable approve/Reject Permission Once task approved in project server 2010.
    Any Help Would be more than Welcome.

    Hi Rohan,
    Just talking about the tool capabilities, preventing a task approver (status manager) to approve/reject updates once he has already approved once is not possible out-of-the-box. You grant permissions to user: if you grant a user to approve task updates then
    he has the permission to approve updates, no matter if it is the 2nd or 3rd time the task is approved or rejected.
    Then of course you could do not custom development to do that.
    I'd say that in order to help you, we would need to understand a little bit more your business need. Why do you need to achieve such a goal? We can surely propose you workaround.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Reporting on custom fields in Project 2013

    I have created custom fields in project 2013 i.e. renamed "cost 1", "text 1" etc. for the fields I require.  However when I go into reporting the fields are never there to select from.  The fields dont have formulas, a couple
    have look up tables but they are basic red/green/amber.  I just need to know how I get a custom field to appear in the right hand field list when selecting fields to report on?

    Hi MS713,
    We would need more details. Do you use Project Server or just MS Project standalone? Did you created the enterprise custom fields from PWA/server settings? Did you populate some values for some projects and publish the projects? What type of reports are
    you talking about? SSRS, OLAP Cube, Excel? Is it that you cannot see the custom fields or you see them but with no values?
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

Maybe you are looking for

  • Why does My Browser keeps Crashing on some pages?!!! and the number of those pages is increasing!

    It started couple of months ago. In the beginning it crashed only on some Youtube channels. Like if I clicked o a video that was on a proper channel like "BBC", the page loaded but in the middle it suddenly crashed with the error "Firefox has encount

  • Put songs on iPod without going through iTunes

    I have an older iPod - thisone and I want to convert it into mainly just audio books.  I don't want to keep all those audio books on my itunes library and have already backed them up so I just want to go and drag them onto my iPod. it shows up on my

  • ANNA OR BELLE Support for Nokia E5-00

    Is There Any New Software Available for nokia E5-00 The Current Software Version On My Phone Is 102.002 Dated 30/12/2012 RM 632 Solved! Go to Solution.

  • Price Value  getting  aggregated

    Hey  everyone...     Here  is  my  scenario... I'm   having  a  report  of  inventory  value by  material group  and storage  location... Matgrp                     Qty        Value               Total   1   Material       10        3                

  • Fbean

    Hi, I was trying to develop a form, which looks like a web page with urls to other forms. I tried using fbean (using hyperlink), I am able to generate the page but I want to get URLs from the table. e.g. table t_urls (seq_no, label, url) ===== I trie