Question on PSI: Setting Constraint Type

 
In our current project, we are using the PSI to copy multiple tasks from one section of the project and paste at the end in order to create new set of tasks within the project. Below is the code snippet from our solution. We, first, create a new task object.
And then we unto newly created blank task, we copy the task from the source task (from another section of the project). Then, we assign new task ID GUID. Everything gets copied correctly when comparing the original task and newly created task. One property
we have question is Task_Contraint_Type. The source task’s Task_Contraint_Type is “As soon as possible” and when we make the copy (as in the code below and upon saving the project data back to Project Server and publish/check-in the project, when we open the
project, the newly created task’s constraint type is “This task has a ‘Start No Earlier Than’ constraint on
Date” (See image below). We expected “As soon as possible” because the source task was “As soon as possible” However, this was not the case.
As a result, we modified the code (see bold) so that during the copy/create new task, we set Task_Constaint_Type to “As soon as possible”. However, this still resulted, again, in “This task has a ‘Start No Earlier’…” constraint. The workaround for now was
after we finish copy all tasks, we then grab the dataset again and then update all tasks once again to set the Task_Constraint_Type to “As soon as possible”. However, this results in doing the work twice and can be potential performance hit as we noticed that
calling “QueueAddToProject” took a lot of time as project gets fairly large (we create project of size 25k tasks). Do you know why setting Task_Constaint_Type  duing the initial task creation yields different value?
// Create a new task object
Project.ProjectDataSet.TaskRow newTask = _tasksDataset.Task.NewTaskRow();
// Copy data from the source task to newly created task
newTask.ItemArray = _tasksDataset.Task[i].ItemArray.Clone() as object[];
// Make a new GUID to be the new task's GUID
Guid taskId = Guid.NewGuid();
// Assign differentiating properties to the new task
newTask.PROJ_UID = _projectUid;
newTask.TASK_UID = taskId;
newTask.TASK_DUR = (int)PSLibrary.Task.DurationFormat.Day;
newTask.TASK_CONSTRAINT_TYPE = 0;                                 //
0 = As soon as possible
newTask.StatusManager = _projectOwnerUid;

Hi all,
It turns out that calling:
newTask.SetTASK_START_DATENull()
newTask.SetTASK_FINISH_DATENull() 
and then:
newTask.TASK_CONSTRAINT_TYPE = 0;
solves the problem of the constraint not being set.

Similar Messages

  • How to set field type choice using csom (c#)

    I have a field type: Choice (menu to choose from) which is not multichoice. How do I set a value?
    I have found code for multiple choice but it doesn't seem to work for single choice.

    Hi,
    The following code snippet for your reference:
    newListItem["ChoiceFieldName"] = "ChoiceValue";
    newListItem.Update();
    clientContext.Load(newListItem);
    clientContext.ExecuteQuery();
    If you are assigning a Value which is not in the Choice Column, You need to create a choice value then assign it to the item.
    More information is here:
    http://sharepoint.stackexchange.com/questions/124999/how-to-set-field-type-choice-using-csom-c
    Best Regards
    Dennis Guo
    TechNet Community Support

  • I've recently upgraded to Lightroom5.7.1 and now when I try to import photos a window pops up saying 'the photos can't be imported 'cos the files can't be read'. I had no problems before upgrading. I have Windows8 & can't find any 'app' which sets the typ

    I've recently upgraded to Lightroom5.7.1 and now when I try to import photos a window pops up saying 'the photos can't be imported 'cos the files can't be read'. I had no problems before upgrading. I have Windows8 & can't find any 'app' which sets the type of files I can import. Any help appreciated.

    Well, think about it. This is a Lightroom forum. We are here to answer questions about Lightroom and how to solve problems in Lightroom. Your permissions issue is an operating system issue, not a Lightroom issue. I didn't mean to be sarcastic. But there are plenty of Internet resources that will answer that question.
    I just went to Google and typed in "change disk permissions", and there are links for the Mac as well as for Windows listed. There's no sense in me rewriting instructions that are already available.

  • Question on the "SET TRANSACTION" command

    I am using Oracle 8i on NT. Our front-end is written in Panther v4.2 (aka, Jam v7.0). We have a situation where we want to do a SET TRANSACTION type of process. IE... Module A is executing DML. It then calls Module B (without committing the DML) which has a commit. We want the DML in Module B to commit, Module A should not commit until after additional processing has taken place. All of my readings have shown me this works with SAVEPOINTS and ROLLBACKS. Any clue on how to do this with COMMITS?
    Thanks.

    Hello,
    Given the situation, I would recommend that you use the autonomous transaction facility of PLSQL. This facility will only work in oracle database verison 8.1.5 and above. Let me know if you need more information on it. My email address is
    [email protected]

  • Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in. Thanks

    Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in.

    You don't. Email comes in either by push or when you invoke the email app. Ther is no password except when you first set up the account. If your iPad is not being used as your personal device and you need to shield emails from other users, then don't use the email app.  Instead, use web mail if available from your provider.

  • HT5312 I have never set up any security questions and now it is asking me for one.... how do you answer a question you never set up?????

    I have never set up a security quesiton and now it is asking me for one... i have set up 40 ipads so far without personal security info... how am i to respond to a security question i never set up????!

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Document types displayed as folders when arranged by set to type

    Hello everyone,
    I have an issue with the finder since upgraded to Lion.
    I use to open finder in column view with "Arranged by" set to "Type" and "Sort by" set to name. But the thing is that the titles/names of the document types are sometimes diplayed or behave as ordinary folders.
    Look at the snapshot below (sorry it's a french one): in the left column, display is fine. But in the middle one, "Dossiers", "Contacts", "Documents PDF" and "Documents" are displayed as ordinary folders.
    Note that the issue does not limit to the display. These non existing folders can be selected with my mouse.
    Moreover, it happens randomly and I checked on a new Account: issue is still there.
    So, as anyone observed that ?
    Thanks a lot,
    Nicolas.

    Sorry for the late reply, but yes this happens to me quite often.
    I have no solution to the problem, but it is rather annoying. Especially if you navigate from one column to another. The first file or folder does not get selected instead it is the "headline with the folder icon" that gets selected. Irritating and it looks terrible when highlighted.

  • Mapping with Scd operator set to type 2 reading source records two times

    Mapping with Scd operator set to type 2 reading source records two times.Records selected count being displayed at the end of execution is double the source record count.This possibly is affecting the performance of the mapping.
    Is this a bug in scd type 2 operagtor in OWB 11gR2.How to rectify this umwamted double loop through the source data selectiom?

    Hi Roelant,
    I think it is important to be aware that although Paris - 10gR2 - is not actually buggy (in this respect!), it is really quite idiosyncratic in exactly how it processes SCDs.
    I followed up on your and Mark's comments, and did an in depth analysis of this topic. It is at http://www.donnapkelly.pwp.blueyonder.co.uk/documents/OWB_10gR2_SCD.pdf
    My conclusions are perhaps of interest to anyone considering doing SCD processing with Paris.
    I'll be doing a follow-up this weekend, and publishing a sort of 'how-to-do-it' guide.
    Cheers,
    Donna
    Message was edited to add the words: "in this respect"

  • Can my iMac be set to type with French characters?

    Hello all! Can my iMac be set to type with French characters? If so, what is the path? And, is there a keyboard overlay to see where the French language characters are located on the keyboard? Thanks!

    Hey Steve,
    Thanks again for the thoughts... Unfortunately, the only characters that I can use keyboard shortcuts for French are the é, ç and the á (it's better than nothing).
    Outside of that, I have to switch keyboard layouts. I know of the accent grave ( `e ) that's nextdoor to the number one key... But it don't work... my translator thinks it's a typo... because it takes up a whole characters worth of space instead of sharing the space with the actual letter (vowel), like the other accents.
    So I need keyboard shortcuts for:
    ê Ê Ë ë è È
    Ô ô Ö ö
    à À Û û
    I use these letters just enough to make switching keyboards back and forth a little irksome. Since the two keyboards have pretty distinctively different layouts and then we have the position of the A and M keys and.. well... see where this could lead??? LOL
    Thanks...
    I appreciate your thoughts, as always...
    Yvonne

  • Setting thermocouple type in scan engine

    I am using cRIO 9211 to acquire thermocouple data using NI Scan Engine. I don't see any option to specify the type of thermocouple other than by right clicking on the module (in project) and selecting Properties.
    Is there a way to programmatically set the type of thermocouple?
    If this is not possible, can I can read the cjc and offset channels, so that I can convert the raw voltage to temperature in my RT code?
    Will I be able to read the cjc and offset channels if I use NI Scan Engine Advance I/O Access?
    "A VI inside a Class is worth hundreds in the bush"
    യവന്‍ പുലിയാണു കേട്ടാ!!!

    Cross posted here.
    "A VI inside a Class is worth hundreds in the bush"
    യവന്‍ പുലിയാണു കേട്ടാ!!!

  • Set Aggregation type of Count Distinct to use correct table aggregation in

    Hi there,
    Currently I use OBIEE 10.1.3.4.1 , and there is a case where a fact table consist of 2 logical table source: detail and aggregate table, which has some measure using count distinct as aggregation type. The problem is everytime I browse the measure with no dimension at all , it always use detail table not aggegation one..
    Really appreciate for any suggestion ..
    thanks a lot

    Hi,
    I don't think it's the same case as mine. Let say I have 2 table : detail and aggegate
    Detail Table consists 4 fields:
    *) Period
    *) Market
    *) Region
    *) Measure : Customer ID, Sales
    Aggregate Table consists 3 fields :
    *) Period
    *) Region
    *) Measure : Customer ID, Sales
    in the measure I set aggregation type for each field:
    *) Sales >> set as Sum
    *) Customer ID >> copy as "Number of Customer" and set as Count Distinct
    In each LTS' contents I set the level of aggregation using "Get Levels" feature..
    Then I try to browse via Presentation and do some querys belows:
    a) only choose single field of measure : Sales, the session shows that the value is taken from aggregation table and just as I expected.
    b) choose period and sales, the session shows that the values are taken from aggregation table, and still just as I expected.
    c) choose period, sales , and market, the session shows that the values are taken from detail table, just as I expected.
    d) only choose single field of measure : "Number of Customer", the session shows that the value is taken from detail table , this is NOT as I expected. It suppose to take the value from aggregation table..
    e) choose period and "Number of Customer", the session shows that the value is taken from detail table , this is also NOT as I expected. It suppose to take the value from aggregation table..
    I've tried to override the aggregation , but still confuse how to apply in measure "Number of Customer" and did not work at all..
    any idea ?
    thanks a lot

  • How to set task type of a task in MS Project using excel vba code.

    Hello Gurus,
    I am generating MS Project files(.mpp) files form excel data. An excel macro in the excel file will read the excel data and will generate the .mpp file. It is working fine. now i want to set the task type of all the tasks to "Fixed work" from excel
    vba code.
    How to use the property PjTaskFixedType in setting the task type??
    refer below links
    http://msdn.microsoft.com/en-us/library/office/ff861713.aspx
    http://msdn.microsoft.com/en-us/library/office/ff864157.aspx
    Can someone help me in setting task type property from excel vba.
    I have attached my sample code used to generate the mpp file. It is not the complete code but you will get an idea from it.
    Set pjApp = CreateObject("MSProject.Application")
    pjApp.FileNew
    Set newproj = pjApp.ActiveProject
    newproj.Tasks.Add (task_name)
    newproj.Tasks(mpp_row_number).Start = task_start_date
    newproj.Tasks(mpp_row_number).Finish = task_end_date
    newproj.Tasks(mpp_row_number).ResourceNames = resource_name
    pjApp.FileSaveAs mpp_file_save_path & mpp_file_name & ".mpp"
    pjApp.FileClose
    pjApp.Quit
    Any help is appreciated.

    Hi Syamku,
    A simple example that sets the task type:
    ActiveProject.Tasks(2).Type = pjFixedDuration
    ActiveProject.Tasks(3).Type = pjFixedUnits
    ActiveProject.Tasks(4).Type = pjFixedWork
    http://msdn.microsoft.com/en-us/library/office/ff860469(v=office.15).aspx
    Hope this helps

  • How to set container type in PHP

    Hello, I wanna to set the type of container to be XmlContainer::WholedocContainer. However it did not work, the php warnning "Fatal error: Undefined class constant 'WholedocContainer'". The book named The Definitive Guide to Berkeley DB XML told that the delimiter in php was replaced by underscore. But this guide leads php completely fall. How could I do to correctly set up the parameter? Thanks
    Edited by: user10993398 on Dec 14, 2009 5:36 PM

    Hi,
    Here is an example for dbxml-2.5.13:
    <?   
    function initDbXmlSystem()   
        global $_REQUEST;   
        $envName  = "./tmp";   
        $contName = "result.dbxml";   
        $env      = new Db4Env();   
        $env->open($envName);   
        $mgr = new XmlManager($env, DBXML_ALLOW_EXTERNAL_ACCESS);   
        $config = new XmlContainerConfig();   
        $config->setTransactional(true);   
        $config->setContainerType(XmlContainer_WholedocContainer);   
        $mgr->setDefaultContainerConfig($config);   
        $cont = $mgr->createContainer($contName);   
    initDbXmlSystem();   
    echo "DONE";   
    ?> 

  • How to set content type while sending an email?

    Hello,
    I want to set content type text/html while send an email using org.apache.commons.httpclient api. I am using MultipartPostMethod method. and i am set using object of multipartpostmethod like post.
    and post.setRequestHeader("Content-Type","text/html").
    but it wont work.
    so please give me a proper solution.
    example::
    MultipartPostMethod post = new MultipartPostMethod("url");
    post.addParameter("msgbody","html message");
    post.setRequestHeader("Content-Type","text/html");
    Regards,
    Bhavesh Kharwa

    Actually, I'm writing a "HashMap" from servlet to applet. I have used your suggested content type "application/octet-stream" and another "appication/x-java-serialized-object" to try it. But in applet side, when I use (HashMap)in.readObject(), it always gives me a exception as:"java.util.HashMap; IllegalAccessException". Why?
    Thankd.

  • I download itext  for convert jsp to PDF. How to set content type for PDF.

    I download itext for convert jsp to PDF. How to set content type for PDF. I try
    <%@ page contentType = "application/pdf;charset=TIS-620" %>
    , but the page does not PDF.
    Thank.

    PDF files are usually binary files, JSPs are not well-suited for binary content.
    (If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
    "%PDF-" without whitespace.
    You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
    Try using a Servlet instead.

Maybe you are looking for