Data standard Date type problem

Data standard Date type problem

Anonymous
Not applicable
1,070 Views
4 Replies
Message 1 of 5

Data standard Date type problem

Anonymous
Not applicable

Hello,

 

I have a problem with a "Date" type of a property. I have modified the DataStandard with some textboxes, this textboxes are binding to some properties, one of this properties is a "Date" type property. The problem is When I press the "OK" button and the file is created the property(with date type) is empty

//WPF
Text="{Binding Prop[*Fecha_revision].Value}"

//Powershell
$Prop["*Fecha_revision"].Value = Get-Date -Format d; 

 

How Can I bind the texbox and the property(DATE type) correctly?

 

Thank you so much!

0 Likes
Accepted solutions (1)
1,071 Views
4 Replies
Replies (4)
Message 2 of 5

manuel.lanthaler
Enthusiast
Enthusiast

Hello, 

 

how did you define the Property in the Inventor.cfg ?

Get sure you are using the correct type:

 

<PropertyDefinition PropertyName="*Fecha_revision" DataType="Date" 

 

Manuel

coolOrange
www.coolOrange.com
––––––––––––––––––
Please mark this response as "Accept as Solution" if it answers your question.
If you have found any post to be helpful, even if it's not a direct solution, then please provide that author kudos.


0 Likes
Message 3 of 5

Anonymous
Not applicable

Hello,

 

No, in this case the data standard is for the Vault not Inventor.

0 Likes
Message 4 of 5

manuel.lanthaler
Enthusiast
Enthusiast

Hello,

 

the problem is in your powerShell script.

The "Get-Date -f d" is returning the date as type string but the vault wants a DateTime object.

So you have to get sure that you are setting the property with a "DateTime" object.

 

Example:

 Get-Date

[System.DateTime]::Today

[datetime]:: Parse("30/01/15")

Manuel

coolOrange
www.coolOrange.com
––––––––––––––––––
Please mark this response as "Accept as Solution" if it answers your question.
If you have found any post to be helpful, even if it's not a direct solution, then please provide that author kudos.


Message 5 of 5

Anonymous
Not applicable
Accepted solution

Hello,

 

With "Get-Date" (Without format) it works.

Thank you so much!

 

0 Likes