Lookup Values for VendorInvoiceReviewStatus For Vendor Invoice - lookup-tables

I've just joined an organisation that is using Dynamics 365 Finance and Operations as a SSRS report developer.
Data from the Dynamics 365 system are pushed by way of bespoke data entities to an Azure SQL Database. It's from the Azure SQL db that I am querying the tables to produce reports.
One of the reports I am writing is referencing the [VendorInvoiceReviewStatus] column and this holds integer values. There isn't a lookup table that I can join to select related Text values ti display in the report.
The contractor the was brought in to deploy this system has long gone and the users left behind know how to use the system from a functional perspective. I was told the contractor was able to delve into the "code" to look up these values and create a bespoke lookup table. Now that's he's no longer around I am stuck.
I am hoping these values are standard and someone can tell what they are or point me to an article that tells me.

In Dynamics 365 applications:- May it be Dynamics crm or Dynamics 365 Finance and Operations, Option Sets are combination of Integer Value and Text (Label).
You wish to get Label of this particular Field.
What you could do is Go to Dynamics 365 Finance and Operations application, Go to particular Entity where this field is part of and you could see Text for Integer Value.
Please find below Option Set from Dynamics CRM. This will give you Idea where to look for.

Related

How can I determine if a row has changed?

I'm building a data warehouse for a client where one of the sources of data is a Dynamics AX database. For a given AX table I need to determine if a row has been inserted, modified or deleted, so it can be inserted, updated or deleted in the DW.
With regards to detecting a row having been modified, there appears to be two columns in most AX tables I could use for this purpose, ModifiedDateTime and RecVersion. I have two questions related to these columns:
1) Is the ModifiedDateTime column updated each time a row is updated? If so, is this value updated even if someone updates a row directly in the table, outside of an AX application (such as from a tool like SSMS)?
2) Same questions as above for RecVersion. Also, is the number globally unique across the entire database or just unique for the table?
Is there another alternative I'm not aware of to do what I want to do?
You want to use fields RecId and RecVersion, which are available in all business data tables of AX 2012. RecId is a unique value for each record of a table. RecVersion is 1 after a record has been created and is changed to some number other than 1 everytime the record is changed.
ModifiedDateTime is not a good choice, because it is not available on all tables.
Regarding you question if one of those fields is updated when someone modifies data directly in the AX business database: The answer is no and this is one of the reasons why you absolutely never should do such a thing. Honestly, I've seen several customers crash that did this against the explicit recommendations of their implementation partners. Dynamics AX offers several options to integrate data from other systems, use them and don't try to invent your own.
Regarding your question if RecVersion is globally unique: No. You can use a combination of TableId and RecId to uniquelly identify a record in the AX business database.
As I mentioned in my answer to your question How do I get the location for a row in dbo.CUSTTRANS?, AX comes with a data mart and also has some logic on how to update that based on changes in the business data. I'm not familiar with the details of those updates, but it might be worthwhile investigating them to see if you could reuse them for your purposes.
Some parts of AX 2012 use SQL Server Change Tracking under the hood (e.g. AIF).
Change tracking records deleted record as well, which neither ModifiedDateTime nor RecVersion fields can give you.

Time dependent Master data via History tables in SAP HANA

I was looking for the best way to capture historical data in HANA for master data tables without the VALID_TO and VALID_FROM fields.
From my understanding, we have 2 options here.
Create a custom history table and run a stored procedure that populates this history table from the original table. Here we compromise with the real-time reporting capability on top of this table.
Enable the History table flag in SLT for this table so that SLT creates this as a history table which solves this problem.
Option 2 looks like a clear winner to me but I would like your thoughts on this as well.
Let me know.
Thanks,
Shyam
You asked for thoughts...
I would not use history tables for modeling time dependent master data. That's not the way history tables work. Think of them as system versioned temporal tables using commit IDs for the validity range. There are several posts on this topic in the SAP community.
Most applications I know need application time validity ranges instead (or sometimes both). Therefore I would rather model the time dependency explicitly using valid from / valid to. This gives you the opportunity e.g. to model temporal joins in CalcViews or query the data using "standard" SQL. The different ETL tools like EIM SDI or BODS have also options for populating such time dependent tables using special transformations like "table comparison" or "history preserving". Just search the web for "slowly changing dimensions" for the concepts.
In the future maybe temporal tables as defined in SQL 2011 could be an option as well, but I do not know when those will be available in HANA.

Automatic row deletion in SQL Server 2008

I am developing library management system in ASP.NET. I am using SQL Server 2008 as database. I want to provide book reservation option so that student can reserve book for 15 minutes.
I am storing details of reserve books in the reserve table but I want to automatically delete those rows with a reservation time beyond 15 minutes.
Please help me.
If you have the option of changing the table structure I would. Without seeing the overall design I would suggest adding a "Status" column on the reserve table. The status column could contain on of the known statuses. Reserved, Pickedup, Returned, Never used. Create a SQL Agent job that queries the table for "reserved" records, if the create date is older than 15 minutes, change status to "Never Used" If you really want design it properly, you will want to add a Statuses table, then create a foreign key between the two tables. If you want to go down the path of the 2 tables and not sure how to do that let me know I can post a SQLFiddle example.

