Answered

How do I map a date/time field to a word template so that it only displays the date?

I have a date/time datatype field on a form and it is set to date only (no time). However, when it's stored, it is stored with the time of 12:00:00am.

When I map this field to a Word template, the time is displaying and I only want the date.

Do I have to store only the date portion in a string variable or is there an easier way to do this?

Thanks,

Cathy

Comments (7)

photo
0

Dear Cathy

The solution you mention is the corrrect way to display the date time field into a word template.

Example, You may obtain the year from a DateTime attribute in a business rule and show it within a string type attribute. The following example rule will obtain the year into a Year_var variable, in Bizagi Xpress or Enterprise .Net edition:

var Date_var = <Xpath-to-your-date-attribute>;

<Xpath-to-your-string-attribute> = Date_var.Year;

Best regards.

Luis Emilio

photo
0

Dear Cathy

Please review the following post, there you can find further information about date time field:http://feedback.bizagi.com/suite/en/responses/how-to-manipulate-the-pieces-of-a-datetime-fieldbest regardsLuis Emilio

photo
0

I have the same question. Please tell me where I would write that code (in your answer to Cathy), and how I would associate the variable to a document field. Thanks.

photo
1

Dear Ivan,

You should create a string attribute to set the value through a rule. You should concatenate something like this:

var Date_var = <Xpath-to-your-date-attribute>;

<Xpath-to-your-string-attribute> = Date_var.Day+" -"+Date_var.Month+"- "+Date_var.Year;

Best Regards

photo
0

Thanks, Juan. But at what step of the Bizagi development process should that be done?

photo
0

Dear Ivan,

You can perform calculations, assignments and validations in every activity of the process with the Activity Actions option found in the fourth step of the Process Wizard (Business Rules). These Actions can be executed when the Case enters the Activity, when the end user clicks on the Save button, or when Case leaves the Activity.

For further information: http://help.bizagi.com/bpmsuite/en/index.html?assign__calculate_and_validate.htm

Regards

photo
0

Ok, I see. I'll try your suggestion somewhere, then.

BTW, speaking of entering an activity, I've noticed something that looks like a bug, about which I've posted separately. When I click the little "graph" icon in the upper left of the work portal (by the case number) to display the Graph Query, if I hover the mouse over the current activity (highlighted), the info box that pops up usually indicates the wrong assignee. It should be showing "me", the user tasked with that activity at the current step of the workflow, but instead it shows the assignee of the previous activity ... unless this is a return to the activity through a loop, in which case it shows the correct assignee! Pretty weird, and confusing to the user. Please check it out.

As usual, I really appreciate your help!

Best, Ivan