Layout question

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Layout question

Post by pbrad »

I have an application that handles technician workorders. I would like to create a form where the information specific to a particular workday shows at the top of the form such as Date, techid etc..

Below that I would like to show in seperate rows, each of the workorder details relating to a particular workorder. These rows would either be plain text or uneditable fields. Below each of these rows I would like to have a row of editable fields relating to the results of each workorder that could be input by the technician.

The aim is to have a single form where a given technician can see all of his workorders for a given day and input his work completed on each workorder without having to constantly jump out to an individual results form.

I have created an installation task object and referenced an installation results object and can get a single instance of the two objects on a form but I can't seem to get all of the instances for that day. Any help would be appreciated. - thanks
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Here is how you can do it.

1) Create objects WorkDay and WorkOrder. Object WorkDay should have attribute WorkOrders of type WorkOrder (multiple allowed) with matching attribute WorkDay on object WorkOrder of type WorkDay (multiple not allowed).

2) Define a form for object WorkOrder and place on it the attributes you want to be displayed for the order inside the main WorkDay form.

3) In the presentation dialog for attribute WorkDay.WorkOrders, select "Display As: Table of Items" option, tick "Allow Inline Editing", click "Use form for each row" for "Display Method" on the right, click "Details" button next to it and select the form defined for object WorkOrder in the previous step.

4) Define a form for object WorkDay. Place the workday-related attributes (Date, etc.) on top of the layout and WorkOrders attribute underneath.

This is basically it. When the form for WorkDay is displayed the user will be able to see the workday-related attributes on top and a list of work orders for the day in a table where each order is shown using its own form.


As for displaying multiple installation results for an installation task, please check that "multiple allowed" box is ticked for InstallationResults attribute on InstallationTask object. Also, check the number of items to show in the presentation dialog for the attribute and make sure it is more than 1.
Aware IM Support Team
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Got it

Post by pbrad »

Thanks for the fast response. I read up on the manual and had pretty much the same idea. The only thing that I am a little unsure of is that I presume that the workorders will get their workorder date from the Workday object which means that an instance of that date must exist in Workday for each date before any workorder can be created for any date. How is that normally handled? Should I pre-populate the Workday object with instances of dates for the next year or am I missing something?
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Yes, you need to have an instance of Workday object before you can start creating instances of WorkOrder for that day. You can add a regularly running scheduled process to create Workday instances for the next day/week/month/year as required. For example, if the process is set to run daily, it would check that a Workday exists for the next day and would create one otherwise. Such process would have a single rule:

If NOT (EXISTS Workday WHERE (Workday.WorkDate = DATE_ADD(CURRENT_DATE, 1)))
Then CREATE Workday WITH Workday.WorkDate = DATE_ADD(CURRENT_DATE, 1)

You can also create a Workday instance manually if necessary.
Aware IM Support Team
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Many Thanks

Post by pbrad »

Excellent, I figured that a process was the answer. Thanks
pbrad
Posts: 781
Joined: Mon Jul 17, 2006 11:03 pm
Location: Ontario, Canada

Making progress

Post by pbrad »

I have this working except there are multiple employees and I need a workday to be specific to be an employee. At the top of the form I need the Employees name greyed out but the workday.starttime and workday.endtime to be editable. Then I need the workorders listed out below that but of course, those workorders must only be for that day for that employee.

Each new instance of a workday needs to be for not only each available day but also for a specific employee. Do you think that making a new instance for each employee each day automatically by a process is the way to go or is there someway that I can create the workday as part of the process of creating a workorder?

I am even wondering if I shouldn't be linking the workorders to workdays through a query rather than reference attributes. Any guidance would be greatly appreciated.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

To link a workday to an employee you can add a couple of matching attributes: Employee.Workdays of type Workday (multiple allowed) matching to Workday.Employee of type Employee (multiple not allowed). You can then display the employee details (Name, etc.) on the Workday form using the Table Of Items presentation option.

The form for Employee will show a list of workdays (sorted on date in descending order). The user would click to an item in the list to get to the workday form. There are several ways to add workdays to employee. One is to use a scheduled process as described above, modified slightly to create workdays for multiple employees:

If NOT (EXISTS Workday WHERE (Workday.WorkDate = DATE_ADD(CURRENT_DATE, 1))) Then
FIND ALL Employee
CREATE Workday FOR EACH Employee WITH Workday.Employee = Employee, Workday.WorkDate = DATE_ADD(CURRENT_DATE, 1)

Another way is to let the user create a new workday for a given employee for the current day, next day, next business day, etc. by a single click. This can be done by a process with a single rule, for example:

CREATE Workday WITH Workday.Employee = Employee, Workday.WorkDate = CURRENT_DATE

The process can then be added as an operation to Employee form protected by the following condition:

NOT (EXISTS Workday WHERE (Workday.WorkDate = CURRENT_DATE AND Workday.Employee = Employee))

The condition will ensure that the operation will not be visible to the user if the workday already exists. Otherwise it will appear as a hyperlink above/below the Employee form.

Finally, the user can create a workday for any desired date using the Add New Item button for the Employee.Workdays attribute on form Employee.
Aware IM Support Team
Post Reply