Sunday, January 29, 2012
Wednesday, November 9, 2011
Note: This will not work for EP, Services, direct BC.NET and cases using runas(), as the SecurityUtil::sysAdminMode is limited to the current session.
Ed Budrys from our Security team deserves the credit for the above.
Let me know if you found this to be useful.
Friday, October 28, 2011
As many of you have already seen in the new AX 2012 release, there are a lot more tables present in the application, because we went through an exercise of normalizing the data model.
Another feature that was added at the same time was the Table Inheritance, allowing to sub-class tables and add additional fields reusing some of the behaviors of the base table.
All of it is great! The only problem with it is that it comes at a price - we now need to retrieve a lot more data and do a lot more joins between tables. So we tried to mitigate that by using field lists where possible and adding AdHoc query support, which basically eliminates unneccessary joins between tables from the hierarchy, if fields from these tables are not selected.
We have also implemented a number of things that allow us to clearly see if the field was selected in the user interface, the APIs needed for doing the same, as well as special handling for invalid field access.
This tutorial contains a form, which showcases the different aspects of data access in cases described above.
You can download the project with the tutorial from my SkyDrive.
On the first tab, we have the standard "On hand" view, which in the data model is a join between InventSum and InventDim, with group by clauses on selected fields, in this case, ItemId from InventSum and InventLocationId from InventDim, and aggregation on the AvailPhysical column.
As you can see from the screenshot below, the rest of the InventDim fields are shown as Unretrieved. So, naturally, accessing one of them from code, for example, should not be a legal operation.
To verify that statement, there are 2 buttons on the form, the Incorrect and the Correct was of accessing the field. Clicking on the first one simply tries to read the value out of the InventSiteId field, while the second one uses the API method TableBuffer.isFieldDataRetrieved() to first verify if the field can actually be accessed.
Note, that in the below example, both buttons will work, as in, there won't be any errors shown to the user. When accessing the field, even though it is not retrieved to the client, the value will be treated as the default value for that type, that is, an empty string.
In order to verify that we do not access fields in an invalid way like above, we have introduced a parameter, that will throw an exception if a field that was not retrieved is being accessed.
In order to enable this validation, you need to update the below shown parameter in the Server configuration form (Located under System administration \ Setup \ System). After changing the value (note, that it is per AOS) you need to restart the AOS for the changes to take effect.
Now, if you try to use the first button (under Incorrect) from above, you will get a stack trace, notifying you that the specified field was not retrieved.
We suggest that when testing your modifications in the application, you always have that flag enabled, so as to avoid unpleasant and hard-to-find bugs later on in the production environment.
On the second tab of the Tutorial form, the same type of information is presented, only this time the output is actually based on a new table inheritance structure I created.
The base table, GenericBall, contains 2 characteristics of any ball. SoccerBall is extending it and adding an additional characteristic (for the sake of the example, let's assume Brand is only relevant to soccer balls). This is basically a very simple table inheritance structure.
In the form, however, I am only selecting to view the Brand field from SoccerBall, not selecting the other 2 fields from the base table. As expected, they show up as Unretrieved in the user interface.
However, there is one difference in how Scsc tables are handled - and that is, they will always throw an exception when you try to access one of the unretrieved fields.
The two buttons above the grid demonstrate that. Try it out, enabling/disabling the server configuration parameter shown above.
That's pretty much all there's to it. Let me know if you have any questions.
Now, I have one thing to ask you all too.
We in the AX Test team have done our best to find invalid field access problems before the release, but if you find one using the approach above, please log it either through the standard Microsoft channels (partner/ MsConnect/ etc.), or as a comment directly under this blog post.
Monday, October 24, 2011
There are 2 new methods that were added to the FormDataSource class, which allow you to very easily and error-free access the underlying QueryBuildDataSource, whether that is for the initial form query or for the queryRun that also contains user filters and sorting.
So, for example, instead of writing:
you can use the 2 new methods:
It might seem as a very minor improvement, but in reality it greatly simplifies maintenance of code on forms, when new datasources are added or existing ones removed/renamed.
That's all for today.
Thursday, October 20, 2011
Here it is, FY12Q1 already: Microsoft Reports Record First-Quarter Results $17.37 billion of revenue driven by solid business and consumer demand.. Wow, is that the longest, braggy release title we've ever had? Read it and you'll also discover that Bing has an organic line. In the Q&A session, Microsoft Management Discusses Q1 2012 Results - Earnings Call Transcript - Seeking Alpha, there was a lot of Qs about Skype and - news to me - we discover that $51 billion of our cash assets are kept offshore, to avoid taxes. Viva la 1%! (I kid).
(I'm out on the road so this will be short.)
My usual suspects:
- Mr. Jay Greene: Microsoft sees strong Office and flat Windows in quarter Microsoft - CNET News - "The company continues to generate mountains of cash. Even as it returned $2.7 billion to shareholders in the quarter, its cash hoard grew nearly $5 billion from June 30 to $57.4 billion."
- Mr. Joe Wilcox: Microsoft Q1 2012 by the numbers $17.37B revenue, $5.7B profit - on the flat Windows numbers: "Earth to Windows & Windows Live president Steven Sinofksy: You can't ship Windows 8 soon enough."
- Mr. Todd Bishop: Microsoft hits profit estimates, lifted by Office and servers - GeekWire and, more intriguing, Microsoft results show how iPad is cutting into Windows PCs - GeekWire
- Ms. Mary-Jo Foley: Microsoft earnings insights On-premises Office still has a lot of life left ZDNet
And a bonus view of OSD:
Sunday, October 9, 2011
It looks like I was re-inventing the wheel here.
Turns out that a tool doing exactly the same (and even invoked from the same place on Record info form) already exists and is called "Fill Utility". The problem is that it's disabled by default in the License configuration, so it not available.
More information about how to get it and what it does can be found in this MSDN article
During a recent customer visit we received a suggestion from the developers working on customizing the customer application to their needs. The suggestion was about being able to modify the value of a certain field on a form for multiple records at once.
As you know, in AX 2012, if we wanted to change a certain property for a number of entities (for example, update the default transfer order overdelivery allowence on a number of items at once), we would have to go through them one by one, which is time consuming and definitely not fun.
Using the small example I created we can in a simple and intuitive manner update the selected field value for all the marked records.
It looks something like this:
1. First, you multi-select the records where a certain field needs to be updated, and open the Record information for them
2. Then, you click Update, select the field that needs to be updated and put in the new value
3. After you confirm the changes, all the selected records will be updated with the new value.
Download the project from my SkyDrive
These aren't really issues, just things I did not spend time on.
- I did not develop the idea of selecting multiple fields to update at once. Might be a good idea. I just did not want to add more code into this little project. There's however a nice UI for selecting 1 or more fields in the DEV_SysTableBrowser project (link)
- I did not spend enough time trying to figure out the validation that should be in place for this. I figured, if people are gonna use it, they know what they are doing.
- The project is based on AX 2012. There's only 1 method with code, the rest is form controls. I figured it should be pretty easy to port this to other versions if needed.
Wednesday, September 21, 2011
(Note: updated below with follow-up comments.)
It's my most favorite time of the year: Friday the 23rd is the annual Microsoft Company Meeting!
That's right: I pull up my sleeves and thrust out my arms out wide and say, "Shove in the Kool-Aid IVs to the left and to the right and keep it flowing!" Man I love it. It is one of my favorite holidays of the year.
Reminder: when it comes to comments, share your internal-only content enthusiasm over on OfficeTalk (especially via the otalk WP7 app) vs. trying to put it here.
A Story of Steve, Steve, and Steven
This year is one of those inflection points: Apple has been soaring with its excellent device results, blowing Microsoft away and cannibalizing our Windows powered device market. The Microsoft stock is horribly flat and there are calls all-around for Ballmer to be replaced. Now, several things are in play: Mr. Jobs has stepped down due to his health reasons, WP Mango is reaching release with Nokia devices to begin their flow, and Windows 8 has demonstrated a reboot to the Windows experience and development platform. With Windows 8, Microsoft has emerged with the talking points that the company is being re-imagined.
All I can say is that SteveB should give SteveSi the CEO Bacon Achievement award: exceptional results that saved the CEO's bacon. Oh, SteveB had to be so happy to have Windows 8 revealed at BUILD right before the Financial Analysts Meeting. "How ya like me n-O-w?!?!" Actually, big chops to SteveSi who not only has done the impossible organizational wrangling between Win7 and Win8 (and wherever it is leading with Win8+) but also did such a smooth job with BUILD that some bloggers dared to pass the Steve Jobs torch to SteveSi. Wow. Didn't see that coming.
(psst. Board. CEO ma-ter-ial. Uh-huh. There you go. Not that I'd probably work in a SteveSi CEO Microsoft, but ya could do a lot worse!)
One thing I'd love to see SteveSi do: give the same level of support to writing Windows8 apps as Microsoft afforded its employees for Windows Phone. I'm not expecting him to, but if he did, I'd relish having my Spock-meets-Spartan view of him rebooted.
The Big Check-in - How Are Things Going
I expect that Mr. Turner will do the big picture for us. I like this comment regarding one point of view of how things are going for Microsoft:
There are certainly some issues at MSFT but some of the people that post in this blog are just over the top in their pessimism and whining.
As I see it right now, the good, bad, and ugly of MSFT are:
- XBOX Kinect blew it away this past Holiday, over 35M customers now pay for the priviledge of XBox Live
- The enterprise business is strong, committed revenue is higher than it's ever been (MSFT has a global enterprise business that is really unmatched by anyone
- Office365 and Dynamics both are rapidly growing businesses with a ton of upside
- MSFT now has 11 distinct businesses that do over $1B in revenue - I can think of maybe one or two other businesses on the planet (GE, etc) that can say the same
- Largely because of this diverse portfolio of businesses, MSFT was able to grow revenue, operating income, and net income in spite of *declining* PC sales (MSFT is not a one-trick pony any longer, if it ever was)
- Even with weakness in the PC market the past couple of quarters, it's hard to argue with the success of Windows 7 with over 400M licenses sold
- MSFT's Cloud offerings collectively are second to none
- Bing has a long ways to go but has actually made some progress in the US search market against Google, which was once thought impossible
- As an employee, unless you are a bottom 20% performer, the new comp plan is a win. If you don't think so, then you don't really understand the change
- Say what you will about Ballmer, there are some senior execs at MSFT that are truly outstanding. Mattrick, Satya, KT, Qi Lu, PK, Lisa B - you won't find anyone better than these folks anywhere
- The Nokia partnership will be instrumental in getting a WP7 device in a lot of people's hands
- As mentioned, PC sales actually declined in Q4
- MSFT still hasn't figured out a way to win in India or China and doesn't seem to have a cohesive strategy for emerging markets
- WP7 is a good product but as others have alluded to, MSFT is way late to the party in terms of highly functional / attractive UI / rich app eco-system smartphones. The Nokia deal only allows MSFT some hope at playing catch-up at this point
- Employees will soon have to pay a contribution (and deductibles) for health care (thank you very much ObamaCare and the Cadillac Tax for bringing that to us)
- Although there are talented people still there, a lot of talented folks have left MSFT senior leadership in the past 18 months or so - Liddell, Elop, Muglia, Bach, etc, etc. Although Elop was instrumental in getting the Nokia deal up and going
- AAPL sold 20M iPhones and over 9M iPads in a quarter. In. A. Quarter. Let that sink in a moment
- While MSFT has plenty of other viable businesses, none is as profitable nor as core strategically as Windows. Windows was once an impenetrable fortress, but in the past year, AAPL has penetrated it with a single product launch. MSFT is destined to play catch-up in slates, and it sounds like nothing serious is coming out until Windows 8 in another 12 to 15 months (maybe)
- MSFT is still very strong in the enterprise but to the consumer, MSFT seems completely dead. MSFT has no consumer mindshare any longer
- Yes, there are some interesting possibilities with Skype and Lync and XBox (etc), but it is still not at all clear that shareholders will reap anything close to $8.5B of value
- GOOG still dominates search in the US and will for the foreseeable future. And their dominance is even greater internationally
- OSD as an org continues to bleed money and will continue to do so for at least another couple of years
There it is, from a high-performing L63 employee in a broad-based business role, trying to lay things out in a truly fair and balanced manner. Take it or leave it.
I'm glad to see The Cloud in the somebody's Win column. When it comes to the Company Meeting, I personally am dreading anything that can be in the least bit tangled up with... sigh... THE CLOUD. Two things lost my respect to this force-fed-bubble-gum-on-my-shoe initiative: first, that using our cloud services is Alpha-Geek hostile: sorry, but there should have been upfront a free tinkering environment to go and write a whole bunch of real fun, heavy computational code. Second, that we started to slap THE CLOUD on crazy crap like home PC image editing.
So, I don't know, smuggle in a bunch of tequila and limes and whenever THE CLOUD comes up take another hit. That will at least make it palatable... in a numb, doesn't-seem-to-hurt-quite-like-it-did sort of way.
The New Review System and Hiring
Yeah, I think there's zero chance the Senior Leadership Team will go into much depth here. "Cheer if you like the new review system! ... Okay, there's 40% of you. How about the rest? Give me a 'Whoo?'" Want to wade in it? Pour yourself a three fingers of bourbon (and keep the bottle handy) and go through all the comments in the Mini-Microsoft Microsoft Annual Review 2011 post. 1,200 comments at this point. Whew.
Strict stack ranking on a fixed curve is a tool brought in for a purpose that didn't exist in the previous review system. Having LisaB take a break from her sabbatical (and, btw, what happens to most people after their sabbatical?) to tell us it's being done because employees felt that the old review system was too complex is a load of greasy smoke up the keister.
I look at this system and, stepping back, it makes sense if you're preparing to do some major organizational slimming over, say, a three year period. For instance, if SteveB where going to leave, I imagine before he goes he would cut back huge parts of Microsoft versus leaving that task to the new CEO, who might make radically bad cut-back decisions (from the former CEO's point of view). Better to give over to the new leader a starving company ready to grow versus a fat pig you've got to go all Neutron-Jack on. Three more years. Three more years to drive down until today's lower 3s are FY2014's 5s.
Depending on who is being forced out or leaving, too, the new system might help with the Young up Microsoft initiative I hear whispers of.
Didn't like your review? Ah, come on. You know when Ballmer runs around the field you're going to scream and shout (though, given the last Ballmer memo's authorship, maybe we'll see Frank Shaw run around first to warm things up). You're going to stand up. You're going to put aside all the depressing thoughts of those golden handcuffs never unfolding into a sparkling world of wonderment and retirement. You've got a job, a colorful CEO, perhaps a nice raise, and a company holiday to find out what's going on and to have some free grub with your work buds. Compared to 99% of the rest of the world right now, it's worth swigging the Kool-Aid for at least one day and cheering.
There's always the rest of the year for everything else.
Updated: impressions and follow-up
Overall: a very competent Microsoft Company Meeting. Polite applause. "Pip pip."
Other than the occasional video (heh heh, Inception) and the first one or two Train Dances, it was a low-on-humor meeting, for me. Everyone wondered if we were having a host this year. Hey, it was LisaB. Competent (and probably didn't piss people off like last year).
This year was demo-rama. I think the demos were good, it's just I had seen so much of everything being presented that there weren't too many surprises for me. I loved the fact that SteveSi ran one of his demos and then pointed out that everything he had just done was on an ARM slate. I regret how much money we're pouring into OSD (who pointed out that they are quite frugal - uh-huh) but I agree with a lot of what they are doing: they are not trying to out-Google-Google. They're Bing'ing Google upside the head. Go, Cosmos, go!
As for Mr. Ballmer: it was a surprise that he didn't come running and screaming out but rather had a surrogate fly around like a chimp on crack dusted with meth. Mr. Ballmer seemed more subdued this year. Love for Ballmer? People still stood up and cheered and clapped for him. Now then: someone please tell him, regarding his analogy of himself and Elop and Windows Phone sticking together, how Butch Cassidy and the Sundance Kid ended. Yeah, they were together alright, but the result was a little bit different than jumping off a cliff into a river.
As for people leaving (as some of the tech bloggers have picked up): yeah, people were streaming out. In small numbers. No where near as bad as BillG's last company meeting where Ballmer started screaming at people to sit down. And, well, yes, I was one of those folks who wandered to the upper portion of the seats while Mr. Ballmer passed on his coachie wisdom from Friday Night Lights (BTW, I prefer coach John Wooden). I suppose if Microsoft had been serving beer and snacks after the meeting I would have managed to stay in my seat.
So for me: technically well executed. Pip pip. I feel good about what Microsoft has wrought and how many of the things we're doing are exactly the kind of big, cross-group bets folks used to complain how we never do. The Imagine Cup winners were great to see. Pip pip. As for the meeting... I'd like a little culture, too. Maybe less inspirational videos. And more crazy. Not burping game crazy or Craig Mundie dazed-crazy, but show we have some pizzazz... with less explosive volume. And I'm fine with a box lunch if it means I don't have to stand in an infernal line to get a luke-warm burger melded to its bun.