How can I design these business objects for querying and reporting?

I need some help thinking about the design for my business objects.
Our database records the daily entry and exit times for the comings and goings of the employees in our company. Each record also stores the UserID of the employee, the ID of the work station the employee signed in at and obviously the date.
A user can have many Entry and Exit times at any number of work stations at any given date.
The record looks something like this:
SignInID | UserID | WorkStationID | DateTimeEntry | DateTimeExit
I have a reportviewer on my asp.net form that must display reports of this entry and exit data grouped by date, work station or user.
For example it must display all data for a specific date (and within that, ordered by work station).
Or it must display all data for a given work station (and within that, ordered by date) and other similar formats.
Until now I had a monstrosity of a method where I selected the data and constructed some kind of makeshift datatable to display on my form.
I now want to redesign using objects, but I don't know how to design the hierarchy i.e. what object contains the collection of entry and exit times, and how to I make it flexible enough that I can query it (using Linq, perhaps?) based on the various display criteria?
I'm really interested in learning more about designing objects and using the correct terminology for what I'm trying to do, so if you can point me to some articles explaining these concepts it would be very helpful too.
EDIT: Okay, at least I've learned something new. What I'm trying to do is ORM - Object-relational mapping - and .NET has an inbuilt ORM tool called Entity Framework. So far so good. Now I have to see whether it can help me figure out how to organize my data.
Well, I actually have to thank the community for not answering my question, because I got to learn a lot about Entity Framework, Linq (and its limitations with Entity Framework in .NET 3.5) and a whole bunch of other things to answer my own question.
What I ended up doing was create an Entity Model of my Database using Entity Framework and thus created the Business Objects I needed to organize my data. I learned that my data isn't designed in a hierarchy, rather there are associations such as Workstation and User that each time entry records contains. I used a Linq-to-Entities query to select the data I wanted and flattened it out using its associations (example Time.Workstation.Name or Time.User.FullName) so that in the end, my projected object contained all the data I wanted in each row of my report. My projected object was actually a POCO I created for the purpose of holding the queried data and making it available as a datasource for my rdlc report.
Finally I bound the results of my query to a Reportviewer's ObjectDataSource which connects to the rdlc file that I was able to define to my liking: i.e. Either displaying the Workstation first or the User, or whatever associated information I wanted to display.

Microsoft Lightswitch and Entity Framework Code First Inconsistency

I've begun investigating Microsoft Lightswitch 2011 as a possible solution for developing quick "admin" apps for updating various databases - primarily those containing lookup tables or configuration data for internal corporate websites or applications.
I have a website that was developed using ASP.NET MVC. EF Code First was used in building out the data layer. Some of the relationships are many-to-many which EF CF handles by creating a join table with just two fields containing the primary keys of the two tables involved in the relationship. The primary key of the join table is combination of the two fields. For example, a document entity can have many categories and a category can consist of many documents. Three tables get created: Documents, Categories, and DocumentCategories. DocumentCategories only has two columns: DocumentID and CategoryID.
When this database is attached to Lightswitch as an external database, and a master-detail screen is created for the Documents table (and showing the related Categories), data can be deleted from and added to the related table (the join table) but not modified.
Investigation revealed that Lightswitch requires a join table in a many-to-many relationship to have its own primary key that is not a concatenation of the keys of the related tables. In other words the table must be of the format: DocumentCategoryID, DocumentID, CategoryID. If the join table is structured that way, it becomes possible to update the entries in the related table.
I know that I can work-around this by not updating records and simply deleting and re-adding them. That's not a big deal since 1) Lightswitch makes that easy, and 2) there's usually not wholesale changes in the related data. It goes against my sensibilities though of "what's right".
So at the risk of providing fodder for all the Microsoft tool haters, 1) is this just a case of Microsoft making a mistake and not being consistent or is there some other force at work here, and 2) is there a way to "fix" this without having to rework my ASP.NET MVC, EF CF app and changing the database structure?
1) LightSwitch works. Yes there are 'haters' but then there were haters when nail guns came out ( http://jhurst.blogspot.com/2011/01/nail-gun-or-hand-nail-your-roof-which.html ) The end user who is paying for our services will demand that we use tools that can reduce costs by 90%+
2) Using WCF RIA Services allows you to place a layer between whatever you have going on in your data layer and LightSwitch (see: http://lightswitchhelpwebsite.com/Blog/tabid/61/tagid/21/WCF-RIA-Service.aspx ) Only use the 'data source wizard' when it works for you. If it gives you any problems then a WCF RIA Service, that will only take you 5 minutes to code up, will resolve any situation because you are able to drop into procedural code to handle any transform you need.

Resources