Date Validation in PDM

Discuss SolidWorks PDM
User avatar
JSculley
Posts: 638
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 868

Date Validation in PDM

Unread post by JSculley »

Before I go to the trouble of writing an add-in, I just want to check that I'm not missing something. I have a data card with a 'Need Date' field on it. I need to verify that the need date is not in the past before allowing a transition to take place. I don't see a way to do this out of the box.
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 695
x 346

Re: Date Validation in PDM

Unread post by mp3-250 »

We had a completely different scenario, but it could be useful maybe. I am not in front of my pc so I am speculating.
I am not daily working on this kind of stuff, so you are probably more aware than me on what the PDM tools are able to achieve.

If the date is a problem.
My colleague used the data card logic to enable a label in the datacard itself showing the date in a certain field was more than xx months older than the current date.
Instead of the label i would change the value of a hidden flag (0,1) somewhere in the datacard and check its value during transition.

If the check before transition is a problem.
An automatic dispatch triggered by file type and transition name, checks the date or the flag above before the transition happens and forcefully quit the operation.
User avatar
bnemec
Posts: 1941
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2540
x 1398

Re: Date Validation in PDM

Unread post by bnemec »

IIRC the boiler plate answer to data card validation was to put a check in the transition conditions. Which, IMO, is like putting a "Wrong Way" sign three blocks down a one lane street. I was just looking at transition condition and I didn't see a way to select a live comparator such as "today", only hard dates.
Post Reply