Page 1 of 1

GANTT - CRUD Manager

Posted: Tue Feb 07, 2023 11:31 am
by shaveta

Hi,

We have integrated advanced Gantt using CRUD manager to sync data and facing issues with baselines sync. Could you please clarify the below question?

Does CRUD Manager supports add/edit/delete for baselines? So for a task, if the baseline is added or modified is it going to Sync? Does the response below look good in that case

{
	"success": true,
	"requestId": 16757615018882,
	"tasks": {
		"rows": [{
				"$PhantomId": "_generatedClassDefEx_65c17e30-3687-41ce-a3e7-a2bbcae4ab3c",
				"id": "4038",
				"baselines": {
					"rows": [{
						"$PhantomId": "_generatedClassDefEx_65c17e3-3687-41ce-a3e7-a2bbcaedsd3",
						"id": 1
					}]
				}
			},
			{
				"$PhantomId": "_generatedClassDefEx_df188ebf-b44e-4714-afe6-d9892ea574fb",
				"id": "4039",
				"baselines": {
					"rows": [{
						"$PhantomId": "_generatedClassDefEx_65c1e3-3687-41ce-a3e7-abbcaasdsd3",
						"id": 2
					}]
				}
			}
		]
	},
	"revision": 3713
}

Re: GANTT - CRUD Manager

Posted: Tue Feb 07, 2023 1:35 pm
by alex.l

Hi,

baselines should be set as regular ArrayField value of TaskModel field. So, no need to wrap baselines data into rows.


Re: GANTT - CRUD Manager

Posted: Tue Feb 07, 2023 2:24 pm
by shaveta
alex.l wrote: Tue Feb 07, 2023 1:35 pm

Hi,

baselines should be set as regular ArrayField value of TaskModel field. So, no need to wrap baselines data into rows.

Do you mean something like below

{
   "success":true,
   "requestId":16757615018882,
   "tasks":{
      "rows":[
         {
            "$PhantomId":"_generatedClassDefEx_65c17e30-3687-41ce-a3e7-a2bbcae4ab3c",
            "id":"4038",
            "baselines":[
               {
                  "$PhantomId":"_generatedClassDefEx_65c17e3-3687-41ce-a3e7-a2bbcaedsd3",
                  "id":1
               }
            ]
         },
         {
            "$PhantomId":"_generatedClassDefEx_df188ebf-b44e-4714-afe6-d9892ea574fb",
            "id":"4039",
            "baselines":[
               {
                  "$PhantomId":"_generatedClassDefEx_65c1e3-3687-41ce-a3e7-abbcaasdsd3",
                  "id":2
               }
            ]
         }
      ]
   },
   "revision":3713
}

Re: GANTT - CRUD Manager

Posted: Tue Feb 07, 2023 2:51 pm
by alex.l

Yes, something like this, but without "$PhantomId", baselines has only id. You can review request format after you added new baseline to see data structure.


Re: GANTT - CRUD Manager

Posted: Tue Feb 07, 2023 3:14 pm
by shaveta
alex.l wrote: Tue Feb 07, 2023 2:51 pm

Yes, something like this, but without "$PhantomId", baselines has only id. You can review request format after you added new baseline to see data structure.

Here is the scenario
I have a Project plan with 5 tasks and baselines dates
I added 2 new tasks and again set baselines for tasks
Triggered Sync
Tasks are getting synced with newly generate ids(CRUD Manager is handling them automatically) but for baselines, how can I get an Id for newly generated baselines as you mentioned we don't have "$PhantomId"

If I pass Id for baselines in response, is it going to automatically replace it with first value in array?


Re: GANTT - CRUD Manager

Posted: Wed Feb 08, 2023 12:44 pm
by alex.l

You need to check on server side, if you didn't have baseline with that id, then it's new.

If I pass Id for baselines in response, is it going to automatically replace it with first value in array?

No, you can use your ids. All data you returned from server will be used.