Automation Chain + date null : Set a Date var to null ?

Hello,

I want to init a Date variable to “no value”. Is it possible ?

thank you

1 votes

1 answers

2687 views

ANSWER



Hello Me,

The widget date always show a defaut date if date is null. No way to have NO VALUE for the widget date.

You have to go arround the problem.

A) Set a document property to NULL

Document > remove property

B) Use a not mandatory workflow var that user will not change using the widget and it should be still to a default “null” value.

1) run a script where you Define a default date : wkDefaultDate to 01/01/2999

2) Run a script to initialize your var

WorkflowVariables["myDate"]=WorkflowVariables["wkDefaultDate"];

3) if needed to set to null workflow var date // After the node with the date widget => if the user didn't change the date

Run Script
if(WorkflowVariables["myDate"] ==WorkflowVariables["wkDefaultDate"]){
WorkflowVariables["myDate"] = null;
}

4) If needed // Before enter in (input node) the node with not date widget, reset the date to defaut :

Run script
if(WorkflowVariables["myDate"] == null){
WorkflowVariables["myDate"] = WorkflowVariables["wkDefaultDate"];
}

5) Update the document-property later with the workflow var not mandatory saved value if needed: Run Script

if(WorkflowVariables["myDate"] != null && WorkflowVariables["myDate"] !=WorkflowVariables["wkDefaultDate"]){
Document.doc.setPropertyValue("myxpathname:myDate",WorkflowVariables["myDate"]) ;
}
1 votes