Writing to the Task.Stop field Microsoft Project - vba

I am attempting to take status off of a task by setting the task.stop field to an earlier date using vba. I am getting a "Runtime Error 1101: The argument is not valid."
I have tried the following two lines of code:
Task.Stop = CurrentProj.StatusDate
and
Task.SetField FieldID:=pjTaskStop, Value:=CurrentProj.StatusDate
Current values are:
CurrentProj.StatusDate = 10/31/2013 17:00:00
Task.Stop = 11/5/2013 17:00:00
both are of Variant/Date DataType
I could not find and use of the Stop field in any forums. Thanks for any help you can provide.

The "Split in Progress Tasks" option must be selected or the Stop field will be read only. File>Options>Schedule>Scheduling options for this project>Split in progress tasks. Checking that box solved the problem.

Related

vaadin flow DateTimePicker returns null if only one field entered

I'm using a DateTimePicker with vaadin flow 23.0.5.
The problem is that if a user only enters either the date or time (but not both), then when I save the field using a binder the result is a null LocalDateTime.
import com.vaadin.flow.component.datetimepicker.DateTimePicker;
private DateTimePicker noticeTwoDateTime;
noticeTwoDateTime = new DateTimePicker(label);
layout.add(field);
binder.forField(this.noticeTwoDateTime).bind(
NoticeTemplate::getNoticeDateTwo,
NoticeTemplate::setNoticeDateTwo);
Is there some way to warn the user that they must enter both?
I've explored using a validator but it only gets passed the LocalDateTime which of course is null.
First of all you can use a helper text as described here:
https://vaadin.com/docs/latest/ds/components/date-time-picker/#providing-input-guidance
And if that's not enough you can try to create your own validation routine and use it within the binder as e.g. here:
https://vaadin.com/docs/latest/flow/binding-data/components-binder-validation/#defining-validators
Could look similar to this then:
myDateTimeBinding = binder.forField(myDateTimePicker)
.withValidator(myDateTime -> Validation.validateDateTime(atdDateTimePicker.getValue()),
"Please pick Date and Time")
.bind(......
with Validation as your Validation Utils Class and validateDateTime as your method returning a boolean.
Workaround: If you mark the field as being required/mandatory then the DateTimePicker shows an error message, if one of both is missing.
Yeah sure, you don't want mark every date/time as required....
This problem seems to have existed already in Vaadin 14: Vaadin 14 DateTimePicker with optional time or warning for missing time

VBA code not filling in date

I'd like my VBA code to fill the date field on a particular website with the date 1990-02-22.
Here is the source code of the element whose field I need to fill in:
<input id="mainDriver.dateOfBirth" name="mainDriver.dateOfBirth" class="sg-Input user-success" data-date-split-input="true" max="2015-08-14" placeholder="yyyy-mm-dd" data-date-nopicker="true" type="date" value="">
I've tried several variations of the following code:
IE.Document.getElementById("mainDriver.dateOfBirth").Value = DateValue(1990 - 02 - 22)
e.g. I've also tried this:
IE.Document.getElementById("mainDriver.dateOfBirth").Value = DateValue("February 22, 1990")
... which seems to be the way to express the DateValue argument according to what I searched online.
In both of the cases above the page is not affected - and no error is provided in the code to debug.
Any help would be greatly appreciated.
If you'd like to see exactly where that field is, you could manually fill in the IE fields up until that point. The IE page is here.
And you could use the following example for address information when you get to those fields:
Postcode: COOKS HILL, 2300, NSW
Street Address: 33 Bull Street
Otherwise you could randomly choose / select the values of the other fields, from the dropdowns etc.
I figured it out in the end. It was a matter of copying the format of date shown in the source code, i.e.
max="2015-08-14" placeholder="yyyy-mm-dd"
... and then simply using the value property. So the following worked:
IE.document.getElementById("mainDriver.dateOfBirth").Value = "1990-02-10"
For some reason it doesn't actually display the DOB when the code is excecuted but the date is stored and used properly, thus allowing you to finish fill in the form.
Otherwise thanks for looking!

Codeception- "Failed asserting that two strings are equal." when using $I->canSeeInField

I am going to a field, entering text, saving it, then going back to verify the value is still in the field.
$I->waitForText is not working. Not sure why. I am trying the following but getting the error below:
$I->canSeeInField("//form[#id='Foo']/table/tbody/tr[3]/td[3]/textarea", "123");
Sorry, I couldn't see in field "//form[#id='Foo']/table/tbody/tr[3]/td[3]/textarea","123":Failed asserting that two strings are equal.
Any ideas?
Thanks
If you are using WebDriver, you can just debug your page using makeScreenshot()
You can just use:
$value = $I->grabFromField('//form[#id='Foo']/table/tbody/tr[3]/td[3]/textarea');
and fill other fill with your value:
$I->fillField('#your_field_id', $value);
and than, just make a screenshot:
$I->makeScreenshot('name_of_your_screenshot');
Now check your debug folder with your image.

Bootstrap DatePicker setDate method not updating calendar

I'm setting the value of a bootstrap datepicker by making use of the setValue method provided.
For example
tripToDatePicker.setValue(tripFromDatePicker.date);
But for some reason the calendar is not updated
'setValue' is replaced by 'setDate'.
Using a string as input for setDate can be tricky. It has to match with the dateformat, else you can get unexpected results. It is more safe to create a 'new Date(y,m,d)' from your input, e.g. new Date(2015,3,10) for '10 Apr 2015'. This will always work.
When using a date representation in seconds, e.g. 1428659901, then use 'new Date(value*1000)'. Note that datepicker will eat any value here, but only show the selected date in the calendar if hours, minutes and seconds are equal to 0. Took me a while to figure that out....
Edit:
http://www.eyecon.ro/bootstrap-datepicker/ is not much documented, you should try http://eternicode.github.io/bootstrap-datepicker/.
anyway the code below will work for you
$("#dp1").datepicker("update", "02-16-2012");
or
$("#dp1").datepicker("setValue", "02-17-2012");
where "#dpi" is the id of the text field on whcih datepicker is used.
After trying many things, I ended up using "update" method. The $("#dp1").datepicker("update", "02-02-2012") or $("#dp1").datepicker("update", "02/02/2012") works for me. Surprisingly no document about this method at author website. Thanks.

How can I store a dynamic text value in selenium ide and use it later in different window

I am new in selenium and trying to learning. I am creating a script and I got stuck here, I want to store a dynamic value from text message on web page ex. " Event Name:Test" this Event Name is dynamic and I want to store this and want to get in other window. In 2nd window i want to use this value(Test) to verify in the page
I tried storeValue, StoreText and storeAttribute command and getting error message for xpath or "element not found".
Please help me and advice me , what should I do?
Can You please suggest me the Xpath for storing and retrieving the event name. Please help me...
Thanks in advance,
Niru
If you are using the same test-case to navigate from page 1 to page 2 you can use the storeText function in the IDE to store the value of your event name. And then you can use the same variable in the page 2 for verification.
For example, in page 1 to store the value of event you use:
storeText(locator1, temp)
And then on page 2 you use assert:
assertText(locator2, ${temp})