php client simple trigger problem

Hi All,

I am using the latest jrs php client. On selecting the following option:

Run until a specified date:

And entering the simpleEndDate

I am writing the following code :

                    $trigger = new SimpleTrigger();
                    $trigger->startType = $scheduleTrigger['startType'];
                    if ($scheduleTrigger['startType'] == 2) {
                        $trigger->startDate = $scheduleTrigger['startDate'];

                    $trigger->recurrenceInterval = $scheduleTrigger['interval'];
                    $trigger->recurrenceIntervalUnit = $scheduleTrigger['intervalUnit'];
                    if (!empty($scheduleTrigger['occurrenceCount'])) {
                        $trigger->occurrenceCount = $scheduleTrigger['occurrenceCount'];
                    if (!empty($scheduleTrigger['endDate'])) {
                        $trigger->endDate = $scheduleTrigger['endDate'];

Note, that I am not setting

$trigger->occurrenceCount, when setting the trigger endDate. But it returns an unknown http status code and does not create a job. After adding the following line:

                    if (!empty($scheduleTrigger['endDate'])) {
                        $trigger->occurrenceCount = 1;
                        $trigger->endDate = $scheduleTrigger['endDate'];

It creates a job successfully. But I think it is not intended to work like that. Could anyone let me know if I am missing something when using Schedule end date for simple trigger ?



ashcsi1322's picture
Joined: Dec 6 2013 - 4:52am
Last seen: 7 years 3 months ago

Thanks,I found this information helpful.




newwaysys - 4 years 3 months ago

0 Answers:

No answers yet