Conditional field value in Access 2007 - ms-access-2010

I created a database to keep track of customer service related follow-ups in a call centre environment.
My table has, among the others, a Date created field, a Due date field and a Status field (Open, Due or Overdue).
I would like the value indicated in the Status field to update automatically as time elapses.
Can this be achieved and how?

This is absolutely possible. Why not? I would suggest you do the following:
(1) add another status to the status field called 'closed'
(2) determine from a logorithmic perspective what 'Due' means (e.g. if the current date falls within 5 days of your due date
(3) Write a query which updates your status either 'due' or 'overdue' depending on what the current date is

UPDATE tblDue SET tblDue.Status = "Due"
WHERE (((tblDue.DueDate)=Now()));
UPDATE tblDue SET tblDue.Status = "Overdue"
WHERE (((tblDue.DueDate)>Now()));

Related

DynamoDBVersionAttribute for a frequency field

I have a DDB table, 4 attributes, key (PK - a string), date (sort/range key), status, frequency.
I have multiple clients that will write to this table based on the 'key' and date value
I want to increment frequency every time a client makes a write.
Can I just use DynamoDBVersionAttribute on an int field and use this as a proxy for frequency?
I understand this is not meant for this use case, but I want to avoid having to first read and then write the item. Any thoughts?
Since you're already doing an update expression, just add an ADD action to increment the frequency by 1. The ADD action doesn't need to know the original value to increment it.
See the example from the docs here:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET.IncrementAndDecrement

How to forced my PackingSlipId by code in CustPackingSlipJour?

I'm creating SalesTable and SalesLine, and after I call this function,
SalesFormLetter_PackingSlip = SalesFormLetter::construct(DocumentStatus::PackingSlip);
SalesFormLetter_PackingSlip.parmId(MYTABLE.MYPackingSlipId);
SalesFormLetter_PackingSlip.update(SalesTable,M_MYTABLE.DocumentDate,SalesUpdate::All);
But when creating the CustPackingSlipJour it set the sales order status to Delivered, but the field CustPackingSlipJour.PackingSlipId is set by a NumberSequence.
I set Manual the Number Sequence, but nothing work.
Is it possible to Pick order and set the PackingSlipId with my value?
The packing slip id of the sales order is set by AX using a number sequence.
You will need a customization, if you want change that.

Dynamodb data model for process/transaction monitoring

I am wanting to keep track of multi stage processing job.
Likely just need the following fields
batchId (guid) | eventId (guid) | statusId (int) | timestamp | message (string)
There are relatively small number of events per batch.
I want to be able to easily query events that have a statusId less than n (still being processed or didn't finish processing).
Would using multiple rows for each status change, and querying for latest status be the best approach? I would use global secondary index but StatusId does not seem like a good candidate for hashkey (less than 10 statuses).
Instead of using multiple rows for every status change, if you updated the same event row instead, you could use a technique described in the DynamoDB documentation in the section 'Use a Calculated Value'. Basically this would involve adding another attribute (say 'derivedStatusId') which would be derived by appending a random number to statusId at the time of writing to DynamoDB. For example, for a statusId of 2, derivedStatusId could be one of {"2-00", "2-01", .. "2-99"}. Setting up a Global Secondary Index on derivedStatusId would give you some fan-out that will help in preventing the index from becoming hot.
If you are sure that you will use this index for only unfinished events, then removing the derivedStatusId attribute from the record when it transitions to a finished status will remove it from index as well - which may be a good property if events are expected to finish processing eventually, and if they stay around forever. This technique is called "Sparse Index" and is described in more detail here.
From your question, it seems like keeping status history recording is a desired property (I assume this because you want to have multiple rows for status changes). Consider putting this historical information in the same row. DynamoDB supports list data types and also has a generous 400KB item limit which may just allow you to capture all the desired historical information in the same record.

Microsoft Dynamics AX 2012 - Purchase Price

I've been instructed to create a customization on how the Unit Price (Purchline.PurchPrice) is calculated.
Right now when I'm creating a new purchase order and select an item, it simply pulls from the pricing from the released products for that particular item.
For my customization, I'm going to be using 3 variables to determine the pricing.
1: ItemId
2: Current Session Date
3: Customized Field in the Purchase Header
As such, I'll need access to purchline for the ItemId on the current line, and access to purchtable to access my field in the header.
Right now there is a big process for how the pricing gets pulled from released products, how the system checks for discounts, etc.
My question is, can anyone suggest the best class/location to check and modify where my final PurchPrice field gets set and inserted into purchline?
I need this to be basically the last part of the process of how this PurchPrice gets calculated. I've looked around in the PriceDisc & PriceConvert classes, SalesPurchLine map, the modified method of the ItemId field of the form.
AxPurchline doesn't seem to be triggering at all when I put breakpoints in them and create new purchase order lines.
Any help, insight or advice on where it would be the best to make logic changes for the PurchPrice field would be greatly appreciated.
Thanks in advance!
The table Purchline actually has a method called setPriceDisc where the price agreement is set and the line amount is adjusted.
This seems to be the last place where PurchLine.PurchPrice is set.

How to put a countdown in a table using asp.net code?

Let's say I have a table called adverts with the following fields: advert_id, name,date_created description, duration, status, user_id, cat_id.
Let's say a user puts a duration of 1 week in the duration field and its status is set to active. After a week has passed, the status is set to inactive in the table.
Can anyone tell me if it's possible to do this with asp.net 4.0 code using visual basic in visual studio 2010 with web forms?
I don't see a reason to update a status at all. Instead of (or in addition to) duration, store the datetime the status is to be set to active (current datetime plus duration). The application can then consider values less than the current datetime as active without having to actually update the row.
If desired, you can still derive the active status as a column the query or as a derived column in the table. For example:
SELECT CASE WHEN active_date <= GETDATE() THEN 'Y' ELSE 'N' END AS active
FROM dbo.adverts;

Resources