Unable to process planned start date field for project tasks using data source and transform map

Omkar4
Giga Contributor

I'm trying to import project tasks then subtasks from excel sheet however for some reason planned start date is not updating and the same date is applied to all the tasks despite each having different planned start dates.

find_real_file.png

 

find_real_file.png

1 ACCEPTED SOLUTION

Hmmmmm tricky thing to do in Transform Map. There is a setWorkflow(false) method but it disables all the business rules which in your case, you do not want it.

 

I would go ahead and plan this import during a downtime and would inactivate the desired business rule itself. Import all the data and then re-activate it later.

 

Hope it makes sense.

View solution in original post

16 REPLIES 16

I found this under the business rules.

find_real_file.pngAlso I'm not using any transform scripts:

find_real_file.pngHere's the planned date filed from my transform map:

find_real_file.png

Omkar4
Giga Contributor

Also here's the script for that business rule "Disable the Change of Planned Dates"

 

function onBefore(current, previous) {
    var propertyName = 'com.snc.project.enable_alter_of_planned_dates';
    var tableName = current.sys_class_name;
    var isEnableAlterOfPlannedDates = SNC.PPMConfig.getProperty(propertyName, tableName, 'false'); 

    // If Task is in WIP and Planned Start Date Changes OR 
    // If Task is Closed and Planned Start Date or Planned End Date Changes 
    var stateUtil = new PlannedTaskStateUtil(current);
    var stateBucket = stateUtil.getBucketForState(current.state);
    if ( stateBucket == PlannedTaskStateUtil.CLOSE_STATES) {
        if ( current.end_date.changes() ) {
            // Ignore this condition if triggered for Actual dates update
            if(current.work_start.changes() || current.work_end.changes() || current.state.changes())
                return;
            gs.addErrorMessage(gs.getMessage("Cannot change the planned end date of closed task"));
            current.setAbortAction(true);
        }
    }

    if ( stateBucket != PlannedTaskStateUtil.OPEN_STATES && stateBucket != PlannedTaskStateUtil.PENDING_STATES ) {
    if ( current.start_date.changes() && isEnableAlterOfPlannedDates != 'true') {
        gs.addErrorMessage(gs.getMessage("Cannot change the planned start date of already started / complete task"));
        current.setAbortAction(true);
     } 
  }
}

You can defintiely disable the business rules by unchecking 'Run Business Rules' in the Transform Script. For Client script, I believe just disable it and import a test set. But remember this is a Out of Box functionality (Business Rule and Client Script ) which makes sense to not change the planned start date and end date. 

 

Look at it this way: If your state of the project is already closed , why would you change the planned start date and end date. Even in your spreadsheet, the PRJ is already closed so changing that again will disrupt the workflows and metrics and your duration fields. 

 

Please mark this as correct answer/helpful if this solves your problem

Hi Abhishek,

Good news. I was able to find the business rule which was preventing the planned start date field to be updated.

find_real_file.png

As you can see it's an oob, is there a workaround wherein I can temporarily disable this specific business rule and reactivate it while running the transform using a script.

 

Please help.

 

Thanks again!

Glad that you were able to find the exact business rule. If I were you , I would inactivate the RUn Business Rules on the transform script . 

 

find_real_file.png

 

This will ensure that no business rule run . Hope it helps.