Beruflich Dokumente
Kultur Dokumente
Introduction
There are many application foundation features in Microsoft Dynamics AX 2012. This chapter introduces several of these features. Global address book: This feature serves as a central repository for addresses throughout the system. Extensible data security policies (XDS): You can use the XDS policies to control the security of data within the system. Financial dimensions: Financial dimensions provide additional details in the general ledger and serve as segments in the chart of accounts.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-1
3-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Address Defaulting
An address defaulting methodology is implemented that lets users select which address should be used as the default for a transaction. The customer, vendor, legal entity, and prospect forms let the user specify a default address for a specific purpose. Depending on the transaction, there are different defaulting flows for addresses.
Terminology
The terms used with the GAB include the following. Party: A person or organization. A party can be internal or external to an organization. Address book: Group of parties. Party roles: Entities that refer to customers, vendors, competitor, worker, applicant, and prospect are a few examples. Non-party entities: Refers to inventory, bank group, bank accounts, and so on. Location: Refers to either a postal address or electronic address (contact information such as telephone, fax, URL, email, telex).
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-3
In the earlier versions, the party tables, including DirPartyTable, are striped by dataArea, and are shared across companies by virtual tables. In Microsoft Dynamics AX 2012, the use of dataArea is removed for party related tables. This means that the party data is not saved for each company (SaveDataPerCompany = No). Party tables are now shared, which means that the need for setting up virtual tables is eliminated. In Microsoft Dynamics AX 2012, names for organization and person are now date-effective. Date-effective names are supported by the use of the ValidTimeStateFieldType property of the table. The affected tables include DirOrganizationName and DirPersonName.
3-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
In the earlier versions, primary address and contact information for party entities is stored in the table for each entity (vendor, customer, worker, contact person, prospect (business relation), applicant, competitor, and external and internal organizations. In Microsoft Dynamics AX 2012, the Address table is now deprecated and is replaced by the shared table LogisticsPostalAddress. All address fields are now removed from party and non-party related tables. Information from these tables moved to the LogisticsPostalAddress table. Contact information fields are now also removed from party related tables and moved to the LogisticsElectronicAddress shared table. Non-party related contact information fields remain unchanged.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-5
DirPartyLookup Class
Both the DirPartyRecId and DirPersonRecId extended data types automatically inherit the lookup for party or person without any filter. If you need the lookup to be filtered, you can use the DirUtility::nameLookup() or DirUtility::personNameLookup() to do this. This uses the DirPartyLookupEntitiesFilter class to filter by the party role. For more information, refer to the following code sample taken from the AuditPolicyAdditionalOption form.
public Common lookupReference(FormReferenceControl _formReferenceControl) { Common ret; dirPartyLookupEntitiesFilter dirPartyLookupEntitiesFilter; dirPartyLookupEntitiesFilter = dirPartyLookupEntitiesFilter::generateDirPartyLookupEntitie sFilter( (auditPolicyListParty.AddressBookRole == DirPartyRoleView::All ? NoYes::Yes : NoYes::No), (auditPolicyListParty.AddressBookRole == DirPartyRoleView::CustomersOnly ? FilterStatus::Set : FilterStatus::Undefined), (auditPolicyListParty.AddressBookRole == DirPartyRoleView::VendorsOnly ? FilterStatus::Set : FilterStatus::Undefined), (auditPolicyListParty.AddressBookRole == DirPartyRoleView::BusinessRelationsOnly ? FilterStatus::Set : FilterStatus::Undefined),
3-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The AuditPolicyListParty table contains the list of monitored parties by an audit policy. During audit policy execution, the list of monitored parties will be returned defined for the policy and the documents associated with the parties will be checked for audit policy violation.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-7
3-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
d. Add LogisticsPostalAddressTable as a data source and override the validateWrite and write methods.
public boolean validateWrite() { return true; } public void write() { //super(); }
TIP: We recommend that you use the right-click > Duplicate feature in the Application Object Tree (AOT) and the drag-and-drop functionality. This also works for methods.
2. Create menu items for the Add, Edit, Deactivate, Remove, Advanced and Map buttons with the following properties. a. Label = @SYS2318 (Add), @SYS2475 (Edit), @SYS23466 (Advanced), @SYS134283 (Deactivate), @SYS311855 (Remove), @SYS136333 (Map)
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-9
3-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
You can create address books at any time and if you select, you can set security parameters for the address books at any time. Setting security for address books is not required in Microsoft Dynamics AX. However, if you do not restrict access by legal entity, or if security privileges are not set for an address book, all workers in your organization can view all party records. You can use the Security policy options link in the Global address book parameters form to select whether the enforcement of security privileges for address books is based on teams, legal entities, or both. Each method for setting security privileges on the global address book uses an extensible data security (XDS) policy in the AOT. When you add a new global address entity, we recommend that you add your address entity tables as constrained tables to the appropriate security policies in the AOT.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-11
Concept Review
The following list defines the concepts of the XDS model. Primary table You can use a primary table to help secure the content of the related constrained table. For example, in a policy restricts access to all sales orders based on the CustGroup foreign key value, the Customer table would be the primary table. Policy query You can define a policy query by specifying a value for the Query property in the AOT at Security > Policies > YourPolicy. You can use a policy query to help secure the constrained tables specified in a given security policy. The query selects data from a primary table. The values in that data are then used to restrict the data returned from the constrained table.
3-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Security Policies
A policy specifies the table row or record that can be accessed. This resembles the WHERE clause in a SQL view or statement that specifies the table records to be returned. All security policies start with a query that is defined under AOT > Queries. The VendProfileAccountPolicy query, shown in the following image, is the basis for the policy that is described in this topic.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-13
3-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Trimming
The security configuration of each field is assessed for the current user. This security behavior is called field trimming because the restricted fields are trimmed out of the results before the results are sent from the AOS to the client. The code sample scans all fields that are under AOT > Data Dictionary > Tables, for a specified range of tables. When a user runs a query, the system can refuse to send data from the AOS for particular columns that the current user has no authorization to access. The access is controlled by the AOSAuthorization property that is available on each field during run time. This property value cannot be known at compile time. The run time value of the AOSAuthorization property is controlled by the roles that the user belongs to. The following code sample scans the system tables to find fields that the current user cannot access, on tables that he can otherwise access. The code prints progress reports to the Print window while it runs. The final output of field names appears in the Infolog window. The macros near the top of the code sample are explained in a section that follows the code sample.
static void GmTrimAccessFieldScan3Job(Args _args) { // Edit the following three macro values to your needs. For example: // ** Start: with a table whose name starts with an 'A'. // ** Stop: with a table whose name starts with a 'Z'. #define.SearchTableNameRangeStart("") #define.SearchTableNameRangeStop("") #define.TargetTableNameLikeFilter("*") TreeNode tnTable, tnField; str sTableAosAuth, sFieldAosAuth; int nCountOfTpfTablesFound = 0, nCountOfAotTables = 0, nCountOfTrimmedFields = 0; // Establish start node among the table nodes. if (#SearchTableNameRangeStart =="") {
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-15
3-16
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
sFieldAosAuth = tnField.AOTgetProperty('AOSAuthorization'); // Test whether there is authority to access the field. if (sFieldAosAuth != 'No') { nCountOfTrimmedFields++; info(strFmt('%1 %2 is a trimmed field that you cannot access.', tnTable.AOTname(), tnField.AOTname())); } } // for each field in AOT } // if table is guarded by the Table Protection Framework (TPF). } // name is Like // Prepare for next iteration of this loop. tnTable = tnTable.AOTnextSibling(); if (tnTable == null) break; } // for each table in AOT print "-------- Final Report (see also the Infolog) --------"; print int2Str(nCountOfAotTables) + " tables examined to this point, at end."; print int2Str(nCountOfTpfTablesFound) + " TPF tables found to this point, at end."; print int2Str(nCountOfTrimmedFields) + " trimmed fields found to this point, at end."; print "-------- Done. --------"; pause; }
TIP: You can import the AX2012_ENUS_DEVIV_03_TRIMMINGJOB.xpo provided with your training image. The file contains the code sample provided.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-17
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3. Save and compile the security policy. The security policy is now ready for deployment and testing. Notice that the ContextType property is currently set to the value ContextString, but the ContextString property is empty. This combination implies that when it is enabled, this security policy will always be applicable for all users.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-19
3-20
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-21
Challenge Yourself!
Use the information that is provided to create a new extensible data security policy for the HR Manager role that restricts access to view only vendors in the Other group.
Step by Step
Inspect the Data You Want to Help Secure
1. Open the Microsoft Dynamics AX client. 2. Open Accounts payable > Setup > Customers > Customer groups. 3. Verify that the Other vendors vendor group has an ID value of 80. You will create a policy so that an application user can only work with data for this vendor group.
3-22
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Constrain Tables
You can add the VendTable table as a constrained table by following these steps: 1. Right-click the Constrained Tables node on the OtherVendorsPolicy policy, and then click New > Add table by relation. 2. Set the Table property to VendTable.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-23
3-24
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-25
NOTE: For more information about the financial dimension framework and examples of adding controls to forms and creating a new system-defined dimension, refer to the Use and Design of the Ledger Module chapter in this course.
Legal Entities
A legal entity is an organization with a registered or legislated legal structure that is granted the authority to enter into legal contracts that is required to prepare statements that report on its performance. A legal entity and company in Microsoft Dynamics AX 2012 are semantically the same. However, some functional areas in the application are still based on a data model that uses company (or DataArea). These areas can have the same limitations as in Microsoft Dynamics AX 2009, and can have an implicit data security boundary.
Operating Units
An operating unit is an organization that divides the control of economic resources and operational processes among people who have a duty to maximize the use of scarce resources, to improve processes, and to account for their performance. Several types of operating units are available out of the box. A business unit is primarily an operating organization with a focus on industries or product lines that the organization is supposed to serve. A cost center is a type of operating unit that describes an organization used for tracking costs or expenses. It is a cost accumulator, and is used to manage costs.
3-26
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A team is also a type of an internal organization. However, it is an informal group of people primarily created for a specific purpose over a short duration. Teams can be created for specific projects or services. The other types previously described are more permanent, although there might be major restructuring related changes or frequent minor updates. When legal entities and operating units are arranged into hierarchies and used for reporting rollup, security access, and business policies, they help enable internal control of your business.
Organization Hierarchies
You can set up organizational hierarchies to visually model your business from different perspectives. For example, you can set up a hierarchy of legal entities for tax, legal, or statutory reporting. Then you can set up another hierarchy that is based on operating units that represents the way that you report financial information that is not legally required. However, that is used for internal reporting. For example, you can create a purchasing hierarchy to control purchasing policies, rules, and business processes. IMPORTANT: The only way to report based on the hierarchy is through dimensions. Microsoft Dynamics AX 2012 does not use the hierarchy for financial reporting. TIP: Microsoft Dynamics AX 2012 does not support the hierarchies in the account structures. If you have at least two segments backed by an organization unit in the hierarchy, you can select the hierarchy in the Configure account structure form by clicking the Relationships button. When you do this, the system will adhere to the hierarchy and not force users to also set up the constraints in the account structure. Organizations in a hierarchy can share parameters, policies, and transactions. An organization can inherit or override the parameters of its parent organization. However, shared master data, such as products and address books, applies to the whole organization and cannot be overridden for individual organizations.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-27
Application Scenarios
The organization model is integrated with the application modules in Microsoft Dynamics AX. There are two types of scenarios: The organization model framework is integrated with other application frameworks. Transaction scenarios use integrations to create end-to-end scenarios.
Address Book
All internal organizationslegal entity, operating unit, and teamare types of the Party entity. This means that these organizations take advantage of the capabilities of the address book to store address and contact information.
Financial Dimensions
Legal entities and operating units can be used to define financial dimensions, and those financial dimensions can be used in account structures. By using organizations as financial dimensions, you can perform an analysis of an organizations financial performance. The relationships between organizations described through hierarchies can also be used as constraints if two types of organizations are used as separate financial dimensions in the account structure.
Policy Framework
In Microsoft Dynamics AX 2012, a business policy can be defined for an organization by using the policy framework. The policy framework can be used to define policies for expense reports, purchase requisitions, audit control of documents, and vendor invoice payments. The policy framework provides support for override and default behavior for organizations based on their hierarchies, and enables internal management control of organizations to facilitate cost control, fraud detection, better operating efficiency, and better performance generally.
3-28
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Transaction Scenarios
There are several application areas that use the new organization model framework. The primary effect is in the following modules. Here is a brief description of the usage. For a complete description and steps for the scenarios in these areas, refer to the Help documentation.
Human resources
In human resources, workers hold employment contracts in a legal entity and have a position in a department. All transaction scenarios in human resources take advantage of these concepts to view and modify data.
Development
You can extend the organization model to support customization or special configuration scenarios. One of the core extensibility scenarios is extending the organization model for specific industry vertical requirements such as retail, professional services, or public sector. Branches, stores, schools, and school districts are basically organization concepts. You can model them as new types of operating units. The framework of the new organization model supports this extensibility by allowing you to define a new type of custom operating unit.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-29
To define a new Base Enum value for the OMOperatingUnitType that corresponds to the new type of operating unit, follow these steps. 1. In the AOT, right-click Data Dictionary > Base Enums > OMOperatingUnitType and then click New Element. 2. In the Properties window, enter Store in the Name and Label. 3. Save the base enumeration. To define a query for the new type of operating unit, follow these steps. 1. In the AOT, right-click Queries and then click New Query. 2. In the Properties window, type OMBranchQuery in the Name. 3. Right-click OMStoreQuery > Data Sources and then select New Data Source. 4. In the Properties window, select OMOperatingUnit in the Table property and then press Enter. 5. Expand the new OMOperatingUnit_1 data source and select the Fields node. 6. In the Properties window, set the Dynamic property to Yes. 7. Right-click the OMStoreQuery > OMOperatingUnit_1 > Ranges node and select New Range. 8. In the Properties window, set the Field to OMOperatingUnitType, and the Value to =Store.
3-30
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-31
3-32
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A similar customization can be done for a new type of operating unit by customizing this class to add a new border color, top gradient color, and bottom gradient color. Without the customization, the hierarchy designer uses default colors for a new type of operating unit. You can add a new custom purpose by customizing the OMHierarchyPurposeTableClass class and HierarchyPurpose base Enum. The customization must extend to the application scenario where this custom purpose will be used. For more information about an example of doing this refer to the "Policy Framework" topic in this course. A more complex customization of the OMHierarchyPurposeTableClass class is required if you want to force the design of balanced hierarchies. In a hierarchy, all nodes at a fixed depth from the root node define a level. In a balanced hierarchy, specific operating unit types are allowed at each level. You can set up a new end-to-end scenario or customize an existing end-to-end scenario. The high-level steps are as follows. 1. Define or change the data model. o Create a new transaction table or make a Per company transaction table by changing the metadata property from SaveDataPerCompany = yes to SaveDataPerCompany = No. o Include relevant organizations as Foreign keys (FK) on the table. It is sufficient to carry an operating unit because the relationship with the legal entity is established through organization hierarchies. o If the transaction table carries redundant data of the legal entity field, set up business logic constraints between legal entities and operating units to maintain data consistency. 2. Build a new form (for example, a list page) for the transaction scenarios, or change the existing user experience to view or maintain transactions. The custom filters can help view or manage data across organizations. 3. Apply default organizations on the transaction table in financial dimensions by including them in account structures. 4. Create XDS policies for data security based on access to the organizations of the user. 5. Use the policy framework to set up specific policies that are applied while you are creating a new transaction in the application scenario.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-33
Microsoft Dynamics AX 2012 case management fulfills the needs of these business operations. While the goal is to resolve issues as swiftly as possible, not all issues and questions can be resolved quickly and easily. They frequently require more than one interaction in addition to collaboration and research before they can be closed. Organizations need the ability to record and report on these issues.
3-34
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Case Process
Organizations need all cases to be handled consistently according to company policies and procedures. To make sure that this occurs, case processes can be defined to guide your workers through a simple checklist or a more elaborate step-by-step set of stages and actions. This provides consistency in resolving cases, and helps new case workers to become efficient and perform at a high level in a short period of time. After a case process is defined, it can be associated with a specific case category so that your case workers will know what has to be completed for each situation. In addition to case processes, workflow can be defined so that cases can be assigned to queues, which can be picked up by any case worker in a specific area, such as auditing.
Knowledge Articles
To resolve cases efficiently, case workers need easy access to processes and procedures, answers to frequently asked questions, how-to documentation, and other organizational knowledge collateral. The ability to create and store knowledge articles provides case workers with the information that they must have to resolve cases quickly. To help ensure even faster resolution, you can associate specific knowledge articles with a case category, which will default the knowledge articles to any case by using that category. This functionality reduces the time that you have to have for a case worker to search for documentation.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-35
3-36
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The CaseDetailsBase is the primary table for storing all cases regardless of where the case is created from or which records the case is related to. Each case is assigned a case category. Case categories are stored in the CaseCategoryHierarchyDetail table. Each case can have logs or notes related to the case. Each log entry related to a case is stored in the CaseLog table. When a case is related to another case, this reference is stored in the CaseDependancy table. The CaseAssociation table is used to store a reference to each record that a case is related to. The CaseAssociation table is then related to the primary table for each type of association based on the CaseEntityType and RefRecId. For example, when a case is related to a sales order, the CaseEntityType field would store the enum value for the sales order table, and the RefRecId field would store the RecID from the sales order that the case is related to.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-37
Case Associations
Out of the box, cases can be related to the following data entities and tables. Data Entity Lead Opportunity Customer Vendor Prospect Project Sales order Purchase order Worker Service order Item Customer transaction Expense report line Expense report Vendor invoice Vendor invoice line Purchase order line Table smmLeadTable smmOpportunityTable CustTable VendTable smmBusRelTable ProjTable SalesTable PurchTable HcmWorker SMAServiceOrderTable InventTable CustTrans TrvExpLine TrvExpTable VendInvoiceJour VendInvoiceTrans PurchLine
Each case can have multiple associations and multiple associations of the same type. For example, a case related to a specific customer, could also be related to customer transactions.
3-38
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-39
3-40
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-41
3-42
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
To test that the new buttons work correctly, follow these steps. 1. 2. 3. 4. 5. 6. 7. 8. Open Fleet management > Common > Vehicles > All vehicles. Select a vehicle. Click the General tab on the Action Pane. Click Create case. Select a Case category. Click Create. Click No on the Create activity dialog box. On the Associations FastTab, verify that an association is created for the vehicle that you created the case for. 9. Close the forms.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-43
Challenge Yourself!
Use the information that is provided to add rentals as a case association entity type. Make sure that you add buttons on the Rental form to create the case and automatically add an association.
3-44
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-45
// Fleet management vehicle case tablenum(FMRental): returnValue = CaseEntityType::Rental; break; 7. Modify the CaseDetail form to add a "more information" group to the Case Association FastTab. a. Add a data source to the form for the entity you want. In this example add the FMRental table. Make sure that you relate the table to the CaseAssociation data source on the form. b. Create a new Group in the Group:Group_MoreInformation area of the TabPage:AssocitationsTabPage. Make sure that you auto declare the new group. Call the new tab page CaseMoreInformation_FMRental. c. Add fields to the tab page from the data source. You can also choose to use a field group. For example, select the DetailsGroup in the DataGroup property of the new group. d. In the showMoreInformation method on the form, declare a new boolean for your entity type. Use the following code sample to guide you. boolean showFMRental = (caseAssociation.EntityType == CaseEntityType::Rental); e. In the showMoreInformation method on the form, add an "or" statement to the boolean showMoreInformationGroup variable. Use the following code sample to guide you. boolean showMoreInformationGroup = ( showTrvExpTable || showTrvExpTrans || showsmmLeadTable || showsmmOpportunityTable || showInventTable || showServiceOrderTable || showHcmWorker || showPurchLine || showPurchTable || showSalesTable || showProjTable || showsmmBusRelTable || showVendTable || showCustTable ||
3-46
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
if (caseMoreInformation_FMRental.visible() != showFMRental) { caseMoreInformation_FMRental.visible(showFMRental); FMRental_DS.refresh(); } To test the new case association type, follow these steps. Open Home > Area Page > Common > Cases > All cases. Click Case in the New group of the Action Pane. Select General > GEN1 in the Case category field. Click Create. Click No on the Create activity dialog box. On the Associations FastTab of the Case form, click Add. In the Entity type field, select Rental. In the ID field, select a rental. If there are no rentals, create one in the Rentals form. 9. Save the record. 10. Click the Details button. 11. The Rental form should open to the rental you selected in step 7. Close all the forms. To add buttons to the Rental form, follow these steps. 1. Create a new Display menu item that calls the CaseDetailFormCreate class. View the CaseDetailNewSales for an example of this. 2. On the FMRental form do the following. o o o If a General tab does not exist on the Action Pane, add one. Add the menu item that you created in step 1 to the form. Add the CaseDetails menu item to the form. 1. 2. 3. 4. 5. 6. 7. 8.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-47
3-48
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Policy Framework
Microsoft Dynamics AX 2012 introduces a policy framework that can be used to define policy rules in modules to help guide the flow of business. The framework provides a common pattern and rich feature set that users can take advantage of to enforce simple rules or to evaluate and act on several different rules in a complex organizational hierarchy. The actual rules used by businesses, and the actions that these rules allow, prevent, or alter are outside the scope of the framework. However, this white paper does provide examples of the policy types and rule types that that are included with Microsoft Dynamics AX 2012. NOTE: The policy framework is only used for defining and enforcing business rules. It is not related to the framework that creates extensible data security policies also being introduced in Microsoft Dynamics AX 2012. There are three perspectives from which the policy framework can be viewed and used, depending on the role of the user. A developer introduces the policy types and rule types to be evaluated. A software developer writes the logic that retrieves date-effective rules for a given user. It does this to enforce these rules as the module requires (for example, in form logic to allow or prevent certain actions).
NOTE: One person often performs the role of developer and software developer. An administrator, in a manager role, defines specific rule data that will be enforced.
Developers and administrators can use the policy framework to improve their business processes by enforcing rules for Microsoft Dynamics AX 2012 users. Examples of rules include the following. Expense reports submitted by employees for items above a certain currency amount are disallowed or result in an appropriate warning. Employees in one organization can view a specific procurement catalog while other employees (for example, those in a different country or region with different suppliers) are required to view a different catalog. Employees with a particular title can approve lines only up to a certain amount of currency. Documents must be validated against certain criteria, and violations of those criteria must be flagged.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-49
Framework Components
The policy framework consists of three main components that provide the functionality that corresponds to the developer and administrator roles described earlier. A unified, extensible schema that gives the developer a basic platform on which to build a policy solution. An Application Programming Interface (API) that provides developer with the way to retrieve policy rules. Policy rules take the developer directly to the data needed to execute the appropriate business logic. A common entry point for both the policy administrator and the developer, who can use it to manage policies. Little customization is required beyond entry of their business data.
These components provide the flexibility that developers and administrators must have to achieve their objectives without problems. They also give the user the same appearance and behavior as the rest of the policy user interface (UI) in Microsoft Dynamics AX 2012.
Policy Types
A policy type is a collection of all the rule types that apply to a given module or feature area. A user in a manager role can be granted permission to define policies of a given type through a menu item that opens a list page. The list page displays all the policies of a particular policy type. Microsoft Dynamics AX 2012 includes six policy types. These types are specified with the following SysPolicyTypeEnum enumeration values. ApprovalPolicy AuditPolicy PurchasingPolicy TrvExpensePolicy TrvRequisitionPolicy VendInvoicesPolicy
3-50
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Rule Types
Rules are at the core of any policy. The necessary data that defines how policies will be enacted is located in rules. After a developer defines policy types and rule types and he or she creates a policy, the policy administrator can add rules to that policy. For example, suppose that an administrator adds a catalog rule to a purchasing policy. The catalog rule is configured to specify the Adventure Catalog for internal procurement. After the purchasing policy is associated with a particular organization, all employees of that organization will see the Adventure Catalog when they browse the internal procurement site. Rules are date-effective, which gives you a set of powerful options for manipulating policy events over time. You can define rules that take effect in the present and expire sometime in the future, or that never expire. You can also set up rules that will take effect at some specified point in the future. By defining date-effective rules, you prevent multiple rules from being active at any given time, when they might provide conflicting data. After a rule has gone into effect, it can only expire or be discontinued. It can never be removed from the policy. This constraint provides enhanced auditing capability and historical policy retention. The policy framework can be queried for the rules that were in effect at a specific time, if it is necessary. As mentioned earlier, each rule is associated with a corresponding form. The developer implements the form, which displays and stores data in the data model. The administrator can then interact with this form to define and update the rule as needed.
Organization Assignment
Before a policy can affect anyone, it must be associated with an organization. The administrator configures the association with the organization on the SysPolicy form after a policy is created. In the business logic, the developer queries the API for rules that are in effect for a specific organization. All hierarchies with a specific hierarchy purpose can be sources from which to select organizations. An additional source from which to select organizations is the flat list of legal entities in the CompanyInfo table, which are designated in the policy framework as Companies. (An example would be a legal entity with a DataAreaId of DAT.) Although not a true hierarchy, this can be thought of as a default hierarchy type that is always available.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-51
SysPolicyRule table
The SysPolicyRule table is the main table with which you will interact. To demonstrate the design options that this table allows, you start with the output and work backward. When you query the policy API (by using the SysPolicies::getPolicyRuleIds method) for a list of rules for a given policy type, rule type, and organization, the API returns an array of RecIds to the SysPolicyRule table, which holds a list of specific rule instances. With this strategy you can follow one of two general patterns shown for storing and accessing your rule data. Select the pattern that best suits your requirements. One set of data for each rule
This is the more common pattern. There is just one set of data for each rule, which is stored in one row in a table. To implement this pattern, create a table that is a subtype of the SysPolicyRule table and add all the fields required for your feature. A RecId that you receive from the policy API will now directly correspond to a date-effective row in your table (which is managed by the policy framework). You can directly query your table without having to know that it extends the SysPolicyRule table. You can view examples of this pattern in the CatCatalogPolicyRule and TrvPolicyRule tables. For more information, view the ER diagram.
3-52
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Use this pattern when you have to store several rows of information for each rule (meaning, the rules are displayed as a grid on the rule form). In this case, create a table with the fields that you must have that is not a subtype of the SysPolicyRule table. Instead, add a foreign key to the SysPolicyRule table to establish a many-to-one relationship. By doing this, you can reference many rows of data in your table with one SysPolicyRule RecId. You can view examples of this pattern in the ProcCategoryPolicyParameter and ProcCategoryAccessPolicyParameter tables.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-53
3-54
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-55
3-56
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-57
3-58
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Summary
The Application Foundation Features chapter reviewed several features that are used throughout the system. The global address book is a central repository for addresses and contact information. You can extend the global address book framework to create new party types. You can also use the extensible data security policy framework with the global address book framework to help secure address information across legal entities, or teams, or both. Developers and administrators can use security policies to block access to subsets of data rows in tables. A policy resembles a where clause in an SQL select statement. A security permission increases the access a user has to data, but a security policy decreases access to data. You can use financial dimensions to create "attributes" that you can use as account segments for a shared chart of accounts. There are two basic types of financial dimensions. The organization model represents internal control, data security access, and performance reporting structures designed to divide responsibility for human and operations resources and work processes. The organization model in Microsoft Dynamics AX 2012 introduces two new conceptslegal entity and operating unit. You can extend the organization model framework to create new types of operating units or new purposes for a hierarchy. Case management provides the tools to handle issues more quickly and improve customer, employee, and vendor relationships. You can extend the case management framework to work with any data entity. Microsoft Dynamics AX 2012 introduces a policy framework that is used to define policy rules in modules to help guide the flow of business. The framework provides a common pattern and rich feature set that users can take advantage of to enforce simple rules or to evaluate and act on several different rules in a complex organizational hierarchy. You can extend the policy framework to create new policy types or new policy rule types.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-59
3-60
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
7. List the four basic steps for creating a new operating unit type.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-61
2.
3.
3-62
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Solutions
Test Your Knowledge
1. Which class is used to implement a single address on a form? ( ) DirUtiltity ( ) DirPartyLookup () LogisticsEntityPostalAddressFormHandler ( ) LogisticsMultiEntityPostalAddressFormHandler 2. Which of the following are valid types of operating units that are available out of the box? (Select all that apply) () Department () Cost Center ( ) Legal Entity () Business Unit 3. Fill in the blanks with the name of the table that best describes the content of the table to test your knowledge of this section. Stores a reference to each record that a case is related to. Stores the log entries related to each case. The primary table for storing all cases. CaseLog CaseAssociation
CaseDetailsBase
Stores the parent child relationship between cases when a case is related to another case. CaseDependancy 4. Put the following steps in order: Step: 1 4 6 3 2 5 : Review the entity to add a policy to. : Add table constraints. : Test the security policy. : Create a new security policy. : Create a new query. : Set the context type and role.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-63
7. List the four basic steps for creating a new operating unit type. MODEL ANSWER: Define a new Base Enum value for the OMOperatingUnitType that corresponds to the new type of operating unit. Define a query OMStoreQuery for the new type of operating unit. Define a view OMStoreView based on the OMStoreQuery query. Optionally, define a new menu item that corresponds to this operating unit to create new instances of this type of operating unit. 8. Describe what "trimming" is. MODEL ANSWER: The security configuration of each field is assessed for the current user. This security behavior is called field trimming because the restricted fields are trimmed out of the results before the results are sent from the AOS to the client.
3-64
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement