tag:blogger.com,1999:blog-79580756160640099462024-03-17T21:19:35.555-07:00Dynamics AX blogPriyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-7958075616064009946.post-3143954902616920342017-06-06T20:06:00.000-07:002017-10-24T18:21:36.750-07:00Summary of new features in the latest platform updates of Microsoft Dynamics 365 for finance and operations enterprise edition (formerly known as Dynamics AX)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-size: 11pt;">A quick summary of
new features in the latest platform updates of Microsoft Dynamics 365 for finance and operations enterprise edition (formerly known as Dynamics AX)</span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-size: 11pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1h_DhzP6SNP9xqPPbZO3QcMnsrW-n1r7WYFrEWE1R5SD0Vgsng0arH4mIOxUlw_XPgeFcENUmKkg_fylX2DHmZfTaebHYT-NFB8zJfqcgmS4mNc6UIwOTBvuwUgJZ0zIQoDubxIqK8qI/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="170" data-original-width="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1h_DhzP6SNP9xqPPbZO3QcMnsrW-n1r7WYFrEWE1R5SD0Vgsng0arH4mIOxUlw_XPgeFcENUmKkg_fylX2DHmZfTaebHYT-NFB8zJfqcgmS4mNc6UIwOTBvuwUgJZ0zIQoDubxIqK8qI/s1600/1.png" /></a></div>
<div style="font-size: 11pt; margin: 0in;">
<div style="font-family: Calibri; font-size: 11pt; margin: 0in 0in 0in 0.375in;">
<b style="font-size: 11pt;">Platform update 11 (Oct - 2017)</b></div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">
<br /></div>
<div style="font-family: calibri;">
<span style="font-size: 11pt;">
</span></div>
<ul style="direction: ltr; font-family: calibri; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Attachment presence and
document count indicator.When viewing a record, the system will indicate
the number of attachments on that record by showing a count on the
Attachments button. </span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">The system logs when a user
signs in or out of the application.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Bring your own data store
(BYOD) is a feature that’s used by customers to integrate data from
Finance and Operations with existing data warehouses.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">The metadata properties,
Operational domain and Subscriber access level have been added for tables,
views, data entities, menu items, and service operations. The new metadata
properties are needed to support Cloud and Edge deployments, and are
visible in Microsoft Visual Studio. </span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Copy data to new entities -
As new companies are needed, users will be able to save time and potential
errors by copying an existing legal entity’s setup to the new company.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Development and customization
- Field groups - Extension of another extension supported. All fields are
recognized and rendered at runtime by the user interface if there are
multiple extensions of table with same field groups.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">You can now use class
extensions (table class extensions) to define display and edit methods.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">When you extend a table and
add a new field to the table extension, if the new field is of type EDT
that is an array, you can now access EDT array fields from X++ code.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;"> If the EDT element you are extending has
the property Number of Decimals is Extensible set to True, you can create
an extension of this EDT and modify the No of Decimals property.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">The framework has been
extended to better handle scenarios where reporting sessions produce
multiple documents for download. Instead of receiving multiple documents,
one after another, the documents will be packaged and downloaded in a
single .zip file.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Resource governor uses the
built-in resource governance services offered by SQL Azure database.
Dynamics 365 for Finance and Operations Runtime service allocates quotas
for interactive, as well as batch processes, so that SQL Azure database
(where most of the compute is performed) does not degrade if there are
sudden compute spikes.</span></li>
</ul>
<div>
<span style="font-family: "calibri";"><br /></span></div>
<div>
<span style="font-family: "calibri"; font-size: 14.6667px;">For details refer - </span><a href="https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-11" style="font-family: Calibri; font-size: 14.6667px;">https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-11</a></div>
<div>
<br /></div>
</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b><br /></b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b>Platform update 10 (Aug - 2017)</b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
</div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Browser client - Net Promoter
Score integration. This feature will periodically prompt the user to
provide feedback and rank their satisfaction with Dynamics 365 for Finance
and Operations, Enterprise edition.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Key sequences are now
supported. A key sequence allows a particular action to be triggered by
pressing two key combinations sequentially</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">This release introduces a new
model for creating and maintaining mobile workspaces through X++ classes
in Microsoft Visual Studio.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Make users more productive
when using the Excel add-in to create and edit transactional data, by
allowing the creation of header records in addition to line records.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b><br /></b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-size: 14.6667px;">For details refer : </span><a href="https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-10" style="font-size: 14.6667px;">https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-10</a></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b><br /></b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b>Platform update 9 (July 2017)</b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
</div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Batch job history clean-up.
Functionality to clean up the history of batch jobs has been added (this
functionality was available in Dynamics AX 2012). This feature allows you
to delete all or any subset of batch job history by clicking a button. </span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Usage data is automatically
reset upon moving to Platform update 9. Users will lose their usage data
as part of this platform update process. This mostly includes data used
for custom queries and saved dialog posting selections. Personalization is
not affected.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Method wrapping and chain of
command - Allow developers to wrap logic around methods defined in a base
class. This allows extending the logic of public and protected methods
without the need to use event handlers. When you wrap a method, you can
also access other public and protected methods and variables of the class.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">OData batch request size
configuration- The default OData batch request size is 1,000 records.
Microsoft can now change the size of OData batch requests for customers.
Customers must log a support request through LCS to the Dynamics Service
Engineering team (DSE) to increase the batch size up to a maximum value of
5,000 records.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b><br /></b></div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">
For details refer : <a href="https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-9">https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-9</a></div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b>Platform Update 8 (June 2017)</b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<br />
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Changing the extended data
type (EDT) on a table field using table extensions</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Enhanced viewing experience
while interacting with both document and analytical style application
reports</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">The table browser form is now
in read-only mode on runtime environments (Sandbox Tier-2 and Production).</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Highlight - On premises
deployment option. A new deployment option that will not require business
data to be stored in the cloud. This deployment option supports running
your business processes on-premises, supporting local transactions and
storage of local business data, without replication of your business data
to the Microsoft cloud.</span> </li>
</ul>
</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">
For details refer: <a href="https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-8" style="font-size: 11pt;">https://docs.microsoft.com/en-us/dynamics365/unified-operations/fin-and-ops/get-started/whats-new-platform-update-8</a></div>
<b><br /></b>
<b>Platform update 7
(May 2017) </b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Configuration data projects -
This feature provides an updated user interface to easily export
configuration data, and the ability to easily manage templates and
projects.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Static export to Excel limit
increase from 2k to 10k - The static Export to Excel limit has been
increased from 2k to 10k to allow more rows to be exported from a grid</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Development tooling - New
tabbed workspace pattern - You can now include tab pages that house
embedded Power BI reports</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Development and customization
- Extending a group control - Support for extending an extended form, for
example, extending a form that is already extended in a referenced model</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Development and customization
- Extending the Country Region Codes property</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Development and customization
- Validating events on form data sources and form data source fields -
Validation events on form data source (FormDataSourceEventType) and form
data source fields (FormDataFieldEventType) now support invalidating
user-specified values.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
For details refer <a href="https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-7">https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-7</a></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b>Platform update 6
(April 2017) </b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b><br /></b></div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Ideas portal - With the Ideas
portal, all Dynamics 365 for Operations users can submit new ideas, vote
on existing ideas, and track status of their ideas in a consistent manner.
</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Browser framework - New
control for developers PowerApps
Host control. Dynamics 365 for Operations introduces a new control for
developers, the PowerApps Host control. </span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Browser client - Ability to
model toolbar actions in the overflow menu</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Build automation - Automatic
update of model version during build</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Build automation - Option to
include runtime packages in the deployable package of the automated build
output</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Number sequence scope
extensibility - You can now extend the number sequence scope through
extensions. </span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Mobile - ability to set
workspace visibility for different user groups</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Mobile - Added the ability to
auto detect required attributes, through form and table metadata, to
denote mobile fields as mandatory during data entry</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Mobile - Option to fully
localize mobile workspaces for all Dynamics 365 for Operations supported
languages.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
For details refer <a href="https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-6">https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-6</a></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b> </b><b style="font-size: 11pt;">Platform update 5
(March 2017)</b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b style="font-size: 11pt;"><br /></b></div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">EventHandlerResult classes in
request or response scenarios - You can now use the EventHandlerResult
class for scenarios where the delegate (event) logic requires its
subscribers (event handlers) to provide at least one response so that no
result is lost when there are multiple subscribers and multiple results.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Customization Analysis Report
(CAR) justification - When you suppress a best practice warning within a
suppression file in the AxIgnoreDiagnosticList folder of your model, and
include a justification, the justification text will appear in the CAR
report of your model.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Telemetry - When a model is
built, the telemetry framework collects information about Microsoft
classes and methods that are referenced by customer and ISV code. This
provides Microsoft with much needed information regarding what part of the
standard application code is included in backward compatibility
requirements</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">X++ compiler and try catch
blocks - DuplicateKey and UpdateConflict exceptions do not roll back a
running transaction, are no longer caught in the catch all.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Personalization - Enhanced
administration features for personalization.The personalization
administrator can now apply or remove form personalizations for groups of
users. Previously personalization administration was only possible one
user at a time.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
For details refer <a href="https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-5">https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-5</a></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<b>Platform update 4
(February 2017)</b></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<ul style="direction: ltr; margin-bottom: 0in; margin-left: .375in; margin-top: 0in; unicode-bidi: embed;" type="disc">
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Monthly updates: Dynamics 365 for operation releases moved to
monthly updates pattern.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Embedded Power BI reports are
licensed for all users: Additional functionality is available for users who have
Power BI Pro licenses.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Build and release workspaces
that have embedded Power BI reports: You can build and release workspaces
that have embedded Power BI reports, to provide interactive and visually
engaging experiences for users.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Mobility: Mobile framework is updated to build unique online and offline
experiences. Mobile framework also starts supporting iOS and Android devices.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Visual scheduling: MS updated
Gantt chart integration, added new visual icons, localized formats,
updated user efficiency, and improved resource management features.</span></li>
<li style="margin-bottom: 0; margin-top: 0; vertical-align: middle;"><span style="font-family: "calibri"; font-size: 11.0pt;">Feedback: You can provide
your feedback to Microsoft for improvements.</span></li>
</ul>
<div style="font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
For details refer <a href="https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-4">https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-platform-update-4</a></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;">
<br /></div>
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
For complete details
on what's new refer to <a href="https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-changed">https://docs.microsoft.com/en-au/dynamics365/operations/dev-itpro/get-started/whats-new-changed</a></div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com8tag:blogger.com,1999:blog-7958075616064009946.post-29694062986569138562016-11-01T03:24:00.000-07:002016-11-01T03:24:33.211-07:00Building and Consuming Data entities in Dynamics 365 for operations <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Data entities are new concept introduced in
Dynamics 365 for operations. The main purpose of data entities is to provide a
single platform for data management. Additionally they also provide foundation for the services framework. It also enables file integration and recurring integrations. </span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span> </div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Data entities replaces the AxD and DIXF frameworks of AX2012 and also
simplifies ALM process where we can create data packages and export import between
different environments.</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Below diagram shows how data entities provides platform for different scenarions.</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMDtxPmQYKY7l4LvnGyZj3thVhtUzQyX1eOiVvpCVPADiyDSp7pafwPPI8ghmX4yB8KXWnHU265IJcfFnHapfVWlHrfUBM8JcL3eNeNRiwkfEn6BSErNX00E-xLD_fClMnQ1nn7i8b5U/s1600/q.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMDtxPmQYKY7l4LvnGyZj3thVhtUzQyX1eOiVvpCVPADiyDSp7pafwPPI8ghmX4yB8KXWnHU265IJcfFnHapfVWlHrfUBM8JcL3eNeNRiwkfEn6BSErNX00E-xLD_fClMnQ1nn7i8b5U/s640/q.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><span style="font-family: "times new roman"; font-size: small;">
</span><br />
</span><br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><span style="font-family: "calibri" , sans-serif; font-size: 11pt;">You can think of data entities as updatable views to tables.Let's do a quick walkthrough on
developing and then exporting/importing data using<span style="mso-spacerun: yes;">
</span>data entity for a custom table.</span></span><br />
<span style="font-family: "calibri";"></span> </div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">
<span style="font-family: "times new roman"; font-size: small;">
</span><span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> To keep it simple I created a new table
with 2 fields, ID and Name. Remember to have unique index defined on the table
and use it as the primary index on the table. Below is the table structure:<o:p></o:p></span><br />
<br />
</span><div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL28oiFb4aWhZP-ouAQ9shzG5AtYR3taEfJk6VE6GfLj5OMiT7AtsDaCQV-IpOUrLhYBvoeLrYp2SolJRhNT1YH72Zf_Wi5lUJFjNHqPqBesGmKb0KmhfMhUnirQAW6qVuf_Bd-BRQLwg/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL28oiFb4aWhZP-ouAQ9shzG5AtYR3taEfJk6VE6GfLj5OMiT7AtsDaCQV-IpOUrLhYBvoeLrYp2SolJRhNT1YH72Zf_Wi5lUJFjNHqPqBesGmKb0KmhfMhUnirQAW6qVuf_Bd-BRQLwg/s1600/2.png" /></a></span></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">
<br />
<span style="font-family: "times new roman"; font-size: small;">
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6m_oLQClRp4pr7JUJjvyxNpdVrg3lCrv_jA_VSsEpfpNvfp066d2O3hV-T_-5Gg4i433OSOSwYHCkbwJnw2UfCgo5KzFUjL8t0r021co8Jj87E4UdMtVeju7zUyL8WnGVXasYJXuIB7I/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6m_oLQClRp4pr7JUJjvyxNpdVrg3lCrv_jA_VSsEpfpNvfp066d2O3hV-T_-5Gg4i433OSOSwYHCkbwJnw2UfCgo5KzFUjL8t0r021co8Jj87E4UdMtVeju7zUyL8WnGVXasYJXuIB7I/s1600/3.png" /></a></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> To create a data entity for this
table we can either using entity wizard by right clicking on the table and then selecting the AddIns option (as shown below)</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh76zMmSEEj2fqYcLCWE9Mi5zs5gKuulea1LB3Kq7U2GrasQ6-P6T0HnqeBMXYJQtJjXkvRt7UrnG0UZrrzKuw46KGjA0kNu5S6l9kk1MG3XZxxLqp89oWJo38nyn36ghDnj7cgF6IUArs/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh76zMmSEEj2fqYcLCWE9Mi5zs5gKuulea1LB3Kq7U2GrasQ6-P6T0HnqeBMXYJQtJjXkvRt7UrnG0UZrrzKuw46KGjA0kNu5S6l9kk1MG3XZxxLqp89oWJo38nyn36ghDnj7cgF6IUArs/s320/4.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">or by adding a new item of type data entity in the project. </span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Let's add it manually , select data entity on the add new item screen <o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkdDiruzf1mSX-nk4-opR0M6iElhPvdqKBj_TJDqLgovb_yjfRSloY53joAebdUMs67MfpujN3crOHeXefyMUkSZ-qsMUGupoP2Ed9qoK1lJOUVbzkcxHvnUTeFeA8R5ciUgKx0yy68s/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkdDiruzf1mSX-nk4-opR0M6iElhPvdqKBj_TJDqLgovb_yjfRSloY53joAebdUMs67MfpujN3crOHeXefyMUkSZ-qsMUGupoP2Ed9qoK1lJOUVbzkcxHvnUTeFeA8R5ciUgKx0yy68s/s400/5.png" width="400" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Select the primary data source, in this case
it will be our new table<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jRMgnxOyYwt3mNktMuYy_QmTMdANuji6l251BkQgA8qPiA5pI6mgLwM-Rf-rSmJnlgV5_EjF2dP42ro18CLAQAVqLIGP9pw_GS_V7Z9EbDVZt_rVBFLmbiExuzG2nYGsi-3bnxeoIE0/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jRMgnxOyYwt3mNktMuYy_QmTMdANuji6l251BkQgA8qPiA5pI6mgLwM-Rf-rSmJnlgV5_EjF2dP42ro18CLAQAVqLIGP9pw_GS_V7Z9EbDVZt_rVBFLmbiExuzG2nYGsi-3bnxeoIE0/s320/6.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">The entity category field is to tag the category
of the entity. It will help to filter the entity on the client.</span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">The check box to enable public API is used to
expose the entity via OData. If we turn it off then the entity will still be
available for data management platform but won't be accessible via OData.<o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> </span><span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> <o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">On the next page system will show the list of
all the fields in the table you have added . This screen is quite interesting
and important as you can setup your entity. <o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can uncheck some fields if we do not want
to expose, or make them mandatory even if they are not mandatory for tables. <o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> <o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can add more data sources if we want.
Let's leave it as is for now.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrVtF90oxDmil6IhN7CmgT22Pk0QZMWY8vtMuXREGVuo8pX0pHz3pJZPsruKhSf2xsR2zRLRyiGCyXGOOSMNBwUYKZ-Ri_3VC8jc8Z9vr7ewW30FndynpQ7KryLuFHG20qhdX_QL0Czsg/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrVtF90oxDmil6IhN7CmgT22Pk0QZMWY8vtMuXREGVuo8pX0pHz3pJZPsruKhSf2xsR2zRLRyiGCyXGOOSMNBwUYKZ-Ri_3VC8jc8Z9vr7ewW30FndynpQ7KryLuFHG20qhdX_QL0Czsg/s640/7.png" width="640" /></a></div>
<br />
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Once finished, system will create some
artifacts<span style="mso-spacerun: yes;"> </span>- A staging table, entity and
related security privileges. <o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOT-bY-OGwTbrA-P4MD32egjMwY0wtXUV750KUBtItDybJl_eKCSCfxOGA2ZB3zE3Qdd1MKhUWKRcboK0oVWx9sutuQko3sHaG2IRPaUv_xeLXagZF9iomZqreWTvnJKDmv3RkATGLPY/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOT-bY-OGwTbrA-P4MD32egjMwY0wtXUV750KUBtItDybJl_eKCSCfxOGA2ZB3zE3Qdd1MKhUWKRcboK0oVWx9sutuQko3sHaG2IRPaUv_xeLXagZF9iomZqreWTvnJKDmv3RkATGLPY/s1600/8.png" /></a></div>
<br />
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Staging table has some
system generated fields like the definition group, execution ID etc. <o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkNNLdVRHytbxaUhZ42lltF8GHwzxmkhcM7bSbpZhz8BoL8Q5VkigKzw277IJyLk_wjbunHSJsSQtPksFif-ZFn9jdXT_D1-JY1VgiIQNhC6IxM_ABgOy467iO0WJv6B8f2FHc40xQNzo/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkNNLdVRHytbxaUhZ42lltF8GHwzxmkhcM7bSbpZhz8BoL8Q5VkigKzw277IJyLk_wjbunHSJsSQtPksFif-ZFn9jdXT_D1-JY1VgiIQNhC6IxM_ABgOy467iO0WJv6B8f2FHc40xQNzo/s320/9.png" width="218" /></a></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Build the solution and synchronise
the table.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOybQe-kFrhZiqFg4Uwca8dtPIEvxTv5X0eaMd71S6Ept-BJbG79kYzVwJx8t9WTRUmdMH9i5TWmwSILAK0V52sUnkXe5UkknAjNm3gnm0n56OY5z3XhVVzfqYleDkYOvFxYu2bmuxA4k/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOybQe-kFrhZiqFg4Uwca8dtPIEvxTv5X0eaMd71S6Ept-BJbG79kYzVwJx8t9WTRUmdMH9i5TWmwSILAK0V52sUnkXe5UkknAjNm3gnm0n56OY5z3XhVVzfqYleDkYOvFxYu2bmuxA4k/s400/10.png" width="400" /></a></div>
<br />
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can now view the entity in the list of
entities available under data management workspace</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbejxH3sHogiOVgs3m1qE2SQ8568v0sGvQIQWw1hrsaT2lkryGgxvmZOXA_gBWrStJFJvBjvyzZGrRPc5b1O39S9G1wdWdsrOsK0H5I2SSW-5mHYJi3tzSe50wPVloPd4MY2PipMlOgxQ/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbejxH3sHogiOVgs3m1qE2SQ8568v0sGvQIQWw1hrsaT2lkryGgxvmZOXA_gBWrStJFJvBjvyzZGrRPc5b1O39S9G1wdWdsrOsK0H5I2SSW-5mHYJi3tzSe50wPVloPd4MY2PipMlOgxQ/s320/11.png" width="162" /></a></div>
<br />
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can filter the list <o:p></o:p></span></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8ZoxHSsFQc-5-tu0trZEulMYT3J9OAGwENPajjpjhzuweUpsR3jqkz-c3i2f-iLZIFJyzQOGeD9aU5cb_YSM8vy0x-xGfsKXcj6K1BWVVX172eQ-wo8i8wHaUnJpWoRC_t3_FknmOTu8/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="78" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8ZoxHSsFQc-5-tu0trZEulMYT3J9OAGwENPajjpjhzuweUpsR3jqkz-c3i2f-iLZIFJyzQOGeD9aU5cb_YSM8vy0x-xGfsKXcj6K1BWVVX172eQ-wo8i8wHaUnJpWoRC_t3_FknmOTu8/s640/12.png" width="640" /></a></div>
<br />
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can view the structure and mappings from
the options on the form <o:p></o:p></span><br />
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-iPAuGjS9H9_bHjlbR1mSeTt1pxtI_NkK5Fvl1dCggsO0iQAi4oobclmWcfRXe28dsvsOyDVfSmH7jcwOXz6Um_cWdM_NcgjD_zHsA6tFCeDhjiezU-1scESpsruHFwjhJlyzEEHEaU/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW-iPAuGjS9H9_bHjlbR1mSeTt1pxtI_NkK5Fvl1dCggsO0iQAi4oobclmWcfRXe28dsvsOyDVfSmH7jcwOXz6Um_cWdM_NcgjD_zHsA6tFCeDhjiezU-1scESpsruHFwjhJlyzEEHEaU/s400/13.png" width="400" /></a></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">So now we are done with creating a new entity
for a custom table. <o:p></o:p></span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Let's import some data in the table: I c</span><span style="font-family: "calibri" , sans-serif; font-size: 11pt;">reated a csv file with two fields and the
data as the entity structure is quite straightforward in this case</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8cWBZxdj8JI3dIZEaCesCwpvTChI-9XbGH_bKsCGksfCmvZIJuuKOwbTyTIrRjE4wCx7nTiZRZtNsutbVLJx92TbZRiE_x0XGbeDe03MJuddvytO1uyKXkKaNLmt1abeodjy_WrG_6Q/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8cWBZxdj8JI3dIZEaCesCwpvTChI-9XbGH_bKsCGksfCmvZIJuuKOwbTyTIrRjE4wCx7nTiZRZtNsutbVLJx92TbZRiE_x0XGbeDe03MJuddvytO1uyKXkKaNLmt1abeodjy_WrG_6Q/s320/14.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWgI3v5-gaJruENKNryd0h-StiLYSoi5t5NyZWEN1Nalqmn2LiRE2w9Iq1b299mbjKnNIT4kyNZtqFt2XS7-DYZcQ2bFjYbzK6wIsSNmKwq_EyiXMZyGDF_BAUEXH60V4LaDD5FSVg6mE/s1600/15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWgI3v5-gaJruENKNryd0h-StiLYSoi5t5NyZWEN1Nalqmn2LiRE2w9Iq1b299mbjKnNIT4kyNZtqFt2XS7-DYZcQ2bFjYbzK6wIsSNmKwq_EyiXMZyGDF_BAUEXH60V4LaDD5FSVg6mE/s320/15.png" width="300" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Enter the new import job details, select
format and entity name and then click on upload <o:p></o:p></span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrhPiwCre5N_VT73xoE8HqOO1JKYf_Mut6UQDg0njY926OSGmz-bRt3Xm_WlRX4PLuzSf5Dx1wO78a37dTQHKBcAex6oEHdVohpL0DWrdgXaxL17zhZnHErdmQejtPMeTcEmqDc2kxI4M/s1600/16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrhPiwCre5N_VT73xoE8HqOO1JKYf_Mut6UQDg0njY926OSGmz-bRt3Xm_WlRX4PLuzSf5Dx1wO78a37dTQHKBcAex6oEHdVohpL0DWrdgXaxL17zhZnHErdmQejtPMeTcEmqDc2kxI4M/s320/16.png" width="259" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Once you click on upload you can select the
csv file having data of your desired structure<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFRCN1SGF72VXibWWubJCRn9EQ8h4hRns81_K6zkATH-w5KCw2TfHxNoC_0Ig5EUmGuytyQVA6BEDuiBAZFtwMi8B0UeAkUsOHhYAlo0OP4FbgrdPIvFFhf2T4FWLF4aPTuyX7Pt12Uj8/s1600/17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFRCN1SGF72VXibWWubJCRn9EQ8h4hRns81_K6zkATH-w5KCw2TfHxNoC_0Ig5EUmGuytyQVA6BEDuiBAZFtwMi8B0UeAkUsOHhYAlo0OP4FbgrdPIvFFhf2T4FWLF4aPTuyX7Pt12Uj8/s400/17.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9dHMc8qNCSr3yRm54NR76o6k6pZ3k9kU6Ct7dw7boT5yRASXMt1BiExVUsOFDgCk6Eedizuc7_FHdQmpOWN8Q3_LKNHSWupwvQSa3PqVlILpNEVgpizbx9jeumnbWeVo4kQlMCRju3j0/s1600/18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9dHMc8qNCSr3yRm54NR76o6k6pZ3k9kU6Ct7dw7boT5yRASXMt1BiExVUsOFDgCk6Eedizuc7_FHdQmpOWN8Q3_LKNHSWupwvQSa3PqVlILpNEVgpizbx9jeumnbWeVo4kQlMCRju3j0/s400/18.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Click on Import and then we get the below
notification</span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGvkHfCgfmfpzgcbwyeJC3uNZzdgmzqjo747y0UvvsAnTO9JA2pdgdo3oY_LM5Qg7ITBTCNwj2HElvfi7WEmK5yjE-bmAlBFd8OWXUxSMVRsgRTUj8sV5gQevJK9sAi930-lenP98jcpI/s1600/19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGvkHfCgfmfpzgcbwyeJC3uNZzdgmzqjo747y0UvvsAnTO9JA2pdgdo3oY_LM5Qg7ITBTCNwj2HElvfi7WEmK5yjE-bmAlBFd8OWXUxSMVRsgRTUj8sV5gQevJK9sAi930-lenP98jcpI/s320/19.png" width="320" /></a></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can view the execution summary </span><br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><o:p></o:p></span> </div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><o:p></o:p></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLfQmGA64Tm67tQS6XQIsfL3D_JWlFG8Mxr167-l0C3AuXQX_1wmJW3qzfBKS7QaGb1ZxdmOGRuTghHmZTlpaExFqM2GBos4-Og7rCt3mkcJZS8la5n1OopqXli1Yr7lqcYEQcrX3OdFY/s1600/20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLfQmGA64Tm67tQS6XQIsfL3D_JWlFG8Mxr167-l0C3AuXQX_1wmJW3qzfBKS7QaGb1ZxdmOGRuTghHmZTlpaExFqM2GBos4-Og7rCt3mkcJZS8la5n1OopqXli1Yr7lqcYEQcrX3OdFY/s320/20.png" width="320" /></a></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Once the data is imported we can see the details
and the job status</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEvPALyc3zIha9FpQ4UIbzbhmTj5Rm8SSinjwxJBPgmSnlSGfHslplDwaOK-XVH5WxrtFNU9x4Yvrmpuav_UteDpNPuJcNgpsrgZ_fQFr-ZJlxcIVn86gFWNW1arREIhQ-iY4cMfn2QHc/s1600/21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEvPALyc3zIha9FpQ4UIbzbhmTj5Rm8SSinjwxJBPgmSnlSGfHslplDwaOK-XVH5WxrtFNU9x4Yvrmpuav_UteDpNPuJcNgpsrgZ_fQFr-ZJlxcIVn86gFWNW1arREIhQ-iY4cMfn2QHc/s640/21.png" width="640" /></a></div>
<br />
<br />
<br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">View the data with the help of
inquiry buttons on the form </span></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Woey41fIXhUgoc7ntRKAboMEZ0K5GsbKrXBlbm_oELWUo_xF71w0tPjThIrO5PHcJ50c6Yscy6wGRaeWj78kew27MTJYRCYz6fpFmfHIfXWTnxQAODbOfdNJsSJPOzeIcTYm8K8ZHoM/s1600/22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Woey41fIXhUgoc7ntRKAboMEZ0K5GsbKrXBlbm_oELWUo_xF71w0tPjThIrO5PHcJ50c6Yscy6wGRaeWj78kew27MTJYRCYz6fpFmfHIfXWTnxQAODbOfdNJsSJPOzeIcTYm8K8ZHoM/s320/22.png" width="320" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can browse the table and view the data as
well.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRu0sR0l0CLKg-Jwds4HY_WVFqjUYzRILuxxwB_CxNaLVzN2Nke4EpIDU0vwICE67KFHY_1PKjg8VN-R-CZrpNi3z8qbqqLmobh2x9dB_zkoNc9LS74aE337MFONnUt-katZvTMsiapk/s1600/23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRu0sR0l0CLKg-Jwds4HY_WVFqjUYzRILuxxwB_CxNaLVzN2Nke4EpIDU0vwICE67KFHY_1PKjg8VN-R-CZrpNi3z8qbqqLmobh2x9dB_zkoNc9LS74aE337MFONnUt-katZvTMsiapk/s400/23.png" width="400" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Lets
add new record and save it from table browser<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA4_WtgV8GakKCdBTXsvVmzjI44fXjoAuJGA3qSafekbGG3xoMjiZLR0mS_xQgn4iDVKs3OAR_L_WV9lJEp8QciYb9m3u-3GUUSQMC0i2n2SneBqtQ8uSBSMpxKJxcPKwShpoul-CtrK4/s1600/24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA4_WtgV8GakKCdBTXsvVmzjI44fXjoAuJGA3qSafekbGG3xoMjiZLR0mS_xQgn4iDVKs3OAR_L_WV9lJEp8QciYb9m3u-3GUUSQMC0i2n2SneBqtQ8uSBSMpxKJxcPKwShpoul-CtrK4/s400/24.png" width="400" /></a></div>
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><o:p></o:p></span> </div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br />
<br />
</span><br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> </span></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">
<o:p></o:p></span><div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"> </span></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br />
<div style="margin: 0cm 0cm 0pt;">
</div>
<div style="margin: 0cm 0cm 0pt;">
Now lets do a quick export of the data. First we c<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">reate an export job<o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0pt;">
</div>
<div style="margin: 0cm 0cm 0pt;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvwfiQMxtD-PPCQySLBKR4PKK1EGd61O9kKnTTw-vgb0SxO9DnHfHb6TuSdMruwkq-weHkzVLzEH1NnmlAtN1J42VnP0_yqoNAlZ-y81-S1G27uO_vpWgWrqr9UtFuYb3p42sb1OEyFNU/s1600/25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvwfiQMxtD-PPCQySLBKR4PKK1EGd61O9kKnTTw-vgb0SxO9DnHfHb6TuSdMruwkq-weHkzVLzEH1NnmlAtN1J42VnP0_yqoNAlZ-y81-S1G27uO_vpWgWrqr9UtFuYb3p42sb1OEyFNU/s320/25.png" width="269" /></a></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Click on Add entity after defining the data
format and the entity <o:p></o:p></span></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6FYTPRtYFU3xDhXLBkq5dxwAej278GFlb-BYqGg9EzIHtujD67nolXrkG5QsTdu78zY-Ael3qNDlUldmwiq5RdKKceXXRuWMmT4eaTvhhErJ2QGhZ5fIhEUdfDrXSgXDP9cXDDRZpQo/s1600/26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6FYTPRtYFU3xDhXLBkq5dxwAej278GFlb-BYqGg9EzIHtujD67nolXrkG5QsTdu78zY-Ael3qNDlUldmwiq5RdKKceXXRuWMmT4eaTvhhErJ2QGhZ5fIhEUdfDrXSgXDP9cXDDRZpQo/s320/26.png" width="320" /></a></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Once the mapping is done, click on export ,
the job is scheduled<o:p></o:p></span></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><div style="margin: 0cm 0cm 0pt;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3f-qEtnFGAB1wOAsxhNi4uc4z-vZCSHWoCyd7u5DV7tGQUSrYi53et3zGbvJpTpFHBZFh79w4lbhMcf245YK8GP6g1n2taeM3bofEzmLrNdAV-2YcmodFEB6EtzLw2mKHmU_5Q_Dkc88/s1600/27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3f-qEtnFGAB1wOAsxhNi4uc4z-vZCSHWoCyd7u5DV7tGQUSrYi53et3zGbvJpTpFHBZFh79w4lbhMcf245YK8GP6g1n2taeM3bofEzmLrNdAV-2YcmodFEB6EtzLw2mKHmU_5Q_Dkc88/s320/27.png" width="320" /></a></div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Once the job completes, we get a notification</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1LimSga_-Z_VzhrW2xGVh38IbZZ-T-V9zfs9V5slynSykS82XGGqvEV-MznTIdqi9Fi3l6UnQ7m4xK6K4RRbk-YAGvmhHkb1Gup2bwI0ADikN8FAfy9XVT5y-bxTGYZWIzGg2PN-DZC0/s1600/28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1LimSga_-Z_VzhrW2xGVh38IbZZ-T-V9zfs9V5slynSykS82XGGqvEV-MznTIdqi9Fi3l6UnQ7m4xK6K4RRbk-YAGvmhHkb1Gup2bwI0ADikN8FAfy9XVT5y-bxTGYZWIzGg2PN-DZC0/s1600/28.png" /></a></div>
<br />
<span style="font-family: "times new roman"; font-size: small;">
</span><br />
<div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can view the execution details <o:p></o:p></span></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUTcTM8AoyKBatKsNAuPzNP_871HUm1gz1BPy8ZGQqlHIQPaYgn9IqcjjE1_rkTrUUt5LndaqhjjzEEccVicUbJuJufYjpwUNmlCTKGzw5qiUX9CoubjaxVSBAJmIbLCBZs0HlI_3dxWQ/s1600/29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUTcTM8AoyKBatKsNAuPzNP_871HUm1gz1BPy8ZGQqlHIQPaYgn9IqcjjE1_rkTrUUt5LndaqhjjzEEccVicUbJuJufYjpwUNmlCTKGzw5qiUX9CoubjaxVSBAJmIbLCBZs0HlI_3dxWQ/s640/29.png" width="640" /></a></div>
<br />
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">We can also download the file created by the job
by clicking on the ellipse and download file<span style="mso-spacerun: yes;">
</span></span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><span style="mso-spacerun: yes;"></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMFNfSr8SNtdrwHA2qSco-jfPx2UtUc830RwG3Kkk5XMlic46m6JY1UEQ74_7TU9jR7wIGv5GBZWuBs28z5GQ-d6GECvv24IT0Iw34wGc1RsXmS_qYlgcvL02YtkjikGWK8k3vYn16AoQ/s1600/30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMFNfSr8SNtdrwHA2qSco-jfPx2UtUc830RwG3Kkk5XMlic46m6JY1UEQ74_7TU9jR7wIGv5GBZWuBs28z5GQ-d6GECvv24IT0Iw34wGc1RsXmS_qYlgcvL02YtkjikGWK8k3vYn16AoQ/s320/30.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUXE4n4vFERF_-LHg5p0gvWEch8wN1vodLHYm3lh5Uv07PS9gSSKlJTDKFozfCzc_0AhPcuQTgBHd86tHfOQV9MRCCFXYSTpvfZFhWOeVoUyBrRFLXE5bjINey_qaVkSnaJqc0fP_cU5A/s1600/31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUXE4n4vFERF_-LHg5p0gvWEch8wN1vodLHYm3lh5Uv07PS9gSSKlJTDKFozfCzc_0AhPcuQTgBHd86tHfOQV9MRCCFXYSTpvfZFhWOeVoUyBrRFLXE5bjINey_qaVkSnaJqc0fP_cU5A/s320/31.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">Open and view the file. We can see the new row
we added is exported</span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj2cmKJo3T8dyOYqTHK3celEYQgL4Rd1Owxs69ilqPShBuWz4O1sgGhpC6dJADawPNHmmEv0-T2aiuJdULpKSDROuAApPS4CUM-MbmYGKhNPcUNx5AqeVJeecmyq-MdzYnri9BgcqJ2Mo/s1600/32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj2cmKJo3T8dyOYqTHK3celEYQgL4Rd1Owxs69ilqPShBuWz4O1sgGhpC6dJADawPNHmmEv0-T2aiuJdULpKSDROuAApPS4CUM-MbmYGKhNPcUNx5AqeVJeecmyq-MdzYnri9BgcqJ2Mo/s320/32.png" width="320" /></a></div>
<span style="font-family: "times new roman"; font-size: small;">
</span><div style="margin: 0cm 0cm 0pt;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;">This was just a simple and quick walkthrough
on how to develop and use data entities. Data management platform in Dyanamics 365 for operations offers lots & lots more exciting
stuff. Keep exploring and keep sharing. <span style="mso-spacerun: yes;"> Comments and feedbacks are appreciated. Thanks for reading the blog.<span style="mso-spacerun: yes;"> </span></span></span></div>
</span><div style="margin: 0cm 0cm 0pt;">
</div>
<div style="margin: 0cm 0cm 0pt;">
</div>
</span><br />
<div style="margin: 0cm 0cm 0pt;">
</div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com6tag:blogger.com,1999:blog-7958075616064009946.post-20003827446293759352016-10-10T19:44:00.001-07:002016-10-10T19:44:06.575-07:00Form patterns in AX 7<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
In the new AX, aka AX7, form patterns are introduced. These are evolution of the AX 2012 form templates so they have similar benefits and reasoning when comes to justifying there use. The way they work are bit different though. There were only few form templates in AX2012 but in the new AX, microsoft has introduced a whole new bunch of patterns. A major advantage is maintainability and upgradability of the forms. If a form is having a pattern applied to it then it will be easy to upgrade in future releases of the new AX. <br />
<br />
The current form pattern is shown on the desing node. If there is no pattern applied then it is shown blank as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1QE3ONpzM7jPX-KRj3ohbn3xs2NsZlHlWcI6pqIkGFyQAwTiAO2ushUagwkCgLMcoJRVvd8XST0fNFvugeUlX1A8Sq-soUQoApAjINM_JbuFRXm-SnScs6kxuzICPELCnz3_xzrMaiHQ/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1QE3ONpzM7jPX-KRj3ohbn3xs2NsZlHlWcI6pqIkGFyQAwTiAO2ushUagwkCgLMcoJRVvd8XST0fNFvugeUlX1A8Sq-soUQoApAjINM_JbuFRXm-SnScs6kxuzICPELCnz3_xzrMaiHQ/s640/1.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
In order to apply a pattern , right click on the design node -> select Apply pattern and then choose the pattern from the list of available patterns, as shown below</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4tZ7_k_xEZdhEaXRgONKX_TUR7NBpu4ZOiuQjmvmOeCC-GquSLuhu5MhcWeRfvExQAvQ_dld3DN9yI8QMFMe7tGo7HNj_PYOxCqTLZLidIcikKMLeisYM7A-ulRIr-DU3EeHkPEwWj0/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4tZ7_k_xEZdhEaXRgONKX_TUR7NBpu4ZOiuQjmvmOeCC-GquSLuhu5MhcWeRfvExQAvQ_dld3DN9yI8QMFMe7tGo7HNj_PYOxCqTLZLidIcikKMLeisYM7A-ulRIr-DU3EeHkPEwWj0/s640/2.png" width="453" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Lets apply Simple list and detals - list grid pattern to our form. Once we apply the pattern, the expected form desing pattern is populated in the pattern tab. It shows which controls are missing, to match it to the pattern</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_2-iq71HDae1aGm9CryMlk8Tk9Ghjb4GKwjQG7d0x2KkiPSdehZrl5w6roxNjIOAVk99PHVjFNwrmEXBbDTq3quNFekBxjdT6NfvLAjIC2UYQZr2okqujWbOGJeACGnSzqql_4ac59Io/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="442" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_2-iq71HDae1aGm9CryMlk8Tk9Ghjb4GKwjQG7d0x2KkiPSdehZrl5w6roxNjIOAVk99PHVjFNwrmEXBbDTq3quNFekBxjdT6NfvLAjIC2UYQZr2okqujWbOGJeACGnSzqql_4ac59Io/s640/3.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
As you start adding the controls to your design, the pattern tree keeps updating itself. In the below pic, as I added an Application bar, the control in the tree changes the state.</div>
<br />
<img border="0" height="447" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVci9oY7x8z-9P19frWZ2PfBJ7NZSM3f10DQkzv5S8-FPjevsPUM_kkpyWQSH82xHqRopTPrgpxIuN-VtJTy1s4r9ddDUcXToLBqnPwuXYQJWXi1IIYBtlyn2R0QWf9Kv56XMi4IQkflg/s640/4.png" width="640" /><br />
<br />
<br />
I added the remaining controls on the design.<br />
<br />
<img border="0" height="414" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7FUr5VE5NzcqBKpTi6Lm0Mq7ID1AtRZYa7zFepvoUCqAnzO0ATKnV8TzGAlusfyF4djGM-5RmePIL89y1988SiOX4FwBN0EH9gSZk261AwSmnZ4bhS5nlZK2K9KB2MXm29FmK7OIIlyU/s640/5.png" width="640" /><br />
<br />
<br />
We notice that there is a warning symbol next to a few controls. To view what is missing, click on the control under the design node. The particular control structure, as expected from the pattern, will be shown and we can see that we are missing few controls there.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY6D7UY5yU3Wpz4W77g-fYuE0yWMjSEP5epFoXMdRwvGqeteD-lyCytMrTtlb1mL3L5j-9SztdvfzTMMpk99jEribB5NNs_eCHkoG7vup1nSMnKXzt5NacRWMqTNt4zwmeTNXocxNCurs/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="424" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY6D7UY5yU3Wpz4W77g-fYuE0yWMjSEP5epFoXMdRwvGqeteD-lyCytMrTtlb1mL3L5j-9SztdvfzTMMpk99jEribB5NNs_eCHkoG7vup1nSMnKXzt5NacRWMqTNt4zwmeTNXocxNCurs/s640/6.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Now we can add the missing controls </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;">
<img border="0" height="370" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtE7-Z3LtdAUKQgaWpLrhctIVDx2KDc4HSn1RCc2jyl9vIRjE-oVihxsccD2-gI2aum18AfP7kflazzFobYPlMtXHO-2QlIelqNwila-UKS-E5gYzzGFaLQfvKr4FMY0aQ7hMRWXaYtYc/s640/7.png" width="640" /></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Similarly we can do for other nodes in the design.<br />
<br />
<br />
Another intresting thing which is new in AX7 is that we can apply sub patterns as well. I can apply a pattern to a tab page. To view the available patterns on the tab page, we can right click on the control and select apply pattern and view the available patterns as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<img border="0" height="329" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-a4hmVqkR8SrL0w6TAV2UkcgEWS9dXjqVsTjaMUWbbjZlILFEiPHoOQE7zw_XULkG9ZlyPE_d2H0kWjUG7m-deyFq_rGa20J7_ffbvJyEXO_acaQX9JizV2MiuAkvJjDw6rvy8-B9iE0/s640/10.png" width="640" /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
One more intresting thing is that we can generate a form pattern report. To do this, go to Dynamics AX menu --> Addins --> Run form pattern report.</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinAov5vxVeH1p4DsLQwZhgagLdSGArB74fDWLaFWhr9ZOfjnYrrlGUmA4HeWpn3q4bZj0z5ESOD6p-a4pmhEUqNfmSgdOY6Y5C9kbxjLaQpdne1W5OSljp_7AtKqEx2oKcabEPiZWsk1s/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="505" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinAov5vxVeH1p4DsLQwZhgagLdSGArB74fDWLaFWhr9ZOfjnYrrlGUmA4HeWpn3q4bZj0z5ESOD6p-a4pmhEUqNfmSgdOY6Y5C9kbxjLaQpdne1W5OSljp_7AtKqEx2oKcabEPiZWsk1s/s640/11.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
This generates a csv file which then can be examined to view which standard forms are using which patterns. It is very useful to build your solution as this can help us decide which pattern should be used for the new form. </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<img border="0" height="401" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5xUZYxAuU635lkq358lCIEIrLW6Hg3eF3dU612qLsYuxUehuj6KgRrYMR40B_ifhWku7n9CLoov2Lc1v_z9pf9NkMsyWVg4uXZ6tOK1qpF8PqYwre9o5RgY6bJe30jh1GBVB5cVHyNWs/s640/12.png" width="640" /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
There are some great articles on Ax wiki related to form patterns:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://ax.help.dynamics.com/en/wiki/form-styles-and-patterns/">https://ax.help.dynamics.com/en/wiki/form-styles-and-patterns/</a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://ax.help.dynamics.com/en/wiki/how-to-select-a-form-pattern/">https://ax.help.dynamics.com/en/wiki/how-to-select-a-form-pattern/</a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com3tag:blogger.com,1999:blog-7958075616064009946.post-90579267833533313142015-07-11T06:57:00.000-07:002015-07-11T06:57:15.609-07:00AX2012 R3 CU8 : X++ code to get resource requirements for production routes<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
The below X++ code, can be used to get the resource type and the resource ID defined on the production routes for a production order. Thanks to the methods available on ProdRoute table out of the box which makes this easy.<br />
<br />
Below is the job simulating the code:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj60UlZtSElz0i33W8un10tK07VihY9BQ8NbFZK3Ol-aZPyPonWPJ-mHHtrBbdgx6wfyWuBzyTad3Mhn1PVd1p24OVnBcGMouc0M53ZguJC2yY3GH1wdB-ZXu4Gs3mOiKCGzVd9I2J4E10/s1600/1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj60UlZtSElz0i33W8un10tK07VihY9BQ8NbFZK3Ol-aZPyPonWPJ-mHHtrBbdgx6wfyWuBzyTad3Mhn1PVd1p24OVnBcGMouc0M53ZguJC2yY3GH1wdB-ZXu4Gs3mOiKCGzVd9I2J4E10/s640/1.png" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
To quickly reuse the code here it is:<br />
<br />
static void Job45(Args _args)<br />
{<br />
ProdRoute prodRoute;<br />
RecId recId;<br />
WrkCtrId wrkCtrGrpId;<br />
ProdId prodId = "W000170";<br />
WrkCtrActivityRequirementType relationShipType;<br />
WrkCtrActivityRequirement wrkCtrActivityRequirement;<br />
<br />
while select prodRoute<br />
where prodRoute.ProdId == prodId<br />
{<br />
recId = prodRoute.activityRequirementSet().RecId;<br />
<br />
select WrkCtrActivityRequirement<br />
where WrkCtrActivityRequirement.ActivityRequirementSet == recid;<br />
wrkCtrGrpId = WrkCtrActivityRequirement.requirementEdit();<br />
relationShipType = WrkCtrActivityRequirement.RelationshipType;<br />
<br />
info(strFmt("%1, %2",relationShipType,wrkCtrGrpId));<br />
}<br />
}<br />
<br />
Have a great day.<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com4tag:blogger.com,1999:blog-7958075616064009946.post-31798603850910023812015-04-25T02:04:00.001-07:002015-04-25T02:04:40.923-07:00AX2012 R3 : Scheduling dates using X++ <div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
When required to calculate a future/past dates using X++ based on the working times defined in the working calendar in AX, <a href="https://msdn.microsoft.com/en-us/library/workcalendarsched.aspx">workcalendarsched</a> class can be used to take off the pain.<br />
The below job shows how we can use the schedDate function and get the result, for simplicity I have passed the calendar name defined in my system as a string:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvjC_gV0rIzi6Z2lBnfvBC6Y6Sr8Xu7GHXkjp4Wz85fUWe9FRA4FqWjZYc1KkxPiwAhyeEJEqskyJ7Ace64oNx3-LiUZ0FMo9Jipih5G6DxRp4w3T5HDRo_qIN7Nld97UHE64Wmbbhyphenhyphenco/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvjC_gV0rIzi6Z2lBnfvBC6Y6Sr8Xu7GHXkjp4Wz85fUWe9FRA4FqWjZYc1KkxPiwAhyeEJEqskyJ7Ace64oNx3-LiUZ0FMo9Jipih5G6DxRp4w3T5HDRo_qIN7Nld97UHE64Wmbbhyphenhyphenco/s1600/1.jpg" height="190" width="640" /></a></div>
<br />
<br />
TransDate reqDate = systemdateget(), newReqDate;<br />
workCalendarSched workCalendarSched = new workCalendarSched();<br />
<br />
newReqDate = workCalendarSched.schedDate(SchedDirection::Forward,reqDate,5,false,'STANDARD');<br />
info(strfmt("%1",newReqDate));<br />
<br />
Another useful method in this class is <a href="https://msdn.microsoft.com/en-us/library/workcalendarsched.isdateopen.aspx">isdateopen</a> which can be used to check if a particular date is open in the calendar. The good thing about this class is that it uses <a href="https://msdn.microsoft.com/en-au/library/sysglobalobjectcache.aspx">SysGlobalObjectCache</a> to store and retrieve the values. It improves the performance when running long and complex calculations.<br />
<br />
Notice in the below method, if the key exists in cache then the value is returned from there itself else the cache is updated.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_9nnknfKRoeaXZ9xzT6FD1Z2ZZ021os6btfeefKxrYvJBGro7EJ7DEuw9wqil21XvxovCCebU4gfUadpsySefTcZTcCBKGjsmAP3x3BZFQzPnx24MxXI548FccwsBNNxStxQjjsHvEMs/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_9nnknfKRoeaXZ9xzT6FD1Z2ZZ021os6btfeefKxrYvJBGro7EJ7DEuw9wqil21XvxovCCebU4gfUadpsySefTcZTcCBKGjsmAP3x3BZFQzPnx24MxXI548FccwsBNNxStxQjjsHvEMs/s1600/2.jpg" height="416" width="640" /></a></div>
<br />
<br />
The below method of WorkCalendarSched class initialises the variables from global cache.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggAePydd0yd4egaVmAYZFDFwY6hEDzItlu9UWR-i_sOMV9yqa_GozTX89caey5-xwFYcKqpzCH55UGbhji6zpEbNjvPt2TiQFQIBj5nfzV-ndpXa90502jlsUP1ka9Y8O9xAiOqU7A2QI/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggAePydd0yd4egaVmAYZFDFwY6hEDzItlu9UWR-i_sOMV9yqa_GozTX89caey5-xwFYcKqpzCH55UGbhji6zpEbNjvPt2TiQFQIBj5nfzV-ndpXa90502jlsUP1ka9Y8O9xAiOqU7A2QI/s1600/3.jpg" height="388" width="640" /></a></div>
<br />
The global cache scope is stored on the combination of Class + current partition and current company as highlighted below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFf5Tk1KlqmJjfrmKZY9anzlWFv8zP4tYND7ALMZDBDNE1Gg_Yx0CN9ZvR-Z9DGn0rfn0s06gh1UOwaXaMuVDeHA2YEB8YrxNYEUZNwXeMjWlzyj269bBKcVKFutxKog4IYNu1jlf7wBA/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFf5Tk1KlqmJjfrmKZY9anzlWFv8zP4tYND7ALMZDBDNE1Gg_Yx0CN9ZvR-Z9DGn0rfn0s06gh1UOwaXaMuVDeHA2YEB8YrxNYEUZNwXeMjWlzyj269bBKcVKFutxKog4IYNu1jlf7wBA/s1600/4.jpg" height="226" width="640" /></a></div>
<br />
<br />
This class is also a good example to understand how to use SysGlobalObjectCache.<br />
Thanks for reading the blog. Keep sharing.<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com0tag:blogger.com,1999:blog-7958075616064009946.post-63411020458472722222015-04-10T06:27:00.000-07:002015-04-10T06:29:37.148-07:00Importance of SaveLast() in RunBase Framework<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
<div>
<a href="https://msdn.microsoft.com/EN-US/library/aa863262.aspx">RunBase Framework</a> is widely used in AX. In this post, I would like to highlight the importance of <a href="https://msdn.microsoft.com/en-us/library/runbase.savelast.aspx">SaveLast()</a> function. Understanding of <a href="https://msdn.microsoft.com/EN-US/library/aa879675.aspx">pack/unpack </a>pattern is must to utilize this class in the most effective way.</div>
<div>
<br /></div>
<div>
SaveLast() is used to save the latest state of the class. That means even after the class is unpacked we can still update the packed state of the class. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT1uw7Cy6f4uGYau9Wxubk4zJzjGkq7ZwGEQ_tB2wKHaXvUYjR-YXyF69SzMJWo1J1eXiKQnWf73o1toMK9qv9wJLaYpgBDYUB5XAJiuLkVMktwCShngc-iz3IjnqKkYWiqRaWtuLz3Vk/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT1uw7Cy6f4uGYau9Wxubk4zJzjGkq7ZwGEQ_tB2wKHaXvUYjR-YXyF69SzMJWo1J1eXiKQnWf73o1toMK9qv9wJLaYpgBDYUB5XAJiuLkVMktwCShngc-iz3IjnqKkYWiqRaWtuLz3Vk/s1600/1.jpg" height="260" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
One common scenario where it is very useful is when we need to show the values of fields from the caller record on the dialog . In such scenarios this method needs to be called before the prompt() method . This way the packed state is updated with the latest values and in the dialog() method you can access the latest values. </div>
<div>
<br /></div>
<div>
This can been seen in many standard AX classes which extend RunBase class</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrA-FCd-AkH4lys1IUSiUvUgQigLNUywPglMGCplhFzSMRwBJIRa7BjGVn2ARtC9tUR1pJ0VoOO4DUtcHAX5eziA3-k6IXJytTjJduS7oju8M3CnIeXRq2vjIV9D6sKdYBZS2EgCILKVc/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrA-FCd-AkH4lys1IUSiUvUgQigLNUywPglMGCplhFzSMRwBJIRa7BjGVn2ARtC9tUR1pJ0VoOO4DUtcHAX5eziA3-k6IXJytTjJduS7oju8M3CnIeXRq2vjIV9D6sKdYBZS2EgCILKVc/s1600/4.jpg" height="259" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9mr9uSUfI11ZSkHXMFfrncoNGV7uTDk0qY_7BULJoR5fc12wZrMvo3IZ9PpentwzuUZ5C4OJu6XvRRba1Fm43QHRukTEKjCqwy15Y_hSBrMBpvg0cENXTjs4yXF2ncMqKmyCJmxXZhk/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9mr9uSUfI11ZSkHXMFfrncoNGV7uTDk0qY_7BULJoR5fc12wZrMvo3IZ9PpentwzuUZ5C4OJu6XvRRba1Fm43QHRukTEKjCqwy15Y_hSBrMBpvg0cENXTjs4yXF2ncMqKmyCJmxXZhk/s1600/2.jpg" height="422" width="640" /></a></div>
<div>
<br /></div>
<div>
So if you are packing some variables, which you are also initialising in the main method and want to show on the dialog, then call saveLast() method before prompt() to get the most recent values.</div>
<div>
<br /></div>
<div>
Thanks for reading the blog. Have a great day.</div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-43184067505254581122015-02-21T05:15:00.000-08:002015-02-21T05:21:16.736-08:00Generating QR Codes in AX 2009<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
Recently I worked on a task to generate and show QR code on a report in AX 2009.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxu2cHFZRc3cwIlvfNGRfNTioTiKMWovTP77ySY2BbpEdz2AJOa5XvfqC1GrbTg1hzmloi6jLDZpsr9Pyjyo90seEf8wlR6zkZmxbNS_zVPgS1pcej9ENK1ih3D3ZlbhJnDF6J14Y8xJw/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxu2cHFZRc3cwIlvfNGRfNTioTiKMWovTP77ySY2BbpEdz2AJOa5XvfqC1GrbTg1hzmloi6jLDZpsr9Pyjyo90seEf8wlR6zkZmxbNS_zVPgS1pcej9ENK1ih3D3ZlbhJnDF6J14Y8xJw/s1600/1.png" height="200" width="200" /></a></div>
<br />
In order to do this, I did the below steps:<br />
<ul style="text-align: left;">
<li>Downloaded file MessagingToolkit.QRCode.dll</li>
<li>Copied it in client\bin folder</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi10R5lSk-CrBWL2Bx-n7-xtncss58vhRXqWQRvOfMq2GaVMZpojb652lOUaIR9Ayy07uhAdeGSCg0dAbbfgOWD4mTZ3Ewdin2pNfXoPOAmjiNBRVFFJF78BTTzLYSbNE-ekfXEQOhc1FY/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi10R5lSk-CrBWL2Bx-n7-xtncss58vhRXqWQRvOfMq2GaVMZpojb652lOUaIR9Ayy07uhAdeGSCg0dAbbfgOWD4mTZ3Ewdin2pNfXoPOAmjiNBRVFFJF78BTTzLYSbNE-ekfXEQOhc1FY/s1600/1.jpg" height="197" width="400" /></a></div>
<div>
<br /></div>
<ul style="text-align: left;">
<li>Added this dll file in the system references</li>
</ul>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo8SBSFinRRcsJZeNktSDpattzNQ1TGYAo2xHXnQiGu3QO94wKhfTvHLEKIi3g-bgn-3bmPDOQE1wqJ30j5llpnxxbme6AZ59Gb4vBft3gfoG5hwh9es7MMgPnpRBO-vhUvhxxqTpdZyU/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo8SBSFinRRcsJZeNktSDpattzNQ1TGYAo2xHXnQiGu3QO94wKhfTvHLEKIi3g-bgn-3bmPDOQE1wqJ30j5llpnxxbme6AZ59Gb4vBft3gfoG5hwh9es7MMgPnpRBO-vhUvhxxqTpdZyU/s1600/2.png" height="320" width="278" /></a></div>
<div>
<br /></div>
<ul style="text-align: left;">
<li>Create a new display method on the report. The below code can be used to generate QR code.</li>
</ul>
<span style="font-family: Calibri; font-size: 11pt;">display container
qrcode()</span><br />
<div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
{</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
Bindata bindata = new Bindata();</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
Image Imgobj;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
System.Drawing.Image img;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
System.Drawing.Bitmap obj;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
Filepath _path;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
container con;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
MessagingToolkit.QRCode.Codec.QRCodeEncoder
encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
obj = new
System.Drawing.Bitmap(encoder.Encode("TESTSTRING"));</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
obj.Save(@"C:\temp\newPhoto.bmp",System.Drawing.Imaging.ImageFormat::get_Bmp());</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
bindata.loadFile(@"C:\temp\newPhoto.bmp");</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
con = bindata.getData();</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
return con;</div>
<div style="font-family: Calibri; font-size: 11pt; margin: 0in; text-align: left;">
}</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
</div>
<br />
<ul style="text-align: left;">
<li>Add the image control on the report based on the display method. </li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-p_c1QcXh7ULBs4vXrkhyphenhyphennf5cKNNGKru7TOkm0unHwu1As-vd0_55RB5GKeRToYCtcWHSnJ9juGrbx5_wQ-EuxA22l3znR5r_2psPaVwbss8qvWNovx-WCt0F_lU6g4pn3rFb2HYEpSM/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-p_c1QcXh7ULBs4vXrkhyphenhyphennf5cKNNGKru7TOkm0unHwu1As-vd0_55RB5GKeRToYCtcWHSnJ9juGrbx5_wQ-EuxA22l3znR5r_2psPaVwbss8qvWNovx-WCt0F_lU6g4pn3rFb2HYEpSM/s1600/3.png" height="315" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br />
QR code can be seen on the report on running it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi8OWuVKSd-JgRzZelu_snyY0SUNHPDo5XjzWlgdD5YLICLEhICGQsZsHnTipQGlHFnbSrQyiDlxbEKXcHKuPjexrty0OBC9LOGvOQE5_ScjhvmCqeqtw0mAehQglplT7sn6_LkGwv-mI/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi8OWuVKSd-JgRzZelu_snyY0SUNHPDo5XjzWlgdD5YLICLEhICGQsZsHnTipQGlHFnbSrQyiDlxbEKXcHKuPjexrty0OBC9LOGvOQE5_ScjhvmCqeqtw0mAehQglplT7sn6_LkGwv-mI/s1600/4.png" height="320" width="223" /></a></div>
<br /></div>
<div>
<br />
There are many other dll files available as open source to generate QR code. Keep sharing.<br />
<br />
Reference: <a href="http://myfewvideos.blogspot.com.au/2012/12/qr-code-in-ax2012.html">I found a link to do the same on AX2012</a><br />
<br /></div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-2072366816905829732015-01-14T02:37:00.000-08:002015-01-14T02:37:51.732-08:00AX2012 R3 : X++ code to start production order<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
The below X++ code can be used to start production orders in AX2012 R3 and R2 versions. I have not tested this in previous versions.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwP9qkQ24HQD49hl_RKr7S69xfMNrRXsBPPbYRQ7lXIjaCYdT7PWzGK8_4ZSbF2fz0z6gmmXuvSiX0Tbyx5ZoGaKz3-TZoeUhlyFpDCvvyukW9rVybnm7BMUF_HF4W243mqnaF4LxK1ls/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwP9qkQ24HQD49hl_RKr7S69xfMNrRXsBPPbYRQ7lXIjaCYdT7PWzGK8_4ZSbF2fz0z6gmmXuvSiX0Tbyx5ZoGaKz3-TZoeUhlyFpDCvvyukW9rVybnm7BMUF_HF4W243mqnaF4LxK1ls/s1600/3.jpg" height="133" width="200" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9SLkNd1oVu4AsBs-1n44g-aMtQQcYARVTzhdSWHlADMLj28rncQl41IdCmyTDhdIcAY-KHHixr0WEr7mqGY_qineddrxmaelqh6-JMxGNy9fTNOLk8taQKexy_AG1k5goV4HVguVVjO8/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9SLkNd1oVu4AsBs-1n44g-aMtQQcYARVTzhdSWHlADMLj28rncQl41IdCmyTDhdIcAY-KHHixr0WEr7mqGY_qineddrxmaelqh6-JMxGNy9fTNOLk8taQKexy_AG1k5goV4HVguVVjO8/s1600/1.jpg" height="422" width="640" /></a></div>
<br />
<br />
The values which we normally define on start screen can be assigned in the prodParmStartUp table buffer:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWNZpKhBfmTmPrJEmksDIApMYf4MrHHE3kP1U8CIW0TXMTjsW2gK_zaCxjyc3tYdMZWHzWzesFqyo5O0BKVPO9xCNTg6UZbGoKW1Mf-jD0eczpe0WZgTqS_iv00XrSzRszSHZT1_uj7C0/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWNZpKhBfmTmPrJEmksDIApMYf4MrHHE3kP1U8CIW0TXMTjsW2gK_zaCxjyc3tYdMZWHzWzesFqyo5O0BKVPO9xCNTg6UZbGoKW1Mf-jD0eczpe0WZgTqS_iv00XrSzRszSHZT1_uj7C0/s1600/2.jpg" height="462" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
In the job I have set the automatic BOM and Route consumption as Never and have also turned off the post picking list and route card journal check boxes.<br />
<br />
To use the code quickly here it is, the production order number and quantity are initialized in the _prodId and _qty variables:<br />
<br />
static void prodStart(Args _args)<br />
{<br />
ProdParmStartUp prodParmStartUp;<br />
ProdMultiStartUp prodMultiStartUp;<br />
ProdId _prodId = "W000034";<br />
Qty _qty = 10000;<br />
<br />
ttsbegin;<br />
prodMultiStartUp = ProdMultiStartUp::construct(null);<br />
prodMultiStartUp.parmId(RunBaseMultiParm::getSysParmId());<br />
prodMultiStartUp.getLast();<br />
prodMultiStartUp.insert(ProdTable::find(_prodId), prodParmStartUp);<br />
if (_qty)<br />
{<br />
prodParmStartUp.StartUpQty = _qty;<br />
prodParmStartUp.PostNowBOM = NoYes::No;<br />
prodParmStartUp.PostNowRoute = NoYes::No;<br />
prodParmStartUp.BOMAutoConsump = BOMAutoConsump::Never;<br />
prodParmStartUp.RouteAutoConsump = RouteAutoConsump::Never;<br />
prodParmStartUp.update();<br />
}<br />
prodMultiStartUp.runOnServer();<br />
<br />
info("Done");<br />
ttsCommit;<br />
}<br />
<br />
Thanks for reading the blog. </div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com1tag:blogger.com,1999:blog-7958075616064009946.post-71783660615130699182014-11-08T02:36:00.001-08:002014-11-08T02:36:57.354-08:00X++ code to change financial dimension when assigning Inventory Site <div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
It is good to find the out of the box available API's in Microsoft Dynamics AX, which can take the burden of writing some tricky code off your head. I recently found this API which can be used to link an existing financial dimension with the financial dimension defined on an Inventory site.<br />
<br />
This is useful in scenarios where we create journals using X++ code and default/assign the value in inventory site field. This is a static method names changeDimension() available on InventSite table which takes the current financial dimension and the InventSiteID as inputs and returns you the merged Financial dimension. \Data Dictionary\Tables\InventSite\Methods\changeDimension()<br />
<br />
A sample X++ code when creating an Inventory journal lines, to use this API would be something like this :<br />
inventJournalTrans.DefaultDimension = InventSite::changeDimension(inventJournalTrans.DefaultDimension,'SITE001');<br />
<br />
Inside this method you will find that system uses DimensionDefaultingService class to merge the dimensions. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjChkuUd6IOaQyPDPXvpy9qhw_9aYuHxOdHnGPi0MFIRUZXWocvRrgt9uImWcqye-jR5WHLT2Do4eu-MdYM-igvp1ZDHR2GXsOGaak_DzgARk-VErdxXUXLAlRrjFkXTu-Lm_efBIzebAo/s1600/1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjChkuUd6IOaQyPDPXvpy9qhw_9aYuHxOdHnGPi0MFIRUZXWocvRrgt9uImWcqye-jR5WHLT2Do4eu-MdYM-igvp1ZDHR2GXsOGaak_DzgARk-VErdxXUXLAlRrjFkXTu-Lm_efBIzebAo/s1600/1.jpg" height="289" width="640" /></a></div>
<br />
You will also notice in the comments that the dimension is merged only when the site link is enabled.<br />
This means that if the financial dimension is linked to Site and the dimension link is locked then any transaction against this site can only be posted if the value of the selected dimension matches the value associated with the Site storage dimension. This setup form can be found at Inventory and Warehouse management -> Setup -> Posting -> Dimension link.<br />
. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgofK0U7WgG6A-qNLS_4rt2fDyEiQHccKAzxJZybWx49mrTtok9c4Bb7qNDGKuUojos7VezMvdK51oRYCKeeNfIGd67-qI9kJNTw5nYyAEiqVezT-WywdWcZ6-I2_Knlrr0V5BSUZ5QDY/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgofK0U7WgG6A-qNLS_4rt2fDyEiQHccKAzxJZybWx49mrTtok9c4Bb7qNDGKuUojos7VezMvdK51oRYCKeeNfIGd67-qI9kJNTw5nYyAEiqVezT-WywdWcZ6-I2_Knlrr0V5BSUZ5QDY/s1600/3.jpg" height="302" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
So if you are writing X++ code to assign inventory site to any table record which is also storing financial dimension then use the above API . This will make sure that the financial dimension value is merged properly during the creation of the record. <br />
<br />
Thanks for reading the blog, Keep sharing.<br />
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com4tag:blogger.com,1999:blog-7958075616064009946.post-43080409766137290362014-09-06T05:44:00.000-07:002014-09-06T05:44:20.880-07:00Read properties of table fields using X++ code<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
The below piece of X++ code can be used to read properties of table fields.<br />
To demonstrate, the below job will check the mandatory property of the fields of a table. This comes handy during technical analysis. It can be time consuming to check the property of each field manually.<br />
<br />
The code uses DictTable and DictField classes to iterate through the table fields and it's properties. This can also be used to check other properties of the fields of a table.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8PdVIXSVXbZ0NQ-eXxq4lYz7CK-DET3sUtIevQGordmfh9v6GTP7fjZwhiq40Ab4i5xvWmKQXFO_0wdtITtJvgCKsmv_FOveGwd2XD1gK1uiUNs6X9jwtVXo679qQBh7FDaZeA5SKAto/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8PdVIXSVXbZ0NQ-eXxq4lYz7CK-DET3sUtIevQGordmfh9v6GTP7fjZwhiq40Ab4i5xvWmKQXFO_0wdtITtJvgCKsmv_FOveGwd2XD1gK1uiUNs6X9jwtVXo679qQBh7FDaZeA5SKAto/s1600/1.jpg" height="260" width="640" /></a></div>
<br />
static void checkProperties(Args _args)<br />
{<br />
DictTable dictTable;<br />
DictField dictField;<br />
int i, cnt;<br />
<br />
dictTable = new DictTable(tableNum(CustTable));<br />
cnt = dictTable.fieldCnt();<br />
for (i= 1; i<=cnt;i++)<br />
{<br />
dictField = new DictField(tableNum(CustTable),dictTable.fieldCnt2Id(i));<br />
if (dictField.mandatory())<br />
{<br />
info (strFmt("Field %1 is mandatory.",dictField.label()));<br />
}<br />
}<br />
<br />
}<br />
Similar to the way we have checked the property of field using dictField object in the above job, we can also read properties of any table using the dictTable object.<br />
<br />
These classes are used at lot of places in standard AX code to iterate through table structures. Some common scenario are when we need to show list of table/fields in lookups. </div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com3tag:blogger.com,1999:blog-7958075616064009946.post-31343618769616538352014-08-10T21:56:00.003-07:002014-08-10T21:56:41.877-07:00Using NOT LIKE in X++ select statements and query ranges<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
In this post I'll like to share how to use NOT LIKE operator in X++.<br />
LIKE keyword is available in X++ but NOT LIKE is not directly supported the way it works in SQL. It still can be achieved using X++ select statements as well as in query range values.<br />
<br />
For illustration, I'll use an example to select all customer group records which do not start with "1" and do not start with "2", using a select statement as well as using a query object in X++.<br />
<br />
<b>Query Object:</b><br />
If we need to write this in <b>query range</b>, then you need to use the power of expressions in the query range value. Visit <a href="http://msdn.microsoft.com/en-us/library/aa893981.aspx" target="_blank">using expressions in query ranges</a> to get more details.<br />
In the expression use<b> '!1*' </b>to define a not like condition and then <b>separate other values by a comma (,) as a comma will represent an AND condition in the query range expression. </b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicabuzCm3YP3B2bUAufrstpio1zb_dNB_Uf76E7UH6VsW2RBQO4-ipkm9g_G8UluuFePZBM-Qwaq3oSjF8HEw32bOeP_NHTjZc3tV-0078oFBU3ZZ6MITMt2g3FA3wxkDePAJCY2NH6M0/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicabuzCm3YP3B2bUAufrstpio1zb_dNB_Uf76E7UH6VsW2RBQO4-ipkm9g_G8UluuFePZBM-Qwaq3oSjF8HEw32bOeP_NHTjZc3tV-0078oFBU3ZZ6MITMt2g3FA3wxkDePAJCY2NH6M0/s1600/1.png" height="422" width="640" /></a></div>
<br />
To quickly use the code, here it goes:<br />
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
CustGroup custGroup;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
Query query;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
QueryBuildDataSource qbds;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
QueryBuildRange qbr;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
QueryRun qr;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
query = new Query();</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
qbds
= query.addDataSource(tableNum(CustGroup));</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
qbr =
qbds.addRange(fieldNum(custGroup,CustGroup));</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-size: 11pt;"> </span><span style="font-size: 11pt;">qbr.value(strFmt("%1,%2",strFmt('!%1*','1'),strFmt('!%1*','2')));</span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
info (qbds.toString());</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
qr = new QueryRun(query);</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
while (qr.next())</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
{</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
custGroup =
qr.get(tableNum(CustGroup));</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
info (custGroup.CustGroup);</div>
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<b>Select Statement:</b><br />
If we need to write in select statement, then you can achieve by<b> enclosing the like condition in brackets and then use a ! operator </b>(! is the NOT operator in X++). Refer <a href="http://msdn.microsoft.com/en-us/library/aa661012.aspx" target="_blank">Keywords in X++</a> for details.<br />
<br />
So if there are multiple NOT LIKE conditions which needs to be applied in a single statement,<b> then each condition needs to be enclosed in brackets and need to have a ! operator applied as shown below</b>.<br />
<br />
You can see that the customer groups table has three records which starts with 1 and 2 but they are not shown in the info log.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ8fd4nJoTKuMbCzUIaCl57tlUMy5DjYGNY7MU-UPulOjsGKSXT3UwpJGEh2nlcQdONzhdLmUOGfBTsIyimgzP8y0wNXpvaPcHiPr0v-3opxmHiTVXCx6feHT-rUMU2NsKUXxzmvW9pCI/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ8fd4nJoTKuMbCzUIaCl57tlUMy5DjYGNY7MU-UPulOjsGKSXT3UwpJGEh2nlcQdONzhdLmUOGfBTsIyimgzP8y0wNXpvaPcHiPr0v-3opxmHiTVXCx6feHT-rUMU2NsKUXxzmvW9pCI/s1600/2.png" height="294" width="640" /></a></div>
<br />
To quickly reuse the code here it goes:<br />
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
CustGroup CustGroup;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
;</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
while select CustGroup</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
where (!(CustGroup.CustGroup like
'1*') && !(CustGroup.CustGroup like '2*'))</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
{</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
info(CustGroup.custGroup);</div>
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
}</div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
The above code works well with AX2012 R3/R2/RTM and 2009 versions. I have not tested in any previous versions. The above information as also be found at MSDN <a href="http://msdn.microsoft.com/en-us/library/dd261457.aspx" target="_blank">X++, ANSI SQL Comparison: SQL Select </a><br />
<br />
Thanks for reading the blog and keep sharing.<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com6tag:blogger.com,1999:blog-7958075616064009946.post-76232628051740744162014-06-28T00:12:00.002-07:002014-06-28T00:16:21.559-07:00AX2012 R3 : X++ code to get WBS key for a project activity<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
I want to share a piece of code which can be used to get the value of WBS key of an activity for a project. This piece of code works well with AX2012 R3 and AX 2012 R2.<br />
In projects module, we can define Work Breakdown Structure (WBS) for a project. A very nice integration with Microsoft Projects is already available out of the box in standard Microsoft Dynamics AX.<br />
WBS key represents the hierarchy or level of that activity amongst all the project activities.The WBS for a project can be accessed from Projects list and details page from the "Work breakdown structure" button available under the "Plan" group of the action pane as shown below:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXBA9lGZBNvQ10NXUwZvcbWQm5QzsP0oiqA2HxxlfE_xJtK6P0Sc7V4mIk16EKZ8hLDcJK0WNRPVX-R5iJYEq6h0sc8Td5c8IhMyXXTq104OxpjmYa1UcNOpq9gVCQMloGjcLPg8STzBQ/s1600/wbs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXBA9lGZBNvQ10NXUwZvcbWQm5QzsP0oiqA2HxxlfE_xJtK6P0Sc7V4mIk16EKZ8hLDcJK0WNRPVX-R5iJYEq6h0sc8Td5c8IhMyXXTq104OxpjmYa1UcNOpq9gVCQMloGjcLPg8STzBQ/s1600/wbs.png" height="532" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
When you open this form, you will notice that unique WBS key is reflected against each activity. This value is dynamic, if you indend,outdent,move up, move down an activity, it will change the WBS key value.<b> </b><br />
<b>By dynamic value I mean it is not stored as a field in any table</b>.So now lets explore the technical side of it.<br />
<br />
If you look at the form control, it is a display method coming from a method outlineNumber() written on HierarchyTreeTable.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLoXabgrhppgreBt_oxqYfYwc-Mm17pUWQwCxKdG9HejKzBaHpddNOZNzFXKzOfpH43_OT9Jza6vENlwWg4gKw8Gi4y7Ybr82vdIhEU4ZCJ_tLz3TvldqC_fhOSiPA6I4g0vsZeBrkbB4/s1600/ctrl4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLoXabgrhppgreBt_oxqYfYwc-Mm17pUWQwCxKdG9HejKzBaHpddNOZNzFXKzOfpH43_OT9Jza6vENlwWg4gKw8Gi4y7Ybr82vdIhEU4ZCJ_tLz3TvldqC_fhOSiPA6I4g0vsZeBrkbB4/s1600/ctrl4.png" height="329" width="640" /></a></div>
<br />
<b>Note this display method is not available directly on the table. If it would have been directly available on the table, then this would not have been an interesting topic to blog :). </b><br />
It is written as a display method on the form under the data-source methods as shown below:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YxRzx8MkCyyfqwYyjZBXeuEYBMy0aO5s6qcNbkvtVRlid4pPS57Tfr2yxFlWRpRoKH7Pi0FEdEslIOkPQIJnTwnMTvD2bZcGuTBCIGxgu6cOuUROqNoDjP1IdxjT990OPMjI8WikLXI/s1600/disp5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0YxRzx8MkCyyfqwYyjZBXeuEYBMy0aO5s6qcNbkvtVRlid4pPS57Tfr2yxFlWRpRoKH7Pi0FEdEslIOkPQIJnTwnMTvD2bZcGuTBCIGxgu6cOuUROqNoDjP1IdxjT990OPMjI8WikLXI/s1600/disp5.png" height="108" width="640" /></a></div>
<br />
<br />
So now we see that the display method returns the value from a function OutlineNumberFor() available on object of a class whose variable is declared with the name of controller on the form. So let's move ahead and look at the class declaration of the form, so we notice that this class is ProjWBSUpdateController<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWEElwbsyIHiD46lkomYqiTFd3dmOQ2kI5KMQ1Y0XCAPrzuhzkFkVoSgiIvlgucBnBRCyvKv_Ik48b51T6jxgeJFL32Q4ztERe29Z4Fzm4sNXP90GHqJNph_PiMcsPQ03jluBSrrNmF0A/s1600/classDec.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWEElwbsyIHiD46lkomYqiTFd3dmOQ2kI5KMQ1Y0XCAPrzuhzkFkVoSgiIvlgucBnBRCyvKv_Ik48b51T6jxgeJFL32Q4ztERe29Z4Fzm4sNXP90GHqJNph_PiMcsPQ03jluBSrrNmF0A/s1600/classDec.png" height="360" width="640" /></a></div>
<br />
<br />
Now things get interesting, let us try to find on this form how this class is getting initialized, the best place to find this is init method of the form and you will notice the below code there:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM3tmZ9YaUMQT6-EKkZJTtFvZlh8xgbjlC3RkiKjzAkeEyBzuCnJrhm973TCzc5CWltdTqxAu8Bcj9xTFI2DsYJHe2xK38DYzu658tjhOJWESEgSCgYs5QYmnyrNlUXBMoD0S61nMQQUw/s1600/init.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM3tmZ9YaUMQT6-EKkZJTtFvZlh8xgbjlC3RkiKjzAkeEyBzuCnJrhm973TCzc5CWltdTqxAu8Bcj9xTFI2DsYJHe2xK38DYzu658tjhOJWESEgSCgYs5QYmnyrNlUXBMoD0S61nMQQUw/s1600/init.png" height="280" width="640" /></a></div>
<br />
wow...it requires so many parameters, let have a look at the new() method of this class, you will notice that only the first two parameters are mandatory and rest all have a default value assigned to them in the function definition and so are optional:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ShOJFBpLb6xAQmao3XevjYBOvvC5lcChXwTwaBLekxSn7FWK6kzrhf2Mlg6tOdKOJRXaxJqulM5i5bpddYL4JUJnxC3LDYp2BmKJcnRstdjQOhJcX-NQ8fKE52_PkFpjT7uBEv-ir34/s1600/MethodDef3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ShOJFBpLb6xAQmao3XevjYBOvvC5lcChXwTwaBLekxSn7FWK6kzrhf2Mlg6tOdKOJRXaxJqulM5i5bpddYL4JUJnxC3LDYp2BmKJcnRstdjQOhJcX-NQ8fKE52_PkFpjT7uBEv-ir34/s1600/MethodDef3.png" height="354" width="640" /></a></div>
<br />
<br />
Additionally after initializing the class object the most important part is the call to updateOutlineNumbersAndPublishInPreOrder() method call.<b> All the magic happens in this method and it makes your class object the shining star of the form ;).</b><br />
<br />
So if we can get the hierarchyID and the calendarID, we can use this class to run all the business rules for us and return the key number. It is always a best practise not to reinvent the whole wheel and use the available classes out of the box.<br />
HierarchyID --> If you try to analyse smmActivities table which stores all the project activities you will find that it is linked to HierarchyTreeTable based on it's recID and from HierarchyTreeTable you can get the hierarchyID.<br />
<br />
CalendarID --> You can get it from the project.<br />
<br />
<b>So now time to knit all the above piece of code together and make is usable, so here is the job </b>:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4wAXO6MJPp9HNZU2VHpn0rN_6OFc96O7JSEE93g89OAIOeqPKPbNNXmoDw1wRRpQF-zBKrVis_blJXbLqpQ1SJtfb98gEcYSJV2y9ALB3nWeTwzMvdrMhjJI10OUp1U2Hz7DBmz2mln0/s1600/job.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4wAXO6MJPp9HNZU2VHpn0rN_6OFc96O7JSEE93g89OAIOeqPKPbNNXmoDw1wRRpQF-zBKrVis_blJXbLqpQ1SJtfb98gEcYSJV2y9ALB3nWeTwzMvdrMhjJI10OUp1U2Hz7DBmz2mln0/s1600/job.png" height="322" width="640" /></a></div>
<br />
<br />
To quickly reuse the code here it goes:<br />
<br />
static void wfsGetWBSForActivityNumber(Args _args)<br />
{<br />
ProjWBSUpdateController controller;<br />
HierarchyIdBase hierarchyId;<br />
HierarchyTreeTable hierarchyTreeTable;<br />
str recordWBSId;<br />
smmActivities smmActivities;<br />
ProjTable projTable ;<br />
CalendarId calendarId;<br />
<br />
smmActivities = smmActivities::find("A000072");<br />
hierarchyTreeTable = hierarchyTreeTable::findRefRecId(smmActivities.RecId);<br />
<br />
calendarId = ProjTable::find(smmActivities.projId()).PSASchedCalendarId;<br />
<br />
hierarchyId = hierarchyTreeTable.HierarchyId;<br />
<br />
controller = new ProjWBSUpdateController(hierarchyId,calendarId);<br />
controller.updateOutlineNumbersAndPublishInPreOrder();<br />
recordWBSId = controller.outlineNumberFor(hierarchyTreeTable.ElementNumber);<br />
info(recordWBSId);<br />
}<br />
<br />
Below is the result when we run the above code for the below shown project:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwWWlPiyTtLSEs0MF8B9kLaGzwcIoiUTyDpttbnnxixVsZQd0LIxkwQgTrekgi0gKUSGEefPRAAYY94vgwmwDGoUnMCbNLp-8p5LYCa3XXjNbK501HGciOI6vzzgkjoatsByiXeyK0v7M/s1600/job+executed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwWWlPiyTtLSEs0MF8B9kLaGzwcIoiUTyDpttbnnxixVsZQd0LIxkwQgTrekgi0gKUSGEefPRAAYY94vgwmwDGoUnMCbNLp-8p5LYCa3XXjNbK501HGciOI6vzzgkjoatsByiXeyK0v7M/s1600/job+executed.png" height="320" width="640" /></a></div>
<br />
<br />
Thanks for reading the blog. Have a nice day and keep sharing.<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-11221268960922272352014-02-20T04:26:00.002-08:002014-02-20T04:26:25.523-08:00X++ code to reset ListEnumerator<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
Sometimes we need to iterate a list enumerator multiple times. We can use reset() function to easily do this as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsJ7Kyp6ZwkMJSFvBQ-zrvV1EKZ3PCxUByH2-zic7u-AA_BHnQFh2pU4O_I44IdGSJF2Mjb9pzdSSxr9luH8zhgvIpFdRTPd5NZO9y6VZd6C9kfZdUU7FiGO_We9m2c0tqY-N8ivLfm50/s1600/ListEnumerator+RESET.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsJ7Kyp6ZwkMJSFvBQ-zrvV1EKZ3PCxUByH2-zic7u-AA_BHnQFh2pU4O_I44IdGSJF2Mjb9pzdSSxr9luH8zhgvIpFdRTPd5NZO9y6VZd6C9kfZdUU7FiGO_We9m2c0tqY-N8ivLfm50/s1600/ListEnumerator+RESET.png" height="398" width="640" /></a></div>
<br />
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com1tag:blogger.com,1999:blog-7958075616064009946.post-40072710923427463722014-02-20T04:22:00.000-08:002014-02-20T04:22:25.905-08:00AX2012 R2 CU7: X++ code to post Product Receipt for a Purchase Order<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
The below can be used to post the product receipt for a purchase order. It is same as we used to do in previous version but it is good to keep it handy.<br />
<br />
The main thing is to pass the parameters in update method. The below job will post the product receipt for the inventory quantities which have been Registered. Please note the purchase order should be confirmed before posting the product receipt.<br />
<br />
<span id="goog_771551084"></span><span id="goog_771551085"></span><div class="separator" style="clear: both; text-align: center;">
<span id="goog_771551085"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmA34yYjezY36f6xkjx1GmvwQdoemIb0LI9CnM7hnQ9jFQp_bTtykElLt_oucVMkKKwRSQWrGwjL86nROQs-sgGhKoyzCfKkmSiLMIBoVGqoGdjc9zl5nsnDA6HyA-dma296XQH5ny4nU/s1600/a1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmA34yYjezY36f6xkjx1GmvwQdoemIb0LI9CnM7hnQ9jFQp_bTtykElLt_oucVMkKKwRSQWrGwjL86nROQs-sgGhKoyzCfKkmSiLMIBoVGqoGdjc9zl5nsnDA6HyA-dma296XQH5ny4nU/s1600/a1.png" height="288" width="640" /></a></span></div>
<span id="goog_771551085">
</span><br />
To reuse it quickly, here it is:<br />
<br />
<br />
static void Job12(Args _args)<br />
{<br />
PurchTable purchTable = PurchTable::find("000032");<br />
PurchFormLetter purchFormLetter;<br />
<br />
purchFormLetter = purchFormLetter::construct(DocumentStatus::PackingSlip);<br />
purchFormLetter.update( purchTable,<br />
"PA009",<br />
systemDateGet(),<br />
PurchUpdate::RegisteredAndServices,<br />
AccountOrder::None,<br />
false,<br />
false);<br />
<br />
info("Done");<br />
<br />
}<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmA34yYjezY36f6xkjx1GmvwQdoemIb0LI9CnM7hnQ9jFQp_bTtykElLt_oucVMkKKwRSQWrGwjL86nROQs-sgGhKoyzCfKkmSiLMIBoVGqoGdjc9zl5nsnDA6HyA-dma296XQH5ny4nU/s1600/a1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a> </div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com4tag:blogger.com,1999:blog-7958075616064009946.post-63791850481539535112014-02-18T02:28:00.001-08:002014-02-18T02:31:13.963-08:00AX2012 R2 CU7 : Creating pay periods lookup in Payroll module<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
Recently I was working on some customizations in Payroll module and was required to create controls to select pay cycle and pay periods. I want to share this information on how we can create lookups for pay periods based on a pay cycle.<br />
In standard AX, Pay cycles and pay periods are defined in payroll > setup > pay cycles and pay periods as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTQdhUDuvXjJLDbVkbBs3iakwUlUCfc2_wDvUTNU6ltdozvi6z_B54z95lWjBl5-2TgolSGZJmlewDFKr37xrJFjQ-n9APxpCNWUzrulCbVQQjj4l96Jneabq3UT8gKDeLU0Zs8v26zkQ/s1600/a2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTQdhUDuvXjJLDbVkbBs3iakwUlUCfc2_wDvUTNU6ltdozvi6z_B54z95lWjBl5-2TgolSGZJmlewDFKr37xrJFjQ-n9APxpCNWUzrulCbVQQjj4l96Jneabq3UT8gKDeLU0Zs8v26zkQ/s1600/a2.png" height="496" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
A standard AX example is the dialog of generate pay statements,where user first selects a pay cycle and based on that pay cycle, the pay periods are shown in the control as shown below, the pay periods are specific to the pay cycle:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5k-KleKbhf6SwZ3w0hyphenhyphenUpZgCrkrpe7GDCVLP1o_PRjHRKZpzr5-tIL9HcZQrQI5U3a5x7nJTePbTfGllp8MK0k8is5YKP0YpqgfiqK8bRKoXA-OEBXliPS0r-B2w9Kc8rda-YFWVAEDc/s1600/a1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5k-KleKbhf6SwZ3w0hyphenhyphenUpZgCrkrpe7GDCVLP1o_PRjHRKZpzr5-tIL9HcZQrQI5U3a5x7nJTePbTfGllp8MK0k8is5YKP0YpqgfiqK8bRKoXA-OEBXliPS0r-B2w9Kc8rda-YFWVAEDc/s1600/a1.png" height="558" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
So I looked into the class to understand how the lookup is coming and found the following, system was storing all the values in a container and then adding them to the combo box control. So I have tried to highlight the code used in the process:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5mapX9st6SrbbzMu_OGRGxDKo22aXOLZ5kNTiVjLjOeZvUAHlga30RJ2ae891WDa3SeCJvHVMfl-g-KOmAemNdhSd8-vIfUu-ltkXeuhRNVBWpRnDXruJDRacEuCCFUwMUhh669MoFfE/s1600/a3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5mapX9st6SrbbzMu_OGRGxDKo22aXOLZ5kNTiVjLjOeZvUAHlga30RJ2ae891WDa3SeCJvHVMfl-g-KOmAemNdhSd8-vIfUu-ltkXeuhRNVBWpRnDXruJDRacEuCCFUwMUhh669MoFfE/s1600/a3.png" height="382" width="640" /></a></div>
<br />
When user selects a payCycle then the method to create the period list is called<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPN37kEh54GFRfKm8RudJ_XvvKWvkctBVjnMXuLNZxodE_bqMyQDEFNReZ1rzxtwNM8xUjQg3v5jEwrvk5CjlxAI6epWy00p4g14tujTNwcODi57YWO8cDBCGtOe4UpStFg9NLKUZClbA/s1600/a4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPN37kEh54GFRfKm8RudJ_XvvKWvkctBVjnMXuLNZxodE_bqMyQDEFNReZ1rzxtwNM8xUjQg3v5jEwrvk5CjlxAI6epWy00p4g14tujTNwcODi57YWO8cDBCGtOe4UpStFg9NLKUZClbA/s1600/a4.png" height="371" width="640" /></a></div>
<br />
<br />
In this method the container to hold the payPeriodList is populated with all the valid values, system is selecting all the pay period and then converting it into a string format and then adding it to container and the combo box selection list<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3SQ_iFEMGvUHFrn0Z9vvSFQeHWUR8mgs_ax2how8txAelh23Uon89p_iNSqzht_Cg6Qs5JU6ijnCbMlOAcwtCTFDSudJ1HG0-HziZ0An19RjG8ilitluTnJCByoB3GM2SvRUhvffltc8/s1600/a5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3SQ_iFEMGvUHFrn0Z9vvSFQeHWUR8mgs_ax2how8txAelh23Uon89p_iNSqzht_Cg6Qs5JU6ijnCbMlOAcwtCTFDSudJ1HG0-HziZ0An19RjG8ilitluTnJCByoB3GM2SvRUhvffltc8/s1600/a5.png" height="248" width="640" /></a></div>
<br />
<br />
In order to read the user selection the value is fetched from the container based on the selection in the combo Box control<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCPNiqVy-Tvi-KsxU1GzxX0e_W02nCDJKHubdtr_TKOfuvBo8cf3CJC6WPELgDHOy1O-NFWcuhvdPyf5VQvU016xAbv_kxhmYM3P-XQZdpyP4UarkBxb9hFO8Uhzg5eG8qhuv0b3kRoMw/s1600/a6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCPNiqVy-Tvi-KsxU1GzxX0e_W02nCDJKHubdtr_TKOfuvBo8cf3CJC6WPELgDHOy1O-NFWcuhvdPyf5VQvU016xAbv_kxhmYM3P-XQZdpyP4UarkBxb9hFO8Uhzg5eG8qhuv0b3kRoMw/s1600/a6.png" height="328" width="640" /></a></div>
<br />
<br />
<br />
So I followed the same pattern, and create a form as shown below :<br />
<br />
1. Created a new reference group control for the pay cycle control, these controls are really helpful in AX2012.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXtNXWZRj82wSa9bbrKEQc_JOe0gdA0jClWoeh-ngFszZSyoKKKxA2Wbm8NflBq7_vq8yTWJAsSnni7OymDPF_cz3Wpz6-n5suuw1TdRhZSyRk5z0IYmV73dtDWxU2TzVBDFbcUyAtcDc/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXtNXWZRj82wSa9bbrKEQc_JOe0gdA0jClWoeh-ngFszZSyoKKKxA2Wbm8NflBq7_vq8yTWJAsSnni7OymDPF_cz3Wpz6-n5suuw1TdRhZSyRk5z0IYmV73dtDWxU2TzVBDFbcUyAtcDc/s1600/1.png" height="594" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2pvSENd7FZxEJcn-2bz14sbRlsJeJsACMgWhCYu3yIne_8T0fX5_h8KvxYnCvoaMzjLwnsUnoEO5Bgi28K53DS-SRZ4JB3mIDkhNpvUKmZnSYdSEFerhEnSQbFu90JQmaIMRIAbaaDI4/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2pvSENd7FZxEJcn-2bz14sbRlsJeJsACMgWhCYu3yIne_8T0fX5_h8KvxYnCvoaMzjLwnsUnoEO5Bgi28K53DS-SRZ4JB3mIDkhNpvUKmZnSYdSEFerhEnSQbFu90JQmaIMRIAbaaDI4/s1600/2.png" height="640" width="428" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Now if I open my form, I see all the pay cycles of the system</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5iBRByYu15fI3hfGghYfsOvZ7hIlfJ4i7JvnpwV32CIZNdKDfnabsa5FDFSC-_KuO33wPtQjaIeu09PE0pPB9CVtObwRES2VWe46-dNdDx9vPXTUWa7oMcKmp3AbPSeDSKBINGEabHH8/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5iBRByYu15fI3hfGghYfsOvZ7hIlfJ4i7JvnpwV32CIZNdKDfnabsa5FDFSC-_KuO33wPtQjaIeu09PE0pPB9CVtObwRES2VWe46-dNdDx9vPXTUWa7oMcKmp3AbPSeDSKBINGEabHH8/s1600/3.png" height="568" width="640" /></a></div>
<br />
<br />
<br />
2. Then add a new combo box control to show the pay period lookup<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqIjjvhO5mAC_kF1RgahVJyipCvYg563nqIW2PsaUftgPFsTa17b6lJhKrO8w1C7t03VQR2n3_K3dCJC0NPxOP1BaUfCd_SdPpAkA7yX25jv_t9NoAiNuwrzOWtFy1zfwCjHocESvzHDw/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqIjjvhO5mAC_kF1RgahVJyipCvYg563nqIW2PsaUftgPFsTa17b6lJhKrO8w1C7t03VQR2n3_K3dCJC0NPxOP1BaUfCd_SdPpAkA7yX25jv_t9NoAiNuwrzOWtFy1zfwCjHocESvzHDw/s1600/4.png" height="640" width="486" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
Change the auto declaration to true</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuxK7EglhI-gt_6kFXyV_3VL88096gHyzE2B24DrT-zaEHZQ-eAkQQFGKB5IV9fg2jEMfr1WM5Tj5O8jIiUEyqnq-zb47NL6za2kxemuG2Vfkm9HIY8funSteeuR7r3w5_r2y0ip0yCGg/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuxK7EglhI-gt_6kFXyV_3VL88096gHyzE2B24DrT-zaEHZQ-eAkQQFGKB5IV9fg2jEMfr1WM5Tj5O8jIiUEyqnq-zb47NL6za2kxemuG2Vfkm9HIY8funSteeuR7r3w5_r2y0ip0yCGg/s1600/5.png" height="234" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
Declare the variables in class, a container to store the data and the variables to hold the user selection</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6c72GYZzdi16MIIIIAmlwr4fdTq4Bfk3LFAAAq7Zfs8nkcC1ebspGZov7DvFQvUVsXeZ8gZ_hH5Ux9UR2SMv8gpCFtQui3cexmSSZEJEo4ERv8WGN049YzKC6Emd8sQ7mnxnd0aW2RAE/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6c72GYZzdi16MIIIIAmlwr4fdTq4Bfk3LFAAAq7Zfs8nkcC1ebspGZov7DvFQvUVsXeZ8gZ_hH5Ux9UR2SMv8gpCFtQui3cexmSSZEJEo4ERv8WGN049YzKC6Emd8sQ7mnxnd0aW2RAE/s1600/6.png" height="119" width="640" /></a></div>
<br />
<br />
Then copied the createPayPeriod method and removed the unwanted code. The same pattern is used in benefit register report UI builder class, the below code is copied from there:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKlrf-dAeY9qQmbaDfg9Y2NbyjgyhpfmxuTvDVTkQg1mtdhzFoEC9rzyXBb1f-fVcV7tYsvPPtI6GFEFBLQTWnDv1vnMfzxnscIYT2_mA2_y1jGckYOyy5lByrJWBXUdlafDyDH_KZ2SA/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKlrf-dAeY9qQmbaDfg9Y2NbyjgyhpfmxuTvDVTkQg1mtdhzFoEC9rzyXBb1f-fVcV7tYsvPPtI6GFEFBLQTWnDv1vnMfzxnscIYT2_mA2_y1jGckYOyy5lByrJWBXUdlafDyDH_KZ2SA/s1600/7.png" height="346" width="640" /></a></div>
<br />
<br />
On the modified of the pay cycle control I called this method:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOY2lY7JdhATZJzvap1gFNSUZDuSTy17St3-HDDnienXy6l-O_mTpyv3x_gfMQe_Q8yJQ-_95-Tboi-8OBDDF8_XQvhMparTbt1PUOSS2nfVtwrd99YG_nSZDq8fZVvl7aFxRDh4kNBcc/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOY2lY7JdhATZJzvap1gFNSUZDuSTy17St3-HDDnienXy6l-O_mTpyv3x_gfMQe_Q8yJQ-_95-Tboi-8OBDDF8_XQvhMparTbt1PUOSS2nfVtwrd99YG_nSZDq8fZVvl7aFxRDh4kNBcc/s1600/8.png" height="272" width="640" /></a></div>
<br />
And we are all set to go. On my form I have now lookups of pay cycle and pay period as per standard AX design.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju2-4xF6swSG22QbpftzgWegvYJLFJbMw_-vLT30l7PTZhcIDcct56fPPdvzE3r1bQEme9SxqTl7CiTjQ9JTGlOo_mUnmvzAY-xbUip7h4CdloKYjcg_4yD5WSvMRef7u99RiXd9OjvLI/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju2-4xF6swSG22QbpftzgWegvYJLFJbMw_-vLT30l7PTZhcIDcct56fPPdvzE3r1bQEme9SxqTl7CiTjQ9JTGlOo_mUnmvzAY-xbUip7h4CdloKYjcg_4yD5WSvMRef7u99RiXd9OjvLI/s1600/9.png" height="640" width="328" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Another great example of reusing standard AX code rather then reinventing the wheel. Thanks for reading the blog.</div>
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-7574611094069465662014-02-08T17:36:00.000-08:002014-02-08T17:36:17.240-08:00AX2012 R2 CU7: X++ code to create and post route card journal for production order<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
The below code can be used to create and post route card journal in AX2012 R2 CU7 for a production order when we know the Production order number and the operation number.<br />
I have assigned the costing resource defined on the route as the work center ID in this case.<br />
<br />
static void createRouteCardJournalSample(Args _args)<br />
{<br />
ProdJournalTable prodJournalTable;<br />
ProdJournalRoute prodJournalRoute;<br />
ProdRoute prodRoute;<br />
ProdId prodId = 'PO000065';<br />
OprNum oprNum = 10;<br />
RouteOprId routeOprId;<br />
ProdJournalCheckPostRoute prodJournalCheckPostRoute;<br />
<br />
select prodRoute where prodRoute.ProdId == prodId<br />
&& prodRoute.OprNum == oprNum;<br />
<br />
prodJournalTable.clear();<br />
prodJournalTable.initValue();<br />
prodJournalTable.JournalType = prodjournaltype::RouteCard;<br />
prodJournalTable.ProdId = prodId;<br />
prodJournalTable.JournalNameId = ProdParametersDim::findDefault().RouteJournalNameId;<br />
prodJournalTable.Description = ProdJournalName::find(prodJournalTable.JournalNameId).Description;<br />
prodJournalTable.VoucherSeqRecId = ProdJournalName::find(prodJournalTable.JournalNameId).VoucherSeqRecId;<br />
prodJournalTable.VoucherDraw = journalVoucherDraw::Post;<br />
prodJournalTable.NumOfLines = 1;<br />
prodJournalTable.insert();<br />
<br />
//Route card entry<br />
prodJournalRoute.clear();<br />
prodJournalRoute.JournalId = prodJournalTable.journalId;<br />
prodJournalRoute.ProdId = prodId;<br />
prodJournalRoute.initValue();<br />
prodJournalRoute.OprNum = oprNum;<br />
prodJournalRoute.OprId = prodRoute.OprId;<br />
prodJournalRoute.JobType = RouteJobType::Process;<br />
prodJournalRoute.CategoryHoursId = prodRoute.SetUpCategoryId;<br />
prodJournalRoute.CategoryQtyId = prodRoute.ProcessCategoryId;<br />
prodJournalRoute.DefaultDimension = prodRoute.DefaultDimension; <br />
prodJournalRoute.WrkCtrId = prodRoute.WrkCtrIdCost;<br />
prodJournalRoute.QtyGood = 2;<br />
prodJournalRoute.Hours = 1;<br />
prodJournalRoute.insert();<br />
info(prodJournalTable.JournalId);<br />
<br />
ProdJournalCheckPostRoute = ProdJournalCheckPostRoute::newPostJournal(prodJournalRoute.journalId,true);<br />
ProdJournalCheckPostRoute.run();<br />
}<br />
<br />
<br />
Thanks</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com4tag:blogger.com,1999:blog-7958075616064009946.post-81619291980771231952013-12-07T21:50:00.000-08:002013-12-07T21:58:17.941-08:00AX2012 R2 : Understanding purchase requisition [Basics and X++code to create purchase requisitions]<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
In this post I would like to explain about:<br />
<ol style="text-align: left;">
<li>What is purchase requisition</li>
<li>Why companies use purchase requisition</li>
<li>Difference between purchase requisition and purchase order</li>
<li>Technical dive in X++ code to create purchase requisition for a project.</li>
</ol>
<strong>What is Purchase Requisition:</strong><br />
<ul style="text-align: left;">
<li>Be very clear that a purchase requisition is an <strong>internal document for a company it</strong> is not a contract with the vendor to buy the goods.</li>
<li>It is raised by departments to notify the procurement department that they need to purchase some goods to fulfil the requirements. </li>
<li>This document has details like which items are required, how much quantity, for what purpose, and till which date the items are required.</li>
<li>There can be more details like from which vendor or for which business units that depends on each companies defined templates but the purpose is same.</li>
<li>An example is : A production department for a television manufacturing company can raise a purchase requisition of 1000 panels to fulfil a production demand for the next month.</li>
</ul>
<strong>Why companies use Purchase Requisition:</strong><br />
<ul>
<li>The main goal is to authorize the procurement department to engage a vendor for a purchase commitment.</li>
<li>Another advantage is to have a better internal financial control.</li>
<li>Normally there are approvers who have the authority to approve the purchase requisition and send the approved requisition to the procurement department. These approvers can be someone from finance departments who work closely with the procurement team. In AX this is handled by workflow very well.</li>
<li>The purchase department should not change the details of purchase requisition without getting the approval.</li>
<li>Some companies have limits defined for example the procurement department can purchase orders worth maximum $3000 but if the amount is higher then it needs an approved purchase requisition. </li>
</ul>
<strong>Difference between Purchase requisition and Purchase orders:</strong><br />
<ul>
<li>Once a approved purchase requisition is received the procurement department has authority to engage a vendor to fulfil the requirements.</li>
<li><strong>This agreement between a vendor and a company is known as Purchase Order.</strong></li>
<li>It has details like the vendor name, address, delivery mode, delivery terms, mode of payment, item details, quantity, specification, taxes applicable, delivery dates, delivery schedule.</li>
<li>There can be much more complex information embedded in a purchase order like some trade agreement papers, freight provider information etc.</li>
</ul>
In Microsoft Dynamics AX 2012 R2 we can view Purchase requisition from Procurement and Sourcing --> Common --> Purchase requisition --> All Purchase Requisitions<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-aT7lOcwXarFGB7T1m362CoNMrylBzjP7e4kLOEQVsAVYzBciPHV7Dr6Ep69_zthNvYtL9WKc7iMd2psTFBU-hUHINdk17ElpK3KMkNGEEHrh_7hP-H1GfKycuIsTaqweROc_iX0ZoSM/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-aT7lOcwXarFGB7T1m362CoNMrylBzjP7e4kLOEQVsAVYzBciPHV7Dr6Ep69_zthNvYtL9WKc7iMd2psTFBU-hUHINdk17ElpK3KMkNGEEHrh_7hP-H1GfKycuIsTaqweROc_iX0ZoSM/s1600/1.png" width="400" /></a></div>
<br />
User can also create new requisitions from this list page. Your user much be attached to a worker in the company otherwise the option to create a new requisition will be disabled.<br />
Also the buying legal entity field will only show the lookup of companies where your user is mapped as a worker.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpFcPFmgU5DCQ-CvbUPS7e1O1OuPvHmua1XhJBpaG-1dRPQLnrzlgFqXKiifT_YexcAEAFZhrT3dNYh5msd2PA6IQivHqnp4tl6zmvAhHmo8voP13t-mqL5sOrJpUswEbCrVWGXPFjc5E/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpFcPFmgU5DCQ-CvbUPS7e1O1OuPvHmua1XhJBpaG-1dRPQLnrzlgFqXKiifT_YexcAEAFZhrT3dNYh5msd2PA6IQivHqnp4tl6zmvAhHmo8voP13t-mqL5sOrJpUswEbCrVWGXPFjc5E/s1600/2.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
Then user can go ahead and add lines. There is a lot of information we can feed in AX purchase requisitions like buying legal entity, project for which the requisition is required, item, quantity, inventory dimensions, financial dimensions, procurement category, project activity which makes Dynamics AX a great rich application to do such processes :)<br />
<br />
My aim here is not to show the complete function steps as there are many good references available <br />
for doing the process, you can refer to the following links :<br />
<ul>
<li>One of my favourite blog to understand AX concepts : <a href="http://www.slideshare.net/murrayfife/enabling-purchase-requisition-workflows-in-dynamics-ax-2012">http://www.slideshare.net/murrayfife/enabling-purchase-requisition-workflows-in-dynamics-ax-2012</a></li>
<li>TechNet: <a href="http://technet.microsoft.com/en-us/library/gg231099.aspx">http://technet.microsoft.com/en-us/library/gg231099.aspx</a></li>
<li>Video : <a href="http://dynamicsaxmanuals.com/tag/purchase-requisition/">http://dynamicsaxmanuals.com/tag/purchase-requisition/</a></li>
</ul>
From here the blog takes a turn towards technical zone:) <br />
<br />
I want to share some technical information regarding how we can create purchase requisition from X++ code for a project:<br />
The purchase requisitions are store in PurchReqTable and the lines are stored in PurchReqLine. <br />
Both the tables are related in PurchReqId which is unique index in PurchReqTable as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifPMinIbBVLSUo0duPKWAr1YUq0KqGd9NhSOB_aVrw2dBH9x0jK3qlDPn69i8shEAvUbKTtScnIB4gytjWCyxC8fX0DHH0zSlRAR5YpLGFG4Tt34LJKUexXXrMEKb4N6BljXTRVHaJ-KQ/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifPMinIbBVLSUo0duPKWAr1YUq0KqGd9NhSOB_aVrw2dBH9x0jK3qlDPn69i8shEAvUbKTtScnIB4gytjWCyxC8fX0DHH0zSlRAR5YpLGFG4Tt34LJKUexXXrMEKb4N6BljXTRVHaJ-KQ/s1600/3.png" width="400" /></a></div>
<br />
<br />
<br />
The below job can be used to create a purchase requisition for an item requirement of a project.<br />
We can link a purchase requisition line to a project item requirement.Which means we can define the project activity, procurement category, default vendor for the item, quantity and much more information on the purchase requisition line to have a great visibility of information.<br />
<br />
The item requirements for a project are stored as sales lines. In case you do not have any link to project then also you can use the below job to create purchase requisitions by removing the project references from the code:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9xw_K0uT4F7oGW_9NXBWmQb4_-Z8FiMU_aqNwDJ4lMmz9WQE-BxrqMN8VjwgeVa7XZ3sN9YwpLiJC207GWNROUBv9zoOAv0xxdBIesP09sxxybY6ZmhPwMk9xiBEB8D9xn-9IJ03_AM/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="377" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9xw_K0uT4F7oGW_9NXBWmQb4_-Z8FiMU_aqNwDJ4lMmz9WQE-BxrqMN8VjwgeVa7XZ3sN9YwpLiJC207GWNROUBv9zoOAv0xxdBIesP09sxxybY6ZmhPwMk9xiBEB8D9xn-9IJ03_AM/s1600/4.png" width="640" /></a></div>
<br />
There are many more fields in PurchReqLine table which can be assigned if you have values to assign to them. <br />
<br />
If you want to reuse the code, here it is:<br />
static void CreatePurchReqJob(Args _args)<br />
{<br />
PurchReqTable purchReqTable;<br />
PurchReqLine purchReqLine;<br />
ProjTable projTable = projTable::find("P000");<br />
SalesLine salesLine = SalesLine::findInventTransId("TRANS-00001");<br />
purchReqTable.clear();<br />
purchReqTable.initValue();<br />
purchReqTable.PurchReqId = NumberSeq::newGetNum(PurchReqTable::numRefPurchReqId()).num();<br />
purchReqTable.PurchReqName = "Testname";<br />
purchReqTable.ProjId = projTable.ProjId;<br />
purchReqTable.ProjIdDataArea = projTable.dataAreaId;<br />
purchReqTable.insert();<br />
purchReqLine.clear();<br />
purchReqLine.initValue();<br />
purchReqLine.InventDimId = salesLine.InventDimId;<br />
purchReqLine.initFromPurchReqTable(purchReqTable);<br />
purchReqLine.ItemId = salesLine.ItemId;<br />
purchReqLine.ActivityNumber = salesLine.ActivityNumber;<br />
purchReqLine.BuyingLegalEntity = CompanyInfo::find().RecId;<br />
purchReqLine.InventDimIdDataArea = salesLine.dataAreaId;<br />
purchReqLine.initFromProjTable(projTable);<br />
purchReqLine.insert();<br />
info(purchReqTable.PurchReqId);<br />
<br />
}<br />
<br />
If you might have read closely then you must have noticed that numRefPurchReqId() method is available on PurchReqTable itself :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXx13uumkOWKkGczcOAk9p9CHz07ytFnRY_rRR4qr46m0OY6bvqLNMeWrN3VnV1br7c4KRglHEMuwK4xpksfeTAfIIfqgU2nThsg6qyybbywhv3ukEatkaQBqYbSq87VgjY8O88VJeTfQ/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXx13uumkOWKkGczcOAk9p9CHz07ytFnRY_rRR4qr46m0OY6bvqLNMeWrN3VnV1br7c4KRglHEMuwK4xpksfeTAfIIfqgU2nThsg6qyybbywhv3ukEatkaQBqYbSq87VgjY8O88VJeTfQ/s1600/5.png" width="640" /></a></div>
<br />
The init methods on the table are quite helpful as they initialize number of fields for us so we do not need to worry unless we have some custom logic to initialize them.<br />
So now that we have a basic understanding of purchase requisitions and how they are different from purchase orders with some pinch of technical flavour I hope this information will be helpful.<br />
<br />
Thanks for reading the blog.<br />
<br />
<br />
<br />
<br />
<br />
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com3tag:blogger.com,1999:blog-7958075616064009946.post-7971751095254333762013-11-28T01:35:00.000-08:002013-11-28T01:35:24.326-08:00AX2012 R2 : Adding new fields on list page grid using new data source <div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
Recently I was adding new fields on a positions list page grid in payroll module and these fields were coming from a new custom table. The steps are simple with one tricky part:<br />
<br />
1. Create new table, define proper relations with other tables.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUKTpeD7BIf1OdlCoCiFxZYcY3eoLP575mXTN2LxKPAuxq_jg0KftgfdGKOEOtnve51afYB3uoFLcc-neocNBch-zAQUkTrnm8z2Vk69on4tZ0tMYhdzOTLDNRcrEMT_uIcbvWFYyISi0/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUKTpeD7BIf1OdlCoCiFxZYcY3eoLP575mXTN2LxKPAuxq_jg0KftgfdGKOEOtnve51afYB3uoFLcc-neocNBch-zAQUkTrnm8z2Vk69on4tZ0tMYhdzOTLDNRcrEMT_uIcbvWFYyISi0/s640/1.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
2. Add the table in the query used on the list page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4TEaiAubHMDf5bq_sLQ9cLprqEs1jntOoZniyY8xaLv2WJTK_0j2YOyi-usEQpwToTiC1t_eU_2sdTpOwGInozCygYzUOnSaqNC56dlTAE6wcSTbziBc4y1m2AvmwnXltEueR3AZDCkg/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4TEaiAubHMDf5bq_sLQ9cLprqEs1jntOoZniyY8xaLv2WJTK_0j2YOyi-usEQpwToTiC1t_eU_2sdTpOwGInozCygYzUOnSaqNC56dlTAE6wcSTbziBc4y1m2AvmwnXltEueR3AZDCkg/s640/2.png" width="640" /></a></div>
<br />
3.<b> This is a tricky part: </b>When you come back to list page and try to restore the form you will not be able to see the new data source. <b>To do this right click on the data source node and again define the name of the query. This will reload the new structure from the query.</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibKTjCa7fgacU8oee2SFpAxBoWOKqk1ufIBlWqo09umroAi05N5ggH6dL-CGCa_XI0Kvj8b_fa8Y3KT-SOgcl3ZMM2Vw5sFJx6lIeeJUBzcbfd4dSmTYQbf65lbDxrITJmNc8gWCU77-E/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibKTjCa7fgacU8oee2SFpAxBoWOKqk1ufIBlWqo09umroAi05N5ggH6dL-CGCa_XI0Kvj8b_fa8Y3KT-SOgcl3ZMM2Vw5sFJx6lIeeJUBzcbfd4dSmTYQbf65lbDxrITJmNc8gWCU77-E/s640/3.png" width="640" /></a></div>
<br />
<br />
4. Then you can view the data source which you added in the query and then can drag the fields in the grid.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Of8QTGeR5qOcjTNh4G339aU-FYo1HZmZ5XSmwcNdYAiHwFoRjlHY5rJfmK_OK72SHJa77lIC-gudFCRVeetg-eQY0kDgXCvVh2iTrRqIdPUEad_bSsZpjcYsQy0d_b2CAqvMfwz3neE/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Of8QTGeR5qOcjTNh4G339aU-FYo1HZmZ5XSmwcNdYAiHwFoRjlHY5rJfmK_OK72SHJa77lIC-gudFCRVeetg-eQY0kDgXCvVh2iTrRqIdPUEad_bSsZpjcYsQy0d_b2CAqvMfwz3neE/s400/4.png" width="400" /></a></div>
<br />
<br />
Thanks for reading the blog.<br />
<br />
<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com1tag:blogger.com,1999:blog-7958075616064009946.post-20189282253246079432013-11-27T00:18:00.002-08:002013-11-27T00:18:43.465-08:00AX2012 R2: Adding generic custom validations when posting sales orders<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
It is good to keep this information handy so I posted on the blog.<br />
If we need to add our own custom validation for salesTable/Customer record when performing posting on sales orders, then the best place to write the logic is \Classes\SalesFormletterProvider\checkHeading().<br />
This function is called to check some generic rules for salesTable or Customer during any type of posting (Confirmation/Picking/Packing/Invoicing) process of sales order.<br />
<br />
See below the way standard AX does it.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi12QS0lfmZy_1P8VTne1aOGDrVqD57ib-PPD0VvjDvus1QP8-amYYYzQ0j-miScvCT2jQUgAZFnHWdgWdUfEvon_w9UXkG34OGaB0PrvNUu03bzReuWt43J0afHIGoz-tWNfsNaTX05y4/s1600/p1.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi12QS0lfmZy_1P8VTne1aOGDrVqD57ib-PPD0VvjDvus1QP8-amYYYzQ0j-miScvCT2jQUgAZFnHWdgWdUfEvon_w9UXkG34OGaB0PrvNUu03bzReuWt43J0afHIGoz-tWNfsNaTX05y4/s640/p1.png" width="640" /></a><br />
<br />
<br />
You can create a method on salesTable which returns a boolean value and call it along with other standard AX validations.<br />
You can check the posting type by using the function this.parmDocumentStatus() so that if you want to run validation only for specific posting type you can run it.<br />
Note this approach should only be taken when you have to add some generic validations applicable on all types of posting.<br />
<br />
Thanks for reading the blog.<br />
<br />
<br />
<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com0tag:blogger.com,1999:blog-7958075616064009946.post-797964612631378512013-11-22T16:47:00.002-08:002013-11-22T16:47:38.543-08:00AX2012 R2 : X++ Code to create picking list journal for a production order<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
Below is the sample of X++ code which can be used to create a picking list journal for a production order.<br />
The journal header table is ProdJournalTable and the lines are stored in ProdJournalBOM table.<br />
The table are related on the basis of Journal Type and Journal ID. The relation is defined on ProdJournalBOM table as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ-7tarCKIM0UbQoqxkRmkGUQQBOE_qY9Rme6OWb5oRdmZsHuiBscZutaxf0QmdMmtEKSgEqHQr0RHGCfbIffE_etTbkrjOn_2S55PvezUxKXrUL2NTzv6P_3-MM3FbRXiW66_rEdcQc/s1600/relation.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ-7tarCKIM0UbQoqxkRmkGUQQBOE_qY9Rme6OWb5oRdmZsHuiBscZutaxf0QmdMmtEKSgEqHQr0RHGCfbIffE_etTbkrjOn_2S55PvezUxKXrUL2NTzv6P_3-MM3FbRXiW66_rEdcQc/s1600/relation.png" height="240" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
If you take a closer look, the 0 element in Base Enum of journal type field is "Picking list"<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3bsSma7sEQyONVQapfX4lfaehZQCJ3HYCWTTTtpTNlqKDtRXtJLl64xP6oy1tVuDoaQVC9pSyRf3f_n5yVXNO6iRmQFrAvbvni_rSKgk3Y2lvgOyBka3PxZfOzdqiEVsBrrEW7geNlyg/s1600/journaltype.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3bsSma7sEQyONVQapfX4lfaehZQCJ3HYCWTTTtpTNlqKDtRXtJLl64xP6oy1tVuDoaQVC9pSyRf3f_n5yVXNO6iRmQFrAvbvni_rSKgk3Y2lvgOyBka3PxZfOzdqiEVsBrrEW7geNlyg/s1600/journaltype.png" height="155" width="640" /></a><br />
<br />
<br />
So the header table for all the journal types of production orders is ProdJournalTable. The lines table differ and can be easily traced from the forms and relations.<br />
<br />
For illustration purpose I have hard coded some values but in real time u can get these form your functions/parameters/maps/list etc. Also I have created only one line, in real time scenarios you can have a list/function/while loop to create the lines for multiple items.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNC2loM-kkqwbiOYRN0aS8mKpr-MvVQ3txnY9L_CB0Tv1WgGfjuP4Ezq8tOb5YxG1ZGqmsN_ShyZxQTo3PXrgukichXDsvx05jQ_v5e66_VZybzLNzV90u2YWjEivD2rBKkkEDs1Bk3IQ/s1600/pickListJournal.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNC2loM-kkqwbiOYRN0aS8mKpr-MvVQ3txnY9L_CB0Tv1WgGfjuP4Ezq8tOb5YxG1ZGqmsN_ShyZxQTo3PXrgukichXDsvx05jQ_v5e66_VZybzLNzV90u2YWjEivD2rBKkkEDs1Bk3IQ/s1600/pickListJournal.png" height="347" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The difference see from AX2009 is the way we initialize voucherSeqRecId field of the journal header as it now stores the RecId of the voucher number sequenceID.<br />
<br />
There are more fields in the prodJournalBOM table but with the minimum fields I included in the job, journal can be created and posted. In case you have record of ProdBOM table available for which you want to create the journal line then the task becomes more easy as you can call initFromProdBOM() function of the prodJournalBOM table as it can initialize the following fields and we can eliminate these lines from our job:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTjMhWmqjXWxa6cC8uHPtuhIU1200T4gifVMqUpfChCipJn5opQHuTanBo__ErNRWWHHhpyI2EHSm-ZrMHQot1HZxPMPUTC4u2nm5ycu5X_VuAhS0IaPEfA3mzlS_b6NLFbEO6I7sSm8/s1600/initProdBOM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTjMhWmqjXWxa6cC8uHPtuhIU1200T4gifVMqUpfChCipJn5opQHuTanBo__ErNRWWHHhpyI2EHSm-ZrMHQot1HZxPMPUTC4u2nm5ycu5X_VuAhS0IaPEfA3mzlS_b6NLFbEO6I7sSm8/s1600/initProdBOM.png" height="142" width="400" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
If you want to quickly reuse the code, here it is:<br />
<br />
static void samplePickingListJournal(Args _args)<br />
{<br />
ProdJournalTable prodJournalTable;<br />
ProdJournalBOM prodJournalBOM;<br />
ProdTable prodTable = prodTable::find("PO-001159");<br />
<br />
prodJournalTable.clear();<br />
prodJournalTable.initValue();<br />
prodJournalTable.JournalType = ProdJournalType::Picklist;<br />
prodJournalTable.JournalNameId = 'pickJrnl';<br />
prodJournalTable.Description = " Prod pick list journal";<br />
prodJournalTable.ProdId = prodTable.ProdId;<br />
prodJournalTable.VoucherDraw = JournalVoucherDraw::Post;<br />
prodJournalTable.VoucherSeqRecId = NumberSequenceTable::find(ProdParameters::numRefProdJournalVoucherId().NumberSequenceId).RecId;<br />
prodJournalTable.insert();<br />
<br />
prodJournalBOM.clear();<br />
prodJournalBOM.initValue();<br />
prodJournalBOM.JournalId = prodJournalTable.JournalId;<br />
prodJournalBOM.initFromInventTable(InventTable::find("MAT001"));<br />
prodJournalBom.ProdId = prodTable.ProdId;<br />
prodJournalBom.LineNum = 1;<br />
prodJournalBom.InventDimId = "DIMID-99876";<br />
prodJournalBom.TransDate = systemDateGet();<br />
prodJournalBom.BOMUnitId = "Pcs";<br />
prodJournalBom.BOMConsump = 10;<br />
prodJournalBom.InventConsump = 10;<br />
prodJournalBom.insert();<br />
ttsBegin;<br />
prodJournalTable.selectForUpdate(true);<br />
prodJournalTable.NumOfLines = 1;<br />
prodJournalTable.update();<br />
ttsCommit;<br />
info(strFmt("Journal %1 created",prodJournalTable.JournalId));<br />
}<br />
<br />
Thanks for reading the blog.<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com3tag:blogger.com,1999:blog-7958075616064009946.post-21361499016839435142013-06-15T04:30:00.003-07:002013-06-15T08:09:30.138-07:00AX2012 R2 : Creating product variants based on generic product model using X++Hi Friends,<br />
In one of my recent tasks, I was required to automatically create the product variants for a product master as per all the suggested product variants by the system based on generic product model. So I need to automate the below shown process which if done manually for all items will consume lot of time:<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiPw6fODsCBEUDW8zvZCerkpMVYKZZjsEJAtZhrkms5dyvdkHtoTBMQtS-el5ypLNfKHlvNB_o_zBFN7w_Zxw2CD8kKSS6gPaA5mAlB9HDzNEoTNK0sNnlUUAbLXJdejNdtiS73xLxnDs/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiPw6fODsCBEUDW8zvZCerkpMVYKZZjsEJAtZhrkms5dyvdkHtoTBMQtS-el5ypLNfKHlvNB_o_zBFN7w_Zxw2CD8kKSS6gPaA5mAlB9HDzNEoTNK0sNnlUUAbLXJdejNdtiS73xLxnDs/s1600/1.png" height="336" width="400" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
These variant suggestions are based on the defined product variants ( refer to my previous post to get technical understanding of tables storing this information <a href="http://basicax.blogspot.in/2013/06/ax2012-r2-understanding-technical.html" target="_blank">here</a>).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So I did some technical analysis and found the following:</div>
<ul>
<li><div style="text-align: left;">
The class used by standard AX to create variant suggestion is EcoResProductVariantCreationMgr.</div>
</li>
<li><div style="text-align: left;">
It populates a temperory table to store all the variant suggestions, but by default is keeps the selected field as false.</div>
</li>
<li>The function filling this temperoary table is a buildVariantSuggestion() is a protected function, so I cannot call it directly from my code.</li>
</ul>
<div style="text-align: left;">
So there were few challenges in directly using this class from my job but with few simple customizations in this class, I was able to utilize this class for creating the product variants in a much simple way rather then re writing all the logic inside the class in my job. So I did the following changes:</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
1. Added a new boolean variable in class declartion and created a parm method for it. This is to initialize this variable when it is called from my custom code and tweak the way temperory table is created:</div>
<div style="text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSHdEQViPcHxILL84LqzSwaRa2ahQgb-b5KOV5W8t3szyeyfkjMn2nGZugoazGmsDHBcVEsy6yNfraUnxRLms-f400mm1nwvfj0LE62kJRRl8Noc4TGYTvJBEQQCLlJpE3EHRCDNAWFGs/s1600/2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSHdEQViPcHxILL84LqzSwaRa2ahQgb-b5KOV5W8t3szyeyfkjMn2nGZugoazGmsDHBcVEsy6yNfraUnxRLms-f400mm1nwvfj0LE62kJRRl8Noc4TGYTvJBEQQCLlJpE3EHRCDNAWFGs/s1600/2.png" height="211" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvJ7zt3aVzhnWYQ2iuwStWTI-zJ8GFfSR9TZPQaxh88eljsLuYZqyS8QZhC0VME4NbcqprnZUXnyNvJEiUgPBcn0NrGJUycnraQSXG1DiZsRAjWbr1xLkFe4SPcLMq300l3I0HHAPqgJY/s1600/3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvJ7zt3aVzhnWYQ2iuwStWTI-zJ8GFfSR9TZPQaxh88eljsLuYZqyS8QZhC0VME4NbcqprnZUXnyNvJEiUgPBcn0NrGJUycnraQSXG1DiZsRAjWbr1xLkFe4SPcLMq300l3I0HHAPqgJY/s1600/3.png" height="411" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
2. Changed to access modifier of the buildVariantSuggestion() </div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VJgSHRPM0CA-kfEc1L9rPMN2ct7HBEnZf3uTG4nDo3u6XwG1XC8REsAg4lFxV-4WgPm0iOknvosPbbZvSuMpd0RpC-Y7VEFxG1kwYyVQMxtKW4vKaMkTZZoN3wIU4qivWWkPxBzrYWg/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VJgSHRPM0CA-kfEc1L9rPMN2ct7HBEnZf3uTG4nDo3u6XwG1XC8REsAg4lFxV-4WgPm0iOknvosPbbZvSuMpd0RpC-Y7VEFxG1kwYyVQMxtKW4vKaMkTZZoN3wIU4qivWWkPxBzrYWg/s1600/4.png" height="183" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
3. In case the class is called from custom code then we need to mark the records as selected:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrDRaX1TvqqW_TGu5xRlvMzyjED5CoG9q4yF74ZGHABu4xqIU9d4OD6_v0BtwnDlxm5Fe3e50f5tfvweYv9qAy5jX-AutSo-ApXGn8cdPQqKQbTHxNG8W3tqcthjXn7jV84353VmmLhjg/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrDRaX1TvqqW_TGu5xRlvMzyjED5CoG9q4yF74ZGHABu4xqIU9d4OD6_v0BtwnDlxm5Fe3e50f5tfvweYv9qAy5jX-AutSo-ApXGn8cdPQqKQbTHxNG8W3tqcthjXn7jV84353VmmLhjg/s1600/5.png" height="321" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So with the above three modifications in standard AX class, I was ready to use this class in my job and I created the below sampe piece of job:</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbV_-TkI8Bstox6ew2u_PYx6TUtnYfF_XzId_dc-bXe83MoAg9SMpIihriQXct93ybha1NP6t0gPU2i7Z48ET9TFnPkHDugtrbrwhgHL4ruN04Dbv5s2oUqKrdmYFzXFUW1k6NWOPncHQ/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbV_-TkI8Bstox6ew2u_PYx6TUtnYfF_XzId_dc-bXe83MoAg9SMpIihriQXct93ybha1NP6t0gPU2i7Z48ET9TFnPkHDugtrbrwhgHL4ruN04Dbv5s2oUqKrdmYFzXFUW1k6NWOPncHQ/s1600/6.png" height="249" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We assigned the EcoResProductMaster record in the args and used that to initialize the class, used the RecId of the productMaster to find the record. </div>
<div class="separator" style="clear: both; text-align: left;">
Then we called the parmCalledFromJob method and set it as true to tell system that this class is trigerred from my custom code. </div>
<div class="separator" style="clear: both; text-align: left;">
We called the buildVariantSuggestions() , as this is no longer protected I can directly call from my job [This design can be improved by creating a child class instead of changing the access modifier]. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So now I ran the job for the same product which I have shown in the first screenshot:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhHgWGmrDHPrGJ586-2u-JpLIyR_fz00tppncjcoYQliq7VWcZcW4uV_5nB0wjggfwhijvnRu3ClfWr5goUJaYS9ZTalkk7BwXSYXEfKvR7jmx9QkNEJ2t6QFi2SGsSN2CaLpXhJAz7Q/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhHgWGmrDHPrGJ586-2u-JpLIyR_fz00tppncjcoYQliq7VWcZcW4uV_5nB0wjggfwhijvnRu3ClfWr5goUJaYS9ZTalkk7BwXSYXEfKvR7jmx9QkNEJ2t6QFi2SGsSN2CaLpXhJAz7Q/s1600/7.png" height="321" width="400" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhHgWGmrDHPrGJ586-2u-JpLIyR_fz00tppncjcoYQliq7VWcZcW4uV_5nB0wjggfwhijvnRu3ClfWr5goUJaYS9ZTalkk7BwXSYXEfKvR7jmx9QkNEJ2t6QFi2SGsSN2CaLpXhJAz7Q/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><br />
<div style="text-align: left;" unselectable="on">
</div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhHgWGmrDHPrGJ586-2u-JpLIyR_fz00tppncjcoYQliq7VWcZcW4uV_5nB0wjggfwhijvnRu3ClfWr5goUJaYS9ZTalkk7BwXSYXEfKvR7jmx9QkNEJ2t6QFi2SGsSN2CaLpXhJAz7Q/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;">
</a><br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
and then when we look at product variants, we see that system has created the product variants :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKi-t1zs9aF8HdwxtC2PamR4TuhmDgPOU-zxl1vmK8jCTkUjzNK0FOkb4nqUTaLGfNFEByk7rGcVZrEqQsGVA_eWzkHcxySnAoGVBehMGQeD0j9YkMx7zvDpbYGgT4fEZve8S4MiEuxs8/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKi-t1zs9aF8HdwxtC2PamR4TuhmDgPOU-zxl1vmK8jCTkUjzNK0FOkb4nqUTaLGfNFEByk7rGcVZrEqQsGVA_eWzkHcxySnAoGVBehMGQeD0j9YkMx7zvDpbYGgT4fEZve8S4MiEuxs8/s1600/8.png" height="240" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
P.S --> Before modifying EcoResProductVariantCreationMgr class, please check if this is not conflicting with any other modifications in your system. Especially modifiyng the access modifier is not a recommened thing to do always, however I did this as it was a one time job which we need to run and then reverted back the changes. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Sometimes it is much easy to tweak the standard AX objects and leverage the existing code instead of rewriting the whole logic.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Till my next post.....take care friends and keep sharing.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com13tag:blogger.com,1999:blog-7958075616064009946.post-34805662490062962812013-06-07T12:15:00.000-07:002013-06-07T12:15:01.724-07:00AX2012 R2 : Understanding technical design of product dimensions data Hi, <br />
<br />
In this blog we will take a dive into tables storing product dimension data for product master and also look at the code which we can use to generate this data automatically. <br />
Standard Microsoft Dynamics AX 2012 R2 provide the following product dimensions: Configuration, Size, Color, Style. For each dimension there is a master table as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl27zL8kGKMH5HZ4hEWVZwtZLYcS0p9rxJqofLyrx4r9SOGeMwlGULmFMjeYWJwPlmWUo6HCLUFibVkbk0xyBX7lBerXKUQt1FagSNs8uuW-zqKlDITN_LNZjAZO1we0t7-3-nt2SeQLA/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl27zL8kGKMH5HZ4hEWVZwtZLYcS0p9rxJqofLyrx4r9SOGeMwlGULmFMjeYWJwPlmWUo6HCLUFibVkbk0xyBX7lBerXKUQt1FagSNs8uuW-zqKlDITN_LNZjAZO1we0t7-3-nt2SeQLA/s1600/1.png" height="203" width="640" /></a></div>
<br />
<br />
Notice that each master table has only one field called "Name" and each master table has unique index defined on this field. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicS7qCfcBZJREpEYHvrb-fghiCZAoS5OY4R9wh4SBZI8x31V5KoVofFkkQI3wKkf-ORFZ5c4PGVGSqYj39CS5_aZs9jxzcJG4o1-HOAgGCK8FYdlGPb3DtMz9qt5IO7z4o6rqL0ke0v1I/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicS7qCfcBZJREpEYHvrb-fghiCZAoS5OY4R9wh4SBZI8x31V5KoVofFkkQI3wKkf-ORFZ5c4PGVGSqYj39CS5_aZs9jxzcJG4o1-HOAgGCK8FYdlGPb3DtMz9qt5IO7z4o6rqL0ke0v1I/s1600/2.png" height="203" width="400" /></a></div>
<br />
So the above table hold the <strong>master data for the product dimensions</strong> in the system. <br />
<br />
Now there are another set of 4 table which store the <strong>product dimension data for a product master</strong>. Shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-k4thTbNC_bMw_Voe1_Hg4aBxbnbaYy2VS0EYlwpESTqB75VgsaLnUbVprb02Epxk6DJK5JDhSk5mVh-GwUDyJ_8WnzywWgjzjjYWLEFVPcerNN_QNACm2V3xSR4K1bJJoj2d5hdNhO8/s1600/3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-k4thTbNC_bMw_Voe1_Hg4aBxbnbaYy2VS0EYlwpESTqB75VgsaLnUbVprb02Epxk6DJK5JDhSk5mVh-GwUDyJ_8WnzywWgjzjjYWLEFVPcerNN_QNACm2V3xSR4K1bJJoj2d5hdNhO8/s1600/3.png" height="160" width="640" /></a></div>
The above 8 tables can be seen as datasources on EcoResProductMasterDimension form where we define the product dimension data for product master. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj83OUjBV3Pe9cksfHptIGW6W6JSn5Qj0aE_DV98o5LHnkhHterCB2sAk-r_vnIo-uHiioABNJ0bKJd5fXDlLK-hBoBgSu4Xuwf-_idQC9JT3ykVA_CcvtdY2HBe53U7JUDntS3m4DpgAI/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj83OUjBV3Pe9cksfHptIGW6W6JSn5Qj0aE_DV98o5LHnkhHterCB2sAk-r_vnIo-uHiioABNJ0bKJd5fXDlLK-hBoBgSu4Xuwf-_idQC9JT3ykVA_CcvtdY2HBe53U7JUDntS3m4DpgAI/s1600/5.png" /></a></div>
<br />
For understanding purposes let us focus on configuration dimension and try to explore EcoResProductMasterConfiguration table. <br />
<br />
If we notice the fields and relations on this table, we see it is storing the following references in each record:<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0pXWFT7wMMfuzY2YxZsraCiSLKDRVtkElkAw9tXEVAkfnAW8TcxSH6FmXeop1QuLm2XByBkhyphenhyphenRTHi5IzbGzDbkX2VXqYGdXTNcbIiB-du7V2eM9x6-jGkg3UyjyS6LLfOqiIHQZR4aw/s1600/4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0pXWFT7wMMfuzY2YxZsraCiSLKDRVtkElkAw9tXEVAkfnAW8TcxSH6FmXeop1QuLm2XByBkhyphenhyphenRTHi5IzbGzDbkX2VXqYGdXTNcbIiB-du7V2eM9x6-jGkg3UyjyS6LLfOqiIHQZR4aw/s1600/4.png" height="239" width="400" /></a><br />
<br />
<ul>
<li><div class="separator" style="clear: both; text-align: left;">
ConfigProductMaster --> Stores RecId of product master</div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Configuration --> Stores the RecId of EcoResConfiguration ( This is the master table configurations)</div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
ConfigProductDimensionAttribute --> Stores RecId of dimension attribute [Let's park this field for now , we'll come to it later]</div>
</li>
</ul>
<div class="separator" style="clear: both; text-align: left;">
So now once we have understood how the tables are related, let's see the X++ code which we can create product dimensions for a product master by pulling data from the master tables. </div>
<div class="separator" style="clear: both; text-align: left;">
[P.S --> Currently we are focussing only on product dimension configuration]</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6vYevuU6HrokbXCRQm20aJcS7U_CEYPNrmN_-IGtPrT1WIZVx_cWQRN8dwR8_MOp-Iz_1D0Tk4xYa9HJc-rjzUdytQoHpfeJrBb3i2dKS9Zce-nsaZSi1BbuG94ENTTNw8RdK6BR2rn0/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6vYevuU6HrokbXCRQm20aJcS7U_CEYPNrmN_-IGtPrT1WIZVx_cWQRN8dwR8_MOp-Iz_1D0Tk4xYa9HJc-rjzUdytQoHpfeJrBb3i2dKS9Zce-nsaZSi1BbuG94ENTTNw8RdK6BR2rn0/s1600/6.png" height="195" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
So now let's understand the above code: The logic is pretty simple, we just need to know the recId of product master and the dimension for which we are going to create the product dimensions [In this case Configuration]. Loop through the ecoResConfiguration table and insert record for Product master. </div>
<div class="separator" style="clear: both; text-align: left;">
But the interesting thing to notice is, the way we have initialized ConfigProductDimensionAttribute. This field stores refRecId. The same code can be found on the standard AX form where we create product dimensions for product master, shown below:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0ijKiIyIfuxLGCRk6B-XV-lGzkLF_CXlMIIxvB3g4RsOj0CS3yye3N8xKrEPn8vY81VC7lgQsdHPUq7ts0wqlnAjXfmZ0Mcaq5rOGPhNARWG1C5l4j3ZGia-j3OuNGUQw42HU4SBndVQ/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0ijKiIyIfuxLGCRk6B-XV-lGzkLF_CXlMIIxvB3g4RsOj0CS3yye3N8xKrEPn8vY81VC7lgQsdHPUq7ts0wqlnAjXfmZ0Mcaq5rOGPhNARWG1C5l4j3ZGia-j3OuNGUQw42HU4SBndVQ/s1600/7.png" height="152" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So to understand this field ( which we parked earlier), let's take a closer look at the table EcoResProductDimensionAttribute</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7whHgvtKnjO8d5WU13h-QNJBaLERBhGlL7_wKwL5xxY8UfQyzU3sR71SudP1eCxh9uAZAOpP3ItQDlgd3o5dejqzJCvIgADsOHnFzUMmoTaFQCpN7qDNZFbcIdO-SIwRSN_7N8JZTes/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7whHgvtKnjO8d5WU13h-QNJBaLERBhGlL7_wKwL5xxY8UfQyzU3sR71SudP1eCxh9uAZAOpP3ItQDlgd3o5dejqzJCvIgADsOHnFzUMmoTaFQCpN7qDNZFbcIdO-SIwRSN_7N8JZTes/s1600/8.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
We will see this table only holds a single field DimensionTableId which is actually a RefTableId. </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
On closer look if we look in the table browser, the records in this table store the tableId of the dimension master tables [EcoResSize, EcoResConfiguration, EcoResColor, EcoResStyle] , see below the example for EcoResConfiguration:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0T_s2pJcVRRrHYwrcV-2rpm37g9XKG6Tm_EYfGqoFogGkZXqJeb-VNFZdVRvQChoeRfcCybWfCdPNDjB90XheLOCSv5_8YxNKtDCj6qZiMp6dMra4S9OdPOFK7JHkCQGXpCI5f_AV5fY/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0T_s2pJcVRRrHYwrcV-2rpm37g9XKG6Tm_EYfGqoFogGkZXqJeb-VNFZdVRvQChoeRfcCybWfCdPNDjB90XheLOCSv5_8YxNKtDCj6qZiMp6dMra4S9OdPOFK7JHkCQGXpCI5f_AV5fY/s1600/9.png" height="236" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Well doesn't it looks odd to have table Id stored in a table, and in order to get the recId of that record we are using a static function </div>
<span style="font-family: Consolas; font-size: xx-small;"><span style="font-family: Consolas; font-size: xx-small;">EcoResProductDimensionAttribute::inventDimFieldId2DimensionAttributeRecId(</span></span><b><span style="color: darkblue; font-family: Consolas; font-size: xx-small;"><span style="color: darkblue; font-family: Consolas; font-size: xx-small;"><span style="color: darkblue; font-family: Consolas; font-size: xx-small;">fieldNum</span></span></span></b><span style="font-family: Consolas; font-size: xx-small;"><span style="font-family: Consolas; font-size: xx-small;">(InventDim, ConfigId));</span></span><br />
<div class="separator" style="clear: both; text-align: left;">
in which we pass the fieldNum of ConfigId field of InventDim Table !!!!!!! </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
The answer lies in the static function itself, see below the function:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi83OFWkzEuqATQ0ou7Rse70fZzVGRKFrAG86uGvIEIeAnSuOwKqeXuzvMZMsUB4oI6_hETJg8CTAzV7roAYaLUFb5rBANgT627KcOgDqTzMlVVtZU2gqdCw7QNaaSWeGeRq6wDPyU8JvU/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi83OFWkzEuqATQ0ou7Rse70fZzVGRKFrAG86uGvIEIeAnSuOwKqeXuzvMZMsUB4oI6_hETJg8CTAzV7roAYaLUFb5rBANgT627KcOgDqTzMlVVtZU2gqdCw7QNaaSWeGeRq6wDPyU8JvU/s1600/10.png" height="320" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
The tableId is being determined by the configId fieldNum of InventDim table. What I think is that Microsoft wants to make sure that we do not use these tables for storing incorrect data and we can refer to them from dimension fieldID's itself. I see this might provide a tight binding of data model from code for storing dimensions. No one really wants to mess them ;)</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So now show time, let's create a product master with attach a product dimension with only color enabled in it. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbyaxc1CnBWkklm_C07tXKbi5PLalDt0_rWBsedyMwLrZR_ovHe4nYJhvGJpPgJcMJsACGl4ghH53lYIw_WTjVlED5Xwss98o6v2NDfkSdsEK9c6r7JZPytYe9N6RszHK84ZhVmdyh3os/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbyaxc1CnBWkklm_C07tXKbi5PLalDt0_rWBsedyMwLrZR_ovHe4nYJhvGJpPgJcMJsACGl4ghH53lYIw_WTjVlED5Xwss98o6v2NDfkSdsEK9c6r7JZPytYe9N6RszHK84ZhVmdyh3os/s1600/12.png" height="248" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So now once the product master is created, let's see what are the colors stored in EcoResColor table:</div>
<div class="separator" style="clear: both; text-align: left;">
To do this we can view details of colors available from the form where we define color dimensions for product master </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO656FOxeEWiAS3aG4FWPMu_mDh2a_9c5s5RBexS2OURVC9UFWO_JKJEbnJeBk4xQwTShgekmZLUM0Fo9NxdPbTxl_0_jD_hLnrbcjAJedT3KExmfrCeAvRrEfbFENjOsg0PmeTX4Zcww/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO656FOxeEWiAS3aG4FWPMu_mDh2a_9c5s5RBexS2OURVC9UFWO_JKJEbnJeBk4xQwTShgekmZLUM0Fo9NxdPbTxl_0_jD_hLnrbcjAJedT3KExmfrCeAvRrEfbFENjOsg0PmeTX4Zcww/s1600/13.png" height="371" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So now we need a programme define all these colors for this product master, let's use the code I mentioned above but with the tables of color dimensions this time: so let's execute the code: [ notice this time we have used tables storing colorId]</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheYlVdBkAExGuXG57wTJ_VUFby7QHHlaX5o-xZMCgL60PlHxsvBy5NRdUQBRNfOLia3LO8IxVBA8J7_ueUpAU34Jq3uVv8_FVi1Pn1IKCh-BqUdn4wv_MycUqrlsclKiT-0MXX4Ec3Cug/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheYlVdBkAExGuXG57wTJ_VUFby7QHHlaX5o-xZMCgL60PlHxsvBy5NRdUQBRNfOLia3LO8IxVBA8J7_ueUpAU34Jq3uVv8_FVi1Pn1IKCh-BqUdn4wv_MycUqrlsclKiT-0MXX4Ec3Cug/s1600/14.png" height="191" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Once the code is executed and now let go to product dimension form for the product master and see the color are defined for the product master:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfscJQbVegaDxDtyea_YVRVXPHP9qDlLESy2QA3sZ-RlyvjHrNQ6vCplTcFW0ckOCrl1iBLAYiApZ8HtgCCpLHZO4YvOhjAPYNh9817iOWTiNY_ImoRWt8B4YJRsWRyKtrggRJxN0uTJ0/s1600/15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfscJQbVegaDxDtyea_YVRVXPHP9qDlLESy2QA3sZ-RlyvjHrNQ6vCplTcFW0ckOCrl1iBLAYiApZ8HtgCCpLHZO4YvOhjAPYNh9817iOWTiNY_ImoRWt8B4YJRsWRyKtrggRJxN0uTJ0/s1600/15.png" height="248" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So the above code can be useful in implementing product master for companies which have a common dimension master data which they want to assign to all products. </div>
<div class="separator" style="clear: both; text-align: left;">
In my next blog I'll continue to explain on how we can create released product variants from the product dimension data defined for product master.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Till then take care friends and keep sharing!!!!</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<br />
<br />
<br />
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com6tag:blogger.com,1999:blog-7958075616064009946.post-65859667279932163752013-05-21T10:47:00.000-07:002013-11-26T03:14:43.434-08:00AX2012 R2 : X++ code to create and post Inventory Movement Journal<div dir="ltr" style="text-align: left;" trbidi="on">
Below is X++ code which is good to keep handy. It can be used to create and post inventory movement journals in AX 2012 R2. I have use hard coded values for illustration purpose:<br />
<br />
<br />
<div style="background-color: white;">
</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
InventJournalTable <wbr></wbr> inventJournalTable;<br />
InventJournalTrans <wbr></wbr> inventJournalTrans;</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
InventJournalNameId inventJournalName;<br />
InventDim <wbr></wbr> inventDim;<br />
JournalCheckPost <wbr></wbr> journalCheckPost;<br />
<br />
//Below code creates journal header </div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTable.clear();</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalName = InventJournalName::<span style="font-size: 12.727272033691406px;">standardJournalName(</span><wbr style="font-size: 12.727272033691406px;"></wbr><span style="font-size: 12.727272033691406px;">InventJournalType::Movement);</span><br />
inventJournalTable.<wbr></wbr>initFromInventJournalName(<wbr></wbr>InventJournalName::find(inventJournalName <span style="font-size: 12.727272033691406px;">))</span><wbr style="font-size: 12.727272033691406px;"></wbr><span style="font-size: 12.727272033691406px;">;</span></div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
<span style="font-size: 12.727272033691406px;"> inventJournalTable.insert();</span></div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
<br />
//Below code creates journal lines</div>
<div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.clear();</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.<wbr></wbr>initFromInventJournalTable(<wbr></wbr>inventJournalTable);</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.TransDate = systemDateGet();</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.ItemId = "MDJ0001";</div>
<span style="color: #222222; font-family: arial, sans-serif; font-size: x-small;"> inventJournalTrans.initFromInventTable(InventTable::find(</span><span style="color: #222222; font-family: arial, sans-serif; font-size: 13px;">"MDJ0001"</span><span style="color: #222222; font-family: arial, sans-serif; font-size: x-small;">));</span><br />
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.Qty = 2500;</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventDim.InventSiteId = '12';</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventDim.InventLocationId = '1201';</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventDim.wMSLocationId = 'BULK-001';</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.InventDimId = inventDim::findOrCreate(<wbr></wbr>inventDim).inventDimId;</div>
</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
inventJournalTrans.insert();</div>
<div style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px;">
<br /></div>
<br />
<span style="color: #222222; font-family: arial, sans-serif;"><span style="font-size: 12.666666984558105px;"> //The below code posts the journal</span></span><br />
<span style="color: #222222; font-family: arial, sans-serif;"><span style="font-size: 12.666666984558105px;"> journalCheckPost = InventJournalCheckPost::newPostJournal(inventJournalTable);</span></span><br />
<span style="color: #222222; font-family: arial, sans-serif;"><span style="font-size: 12.666666984558105px;"> journalCheckPost.run();</span></span><br />
<br />
<br />
<br />
<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-24256565661719418822013-03-22T23:43:00.000-07:002013-03-22T23:43:04.706-07:00AX2012: X++ code to get on hand on an item<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
In this post I would like to share a small piece of code using which we can get oh hand values for an item. Before jumping to it I would first like to share some basic information related to on hand information.<br />
What do we need to know when we have to calculate on hand of an item?<br />
Let us take the below example:<br />
A company has one site , two warehouses , each warehouse has four locations and each location has two pallets. Each pallet is having 10 Pcs of an Item "CAB001" . I have illustrated the view in the below diagram:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPv_tMWTjVJPsNUDMEIxUIBO3JSZ24uQ_7PvjkIcLmJLocociZAOKlq3_ILiIe30OfB3fAtUO-bDO2Er1YduV6co_iEn8F98TiynNnamZNa87LxaVys7MDZPflTEXr8Nirc58jlQ3mp1c/s1600/onh1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPv_tMWTjVJPsNUDMEIxUIBO3JSZ24uQ_7PvjkIcLmJLocociZAOKlq3_ILiIe30OfB3fAtUO-bDO2Er1YduV6co_iEn8F98TiynNnamZNa87LxaVys7MDZPflTEXr8Nirc58jlQ3mp1c/s400/onh1.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Now if someone ask you what is the on hand of item "CAB001" you might respond back with a question : Where, in warehouse WH001 or in WH001 - Loc001 or in WH002-Loc003-P5 ??<br />
The person will elaborate the question again: What is on hand of item "CAB001" in Warehouse WH001-Loc 003? And then you can easily say that the on hand is 20 Pcs. So let's try to see on hand values of our sample item in some different cases:<br />
Site S001 --> 160 Pcs<br />
Site S001, Warehouse WH001 --> 80 Pcs<br />
Site S001, Warehouse WH002 - Loc002 --> 20 Pcs<br />
Site S001, Warehosue WH002 - Loc004 - P7 --> 10 Pcs<br />
<br />
So you will notice that on hand value changes with reference to the combination of inventory dimensions i.e. InventDimID against which we need to calculate the on hand of an Item. In my previous post (<a href="http://basicax.blogspot.in/2013/03/ax2012-understanding-inventdimid.html" target="_blank">understanding-inventdimid</a> ) I have explained how an InventDimID refers to a combination of Inventory Dimensions.<br />
<br />
So now we know that in order to calculate on hand of an item we also need to know the inventory Dimensions against which we need to calculate it.<br />
Another thing which we need to know is what on hand value we want to calculate. If you look at on hand screen you can see that on hands are calculated with respect to various business meanings:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfP9pCx84xebfVKw4pbL7OdiFVbh7wUQF6u0hW9lmSYG_HpPptJ_JXXscEWmcH3GFJKoPnmPWZiSKrXQVqFagsaLkA47MmJPqFU8HluBbxwFMEUD8Fvk2seit3Lbpf4jiMkJIjNCbm6K0/s1600/onh2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="97" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfP9pCx84xebfVKw4pbL7OdiFVbh7wUQF6u0hW9lmSYG_HpPptJ_JXXscEWmcH3GFJKoPnmPWZiSKrXQVqFagsaLkA47MmJPqFU8HluBbxwFMEUD8Fvk2seit3Lbpf4jiMkJIjNCbm6K0/s400/onh2.png" width="400" /></a></div>
<br />
AX out of the box provides us with classes to calculate on hand values . We can use InventOnHand class to calculate the required on hand values, below is a sample job to calculate available physical qty of the item D0001 (as shown in above image) in site 1, WH 13:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBH4DXNm38zn39OZT9N-ZhM7PolSmDuVt8Pkz01jAtyCjO8l_wEinSo52eT9z237-bEoD34Xx29EwktVH-pwEiwnHFKJBLcXoFmpLo4nqKrCHvXFj3qRfcS3HsVKTTGXNzWvqZSlCAwWM/s1600/onh3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBH4DXNm38zn39OZT9N-ZhM7PolSmDuVt8Pkz01jAtyCjO8l_wEinSo52eT9z237-bEoD34Xx29EwktVH-pwEiwnHFKJBLcXoFmpLo4nqKrCHvXFj3qRfcS3HsVKTTGXNzWvqZSlCAwWM/s400/onh3.png" width="400" /></a></div>
<br />
Result and mapping shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBw0w3yiAS9QPSkQE2a9NpUCDMwba2-QBsi5IXX_rfn94Mpx_kpHOGOn1Wj_W9_RP1tFBamzhb4j2by00qqWZchxhONuSZ8YcZPh1FiLvb0ATyxCje5hSCK1qAUlEYoDIZd60HV4kOVA/s1600/onh6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBw0w3yiAS9QPSkQE2a9NpUCDMwba2-QBsi5IXX_rfn94Mpx_kpHOGOn1Wj_W9_RP1tFBamzhb4j2by00qqWZchxhONuSZ8YcZPh1FiLvb0ATyxCje5hSCK1qAUlEYoDIZd60HV4kOVA/s400/onh6.png" width="400" /></a></div>
<br />
<br />
InventOnHand class has other functions as well to return different qty , sample shown below:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgleq_xCa1vcCvBOVcxnTfAy694f3SObwOLdUeLGg63vclCfeGjoAGhr-Z44erflUPeb77CCa3CB6z43S4i4WiT2xnpmwUl-qD0JolzUjHGc_swkFi6CF5ZB9K-9BZogTiD8b4irtPQjYk/s1600/onh4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgleq_xCa1vcCvBOVcxnTfAy694f3SObwOLdUeLGg63vclCfeGjoAGhr-Z44erflUPeb77CCa3CB6z43S4i4WiT2xnpmwUl-qD0JolzUjHGc_swkFi6CF5ZB9K-9BZogTiD8b4irtPQjYk/s400/onh4.png" width="400" /></a></div>
We can also point to inventSum table object from invnetOnHand Class as get access to other on hand<br />
values as shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrMpk4dsmEAEOQWojfN8YqfyNazI11nQx5J5s9N8_u3to4n0JxVH70-jiU-kJMdvjT0-fRYPBKMZmnOlbpbONbg0JbXpq4KHTiNmJI_jS0s9JShdeUIVVoW8l9CmN8VZa9NBJPUdB9wvc/s1600/onh5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrMpk4dsmEAEOQWojfN8YqfyNazI11nQx5J5s9N8_u3to4n0JxVH70-jiU-kJMdvjT0-fRYPBKMZmnOlbpbONbg0JbXpq4KHTiNmJI_jS0s9JShdeUIVVoW8l9CmN8VZa9NBJPUdB9wvc/s320/onh5.png" width="320" /></a></div>
Use InventOnHand class and simplify your on hand calculations.<br />
Thanks!!!<br />
<br />
<br />
<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com9tag:blogger.com,1999:blog-7958075616064009946.post-10323067874520323982013-03-22T11:18:00.000-07:002013-03-22T11:18:05.101-07:00AX2012 : Understanding InventDimID<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Friends,<br />
In this post I will describe my view of what is InventDimID and how we can use it in our solutions.<br />
<br />
We know there are different inventory dimensions available in Microsoft Dynamics AX like Site, Warehouse, Location, Pallet, Batch number, Serial number etc. These can be active for an item based on the storage dimensions assigned on it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju_QI_eHkvQhphOHmV1NAGhldRakHfV6YP0QxfBwQcNX691VbIzPhmPDQydI2pWWROdw0mJgckCW2F_HsEYFOK8m7npGhOBTZrOMhxCbN4IKP_FL9vMdFBPT9zDm9Om2UcnDJcYoysYjc/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju_QI_eHkvQhphOHmV1NAGhldRakHfV6YP0QxfBwQcNX691VbIzPhmPDQydI2pWWROdw0mJgckCW2F_HsEYFOK8m7npGhOBTZrOMhxCbN4IKP_FL9vMdFBPT9zDm9Om2UcnDJcYoysYjc/s400/4.png" width="400" /></a></div>
<br />
Let us take an example, we have an Item "BRK6348" on which Site, Warehouse, Location, Pallet ID are active and we did an inventory transaction on this item say on Site '01', Warehouse 'Main', Location 'LOC001' and Pallet Id 'PLT001' and we want to design a table to store all these values on our custom transaction table.<br />
<br />
A simple approach is to add fields for all the inventory dimensions in your table. Imagine if there are 10 inventory dimensions in system then we need to add 10 fields in our table and if we have 100 inventory transactions for this item on the set of these inventory dimension combination then we will storing same data in 100 records in all 10 fields. This will bloat the database size and also impact the performance of queries on this table. A sample of such table would look like below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWpvCed9qC_IHK2dTsrDZ_MwfsGC4tBVRhA7CAQx8E1o4DrbLVUfWti2juikUcndhO0wbEnCQYuBHDhb7UrGKezRB9r7pulaancHZpZLHelgFFJiZlRzIMGLYt475w2n-jU3OKEBv0go/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWpvCed9qC_IHK2dTsrDZ_MwfsGC4tBVRhA7CAQx8E1o4DrbLVUfWti2juikUcndhO0wbEnCQYuBHDhb7UrGKezRB9r7pulaancHZpZLHelgFFJiZlRzIMGLYt475w2n-jU3OKEBv0go/s400/5.png" width="400" /></a></div>
<br />
Now to simplify this we create a new ID field which refers to a set of combination of these values. For example ID "10001" refers to Site '01', Warehouse 'Main', Location 'LOC001' and Pallet Id 'PLT001'. We also create a separate table to store values of these 10 fields along with this ID field and add ID field in our transaction table. So in all 100 records we can store data in only one ID field.<br />
We are not required to store data of 10 inventory dimensions fields 100 times, instead we just need to store value of 1 field in 100 records pointing to same combination of these inventory dimensions. A sample of such tables with some records will look as below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoCz2Imx44MiwoRmhMIPxBoTUBwuphir7xoNREh171rLawWdPs3VvL8BwFboK4ImNFnsYo0FmnzK-a91j2af9PusCh6AgUizY7XSMlQ6LphEzSpUhN-VIbQ_54tu13kb4nsxuIkfk2wVs/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoCz2Imx44MiwoRmhMIPxBoTUBwuphir7xoNREh171rLawWdPs3VvL8BwFboK4ImNFnsYo0FmnzK-a91j2af9PusCh6AgUizY7XSMlQ6LphEzSpUhN-VIbQ_54tu13kb4nsxuIkfk2wVs/s400/6.png" width="400" /></a></div>
<br />
This ID in Dynamics AX is known as InventDimID and the table which stores all the combinations of inventory dimensions and there ID is InventDim:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfX__X5glBz7Q4XBafSV05LW5aSp6EteuMFFHSIFUySc46EDSD7KFy_CrnbMJ83ud5YrqjgjFNm95uo54-3KGBmnice67bWeliqgWXKjTA_PKT62rZGS7zarmoFs9hycawM0YTQL3xyx4/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfX__X5glBz7Q4XBafSV05LW5aSp6EteuMFFHSIFUySc46EDSD7KFy_CrnbMJ83ud5YrqjgjFNm95uo54-3KGBmnice67bWeliqgWXKjTA_PKT62rZGS7zarmoFs9hycawM0YTQL3xyx4/s320/1.png" width="320" /></a></div>
<br />
This table plays very important role in AX. Any table which stores inventory dimensions in AX like salesLine, purchLine,inventTrans all have relation to inventDim table.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih9z8yf1fFB22iBLNJH-84dETxc1adMbZKl9FiURDhzHTvwwkkL6ATxD_PXBeIgijGIHfZdGrR9EZXgfwBiktgL7kWLeO1p4GCWLN2rnAHTauW6bYVbAbrMK6DMC1zK39JlxbvDW-DdGE/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih9z8yf1fFB22iBLNJH-84dETxc1adMbZKl9FiURDhzHTvwwkkL6ATxD_PXBeIgijGIHfZdGrR9EZXgfwBiktgL7kWLeO1p4GCWLN2rnAHTauW6bYVbAbrMK6DMC1zK39JlxbvDW-DdGE/s400/2.png" width="400" /></a></div>
<br />
<br />
<br />
There are already functions to create and find inventDimID for a combination if inventory dimensions . Most commonly used is findOrCreate just initialize a blank instance of inventDim table object, assign all your inventory dimensions and then call this function to assign the inventDimID to your record. If a invnetDimID for the combination exists then system will return it else it'll create a new and return the inventDimId.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodODtF2rpUSK-Wshh_VYNPvni2Y6C-b5U6rZwukHFTn14_-3RDoJa31cSIevAU4JDTiswgH0l5EIkrMnegjQqv1a_24d8c0yt0oHJoE2gH2B7VZPl53nrm5msumEXSa8EQ1xZRl-a_Oo/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodODtF2rpUSK-Wshh_VYNPvni2Y6C-b5U6rZwukHFTn14_-3RDoJa31cSIevAU4JDTiswgH0l5EIkrMnegjQqv1a_24d8c0yt0oHJoE2gH2B7VZPl53nrm5msumEXSa8EQ1xZRl-a_Oo/s400/3.png" width="400" /></a></div>
<br />
So if you are designing new tables in system to store inventory dimensions, then leverage this smart database architecture of AX and give your solution a smart design.<br />
<br />
<br />
<br /></div>
Priyanka Agarwalhttp://www.blogger.com/profile/12023094813431987399noreply@blogger.com71