How would you save this data on a database: An user can make phone calls (id, date, hour, duration, outcome).
The "outcome" can be, for example, to recall the client on another day (so I have to save the date, the hour, etc of this "future" call).
How would you manage this data on a db?
At the moment i have only a "Call" table.
One way would be to add an ENUM field specifying what type of call it is. So all calls actually taken would have that field set to "taken", and any future calls added would be "future", or something like that.
In your 'result' field of the original call, you could also reference the ID of the new call if that is useful.
Related
In my current project I need to check if a process Instance already exist. I should be able to check this against a value which is stored in the pipeline.
In WmMonitor I tried a few services but with none I was able to find the existing process.
Do I need to mark the pipeline variable as logged field to be able to find the process instance?
Mayeb someone can share an example?
Regards Dirk
Yes, you have to mark the field as a 'logged field' in order to be able to search for process instances with a certain value in this field. Use services from the package WmMonitor.
This is too long, so I used answer instead of comment.
As of my understanding, you have some data, for simplicity assume, that just one string represents the data. Let say this is in a DB table. You should have flag in same table - processed with values true/false (in DB typically 0/1) and there should be a scheduler creating processes for unprocessed data only.
So the pseudo code would be:
retrieve unprocessed data
for each record try to create process
if creation was successful, mark the data as processed and continue
in this scenario you do not need to check whether process was started already...
Feel free to comment if something is unclear ;-)
We're trying to create a template date prompt to be used across multiple universes, and also be used against multiple date fields (for instance, Transaction Date, Invoice Date, etc)
The prompt should display a list of values like the below (there's about 30 total):
Date Range START_DATE END_DATE
-------------------- ------------------------------ --------------
D: Yesterday 12/02/2015 12/03/2015
M: Month Before Last 10/01/2015 10/31/2015
M: Month to Date 12/01/2015 12/02/2015
Our initial attempt at this (creating a derived table, and then some aliases against the derived table, with one alias for each date type such as Transaction Date, Invoice Date, etc) was a failure - the sql generated is wrong, and includes the sql that's just supposed to provide the list of values. I think we need to use a different approach entirely.
Thanks for reading so far. I would greatly appreciate any ideas! Feel free to ask questions and I'll edit my notes to answer.
EDIT - we're using UNV (legacy Universe Design tool)
I'm going to assume you have an existing (dimension) table that contains a record for each date and the necessary columns to hold the different representations. You can also create a derived table for this.
Here are the steps to achieve what you described (sorry, no screenshots, this is off the top of my head):
Create the required dimension objects (based on your date table) in a separate class in the universe (you can hide this class at the end; the end user shouldn't see them).
Take one of the date dimension objects (e.g. Transaction Date, Invoice Date. …), enable the LOV option and edit it (which should bring up the query panel).
In the query panel, select all the dimension objects, created in step 1, that you want to show in your LOV. Important: the object holding the value to be returned, should be placed first in the query panel. Run the query (nothing will appear though).
Make sure that you enable the option to Export the LOV, otherwise your customisations will be lost upon exporting the universe. Optionally, enable the option to refresh the LOV each time the user calls it.
As you can't really define a single, reusable LOV in UDT that you can reference in different dimension objects, you'll have to perform this for each dimension object that you would want to have this LOV.
One way around this annoyance may to define the customised LOV once, note down the generated LOV name (about 8 alphanumeric characters long) and then replace the LOV name in the other dimensions with that LOV name. I'm can't guarantee that this will work though.
In contrast: with IDT you can define a customised LOV like this once (either in the Data Foundation Layer or the Business Layer), and then reference it as much as you want.
I have an online database CUSTOMERINFO with more than 100k details stored like following format Cust Id, Customer name, Addr, Phone,.......,Call back time
I want to retrieve data when call back time equals current time automatically.
I have designed front end with Java and currently 10 employees working with the database and now they are manually retrieving the data by ID,..
I know select command is very useful to retrieve but I want it to do automatically instead of calling each time manually.
Edited:
When the customer data is retrieved from table, either we will set another call back time or no call back and then pushed into table again.. In the next time if no call back is set in the place of call back time that row no need to be retrieved.
I'm likely missing something here, but:
Something like SELECT ... FROM table WHERE 'Call back time' >= NOW()
I'd recommend not using simply equals, as has been said in the comments, because you might miss items.
If you update the callback time after you have retrieved the callback items, that should work as long as you do not do the query to get callbacks more than once every few seconds.
As was mentioned in the comments, this is just the start though. There are going to be other issues you'll have to deal with.
I am working on a small application in Access Services on SharePoint to log colleagues leave requests, and I need to work out a data macro to calculate how many days of leave they have remaining from their allowance.
I have a table [Colleagues] with all of the user data, for simplicity I'll reduce it to [Email] and [Allowance] in days. I have another table which stores the requests [Requests] including the number of days to deduct in each approved leave request [Days Requested].
I have set up a query that returns all approved requests for the colleague and I would like to use a data macro that is triggered to run when the colleague logs in. As you cannot use aggregate functions in Web Applications, I am currently using ForEachRecord in the query to total the number of deductible days, however I cannot work out how to return that to a field in the [Colleague] record.
According to the Access help, I should be able to set the value to a LocalVar and use it in expressions as simply as referencing [Deductible Days], however this is not working.
Any help?
I finally worked this out after much tinkering.
In my query I included the [Colleague Email] field as well as the [Days Requested] field, and then when my Application loads it navigates to a form created from the [Colleagues] table. I have modified the Data Source of the form to link the [Email] field in the query results to the [Email] field in the [Colleagues] form.
Following this I was able to create an unbound textbox with the data source =Sum([Days Requested]) referring to the relevant field in the query. Voila! I now have the value to play around with in my application.
Hope that helps, took a lot of fiddling around. No data macros needed after all, but its a method I shall remember in future, opens up a lot of possibilities.
If I understand your situation correctly, I was faced with a very similar problem.
I believe the solution used here will work for you. It involves using a query to Sum up the values (we would use Sum where he used Count), use a Data Macro to run the query and then have have an On Insert/On Update trigger the Data Macro:
http://devspoint.wordpress.com/2014/03/26/validating-data-with-data-macros-in-access-services-2013/
Let me know if this works for you. It worked for me!
I'm having a rough time creating an ms-access form for my client.
Here's the thing: every 3-4 years, my client receives a .pdf from the government and needs to insert that data into their database.
http://www.ntf.be/sites/default/files/media/coeffermageofficiels2011.pdf
This sheet gives, for a given period of time, per province and per geographic type, the value of the multiplier to apply to housings and agriculture rents. (hope this makes sense to you)
So a multiplier depends on 4 things: Date, Province, Geo Type and Rent Type
I have several tables:
Provinces (PK: Province ID)
Geo Types (PK: Geo Type ID)
Rent Types (PK: Rent Type ID)
Multipliers (PK: Multiplier ID, FK: Province ID, FK: Geo ID, FK: Rent ID, Multiplier Value, Effective Date)
What my client wants is a form that mimics this exact PDF, so that he can easily fill in the data whenever he gets the new multiplier values.
After unsuccessfully trying to use a crosstab query, and nested continuous forms to reproduce this, I can't think of a better solution to make a hard-coded form that will then perform all the inserts with hard-coded VB queries...
While I know how I could hard-code all this, I really wonder if there isn't another solution.
Any Idea?
I would create a "continuous forms" form that was bound to a temporary table with columns corresponding to those in the PDF file. The setup code (e.g., in Form Load, perhaps) could populate the temporary table with the required records for each Province/Region, and if the rates for the previous period were already in the database then it could plug in those values as well. The "Augm. %" fields could be calculated on-the-fly and serve as a visual data-entry validation check.
When the user had "filled in the blanks" then a "Save" button on the form header could use two Append queries to copy the new data into the appropriate tables: one for "Terres" and one for "Batiments".
There are a couple more options you could consider.
Option 1:
When I create forms I don't usually like them to be directly editable, at least not without some validation\user confirmation.
You could:
Set up the relevant queries to get the data into the pdf format.
Create a form based on these queries
When the user wants to edit\add data, put an event on the field (i.e. double click event) which could open a seperate little form or input box.
Allow them to input a new value and when they click ok, use a sub-procedure to lookup and write that new value to the relevant table\field.
Then, use the form repaint\requery so the user can directly see their update.
Option 2:
A different approach but maybe simpler and more flexible.
Create an Access report which replilcates the pdf.
This will look just as good as the pdf.
You could have a single input form (based on your own structure and not the pdf) where the user can input data
When they want to see the result, you could give them a command button which opens the report.
They could also print it out.