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

Omkar4
Giga Contributor

Hi Abhishek,

As you suggested I created a test table and dates are updating correctly as per the excel sheet. So it must have  to do something with the project tasks table itself which extends the planned task table apparently. 

Omkar4
Giga Contributor

Also how do I check which business rules are running against the planned start date field? I'm not using any transform script apart from the business rules. Please let me know. Thanks!

Omkar4
Giga Contributor

Perhaps this could be the one causing the trouble.

find_real_file.png

 

Here's the script:

 

// Change of State to WIP Or Closed
function onChange(control, oldValue, newValue, isLoading, isTemplate) {

   if (isLoading || newValue == '') {
      return;
   }
   
   function disablePlannedStartDate(response) {
        var result = response.responseXML.getElementsByTagName("result");
        var value = result[0].getAttribute("value");
        if( value && value == "true") {
            jslog(" Alter Planned Dates : Enabled");
        } else {
            jslog(" Alter Planned Dates : Disabled");
            if( newValue == '2') {
                g_form.setDisabled("start_date", true);
            } else if( newValue == '3' || newValue == '4' || newValue == '7') {
                g_form.setDisabled("start_date", true);
                g_form.setDisabled("end_date", true);
            }
        }
   }

   if( newValue == '2' || newValue == '3' || newValue == '4' || newValue == '7' ){
        var ga = new GlideAjax('PlanningConsoleAjax');
        ga.addParam('sysparm_name', "getProperty");
        ga.addParam('sysparm_property', "com.snc.project.enable_alter_of_planned_dates");
        ga.addParam('sysparm_scope', g_form.scope);
        ga.addParam('sysparm_sys_class_name', g_form.getTableName()); 
        ga.getXML(disablePlannedStartDate);
   } else {
        g_form.setDisabled("start_date", false);
        g_form.setDisabled("end_date", false);
   }

}

There you go sir. Good find. Looks like there is some onChange variable value which causes the form to be disabled for planned start date. I would not be very much familiar with your environment and why this client script would be running . You might have to get in touch with the business stakeholders or developers to see what is the business purpose of this script. 

 

You can definitely disable this client script and then import the data but not sure if this can disrupt the normal business processes. 

 

Please mark this answer as correct and close this thread so that others can benefit from it. 

Great. So I would say look for any existing business rule , UI Policies or client scripts which might change the planned start date accordingly. Right click on the main form and configure --> BUsiness rules, client scripts and UI Policies  and specially apply the filter for u_planned_start_date (or whatever the name of the field) in the Scripts column to see if there is any script running to update this field just like this in the screenshot below (change the table from incident to your project task table):

 

find_real_file.png

 

You will be able to see any rules running against that table . Also is there any transform script you are running for this excel import ? If you are not sure where to go , then open your existing transform map and under Field Maps look for planned start date and open it :

 

find_real_file.png

 

find_real_file.png

 

Hope this will prove helpful. Let me know how it goes. ALso share your transform map screenshots for the u_planned_start_date.

 

Thanks