Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] API : How ...
 
Notifications
Clear all

[SOLVED] API : How to search activity with validatedStartDate ?

3 Posts
2 Users
0 Reactions
1,374 Views
(@iflorian)
Posts: 63
Active Member
Topic starter
 
[#8327]

Hi there,

When I search Activity with API with criteria like idProject and IdUser, like this :

$sql =" idProject ='5'and name='Congé Annuel'and idUser='28'";
$search_presence_activity= urlencode($sql);

it's OK, I get a result like this  : 

object(stdClass)[23]
  public 'identifier' => string 'id' (length=2)
  public 'items' => 
    array (size=13)
      0 => 
        object(stdClass)[176]
          public 'id' => string '275' (length=3)
          public 'reference' => string '-TAS-150' (length=8)
          public 'name' => string 'Congé Annuel' (length=13)
          public 'idActivityType' => string '26' (length=2)
          public 'nameActivityType' => string 'Tâche' (length=6)
          public 'idProject' => string '5' (length=1)
          public 'nameProject' => string 'Absences' (length=8)
          public 'externalReference' => string '' (length=0)
          public 'creationDate' => string '2022-06-23' (length=10)
          public 'lastUpdateDateTime' => string '2022-06-23 11:40:02' (length=19)
          public 'idUser' => string '28' (length=2)
          public 'nameUser' => string 'NOE Alexandre' (length=13)
          public 'idContact' => string '' (length=0)
          public 'nameContact' => string '' (length=0)
          public 'originType' => string '' (length=0)
          public 'originId' => string '' (length=0)
          public 'refName' => string 'Congé Annuel' (length=13)
          public 'description' => string '' (length=0)
          public 'idActivity' => string '' (length=0)
          public 'nameActivity' => string '' (length=0)
          public 'idStatus' => string '1' (length=1)
          public 'nameStatus' => string 'enregistré' (length=11)
          public 'idResource' => string '28' (length=2)
          public 'nameResource' => string 'NOE Alexandre' (length=13)
          public 'idMilestone' => string '' (length=0)
          public 'nameMilestone' => string '' (length=0)
          public 'fixPlanning' => string '0' (length=1)
          public 'paused' => string '0' (length=1)
          public 'handled' => string '0' (length=1)
          public 'handledDate' => string '' (length=0)
          public 'done' => string '0' (length=1)
          public 'doneDate' => string '' (length=0)
          public 'idle' => string '0' (length=1)
          public 'idleDate' => string '' (length=0)
          public 'cancelled' => string '0' (length=1)
          public 'result' => string '' (length=0)
          public 'validatedStartDate' => string '2022-06-20' (length=10)
          public 'plannedStartDate' => string '' (length=0)
          public 'realStartDate' => string '' (length=0)
          public 'initialStartDate' => string '' (length=0)
          public 'validatedEndDate' => string '2022-07-01' (length=1

But when I add a date criteria like "validatedStartDate" in my search criteria like this: 

$sql ="idProject ='5'and name='Congé Annuel'and idUser='28' and validatedStartDate = '2022-06-20'";

The result is empty. Why ??  Normally, I sould obtain the same résult because it's the same date as before ! 

How to obtain my activities with date criteria, please ? 
Is it possible to search activity with validated start and end date ? 
Maybe I'm doing it wrong ? 

Thank you so much in advance,

Florian


“Be a yardstick of quality. Some people aren't used to an environment where excellence is expected.” ~ Steve Jobs
"...and while some may see them as the crazy ones, we see genius, because the ones who are crazy enough to think that they can change the world, are the ones who do." ~ Think Different

 
Posted : 23 Jun 2022 14H33
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

You cannot use in criteria fields that are not part of table activity.
validatedStartDate is part of planningelement table.

What you can possibly do is define a stored filter with the critera you need and access API using the filter id


 
Posted : 23 Jun 2022 16H30
(@iflorian)
Posts: 63
Active Member
Topic starter
 

Ok, thank you for this information.
it's disturbing since this date is in the results.
I can close this topic now 🙂

Have a good day,
Florian


“Be a yardstick of quality. Some people aren't used to an environment where excellence is expected.” ~ Steve Jobs
"...and while some may see them as the crazy ones, we see genius, because the ones who are crazy enough to think that they can change the world, are the ones who do." ~ Think Different

 
Posted : 23 Jun 2022 18H47
Share:

Scroll to Top