### Quick Start Project Setup Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Initialize, install dependencies, and start the development server for a new project. ```bash > odin new > cd myProject/ > npm install > odin serve --port 8080 ``` -------------------------------- ### Run and build project commands Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Standard commands for installing dependencies, starting the development server, and building for production. ```bash npm install ``` ```bash odin serve ``` ```bash odin build ``` -------------------------------- ### IBookmark Usage Examples Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IBookmark.html Examples demonstrating how to define and manipulate IBookmark objects. ```APIDOC ## Example: Defining a Stateless Bookmark This example shows how to define a stateless bookmark definition for the E-panel in CRS610. ```typescript private bookmark = { program: 'CRS610', table: 'OCUSMA', keyNames: 'OKCONO,OKCUNO', option: '5', panel: 'E', isStateless: true } as IBookmark; ``` ## Example: Cloning and Modifying a Bookmark This example shows how to clone an existing bookmark definition and set some key values. Note that CONO and DIVI fields can normally be left out since they are resolved automatically using the M3 user context (if available). ```typescript var bookmark = Object.assign(this.bookmark); bookmark.values = { OKCONO: '100', OKCUNO: 'TEST' }; ``` ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Installs all the necessary dependencies for an M3 Odin project after it has been created. Run this in the project's root directory. ```bash npm install ``` -------------------------------- ### Serve Application Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Start the development server with optional port configuration. ```bash > odin serve > odin serve --port 8080 ``` -------------------------------- ### Install Odin CLI Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Install the Odin CLI globally via NPM. ```bash npm install -g @infor-up/m3-odin-cli ``` -------------------------------- ### Install Latest M3 Odin CLI (Next Tag) Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Installs the latest, potentially unstable, version of the M3 Odin CLI. Use this for access to the newest features. ```bash npm install -g @infor-up/m3-odin-cli@next ``` -------------------------------- ### Verify M3 Odin CLI Installation Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Verifies that the M3 Odin CLI has been installed successfully by displaying its help information. ```bash odin -h ``` -------------------------------- ### Install and Manage M3 Odin Projects via CLI Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Commands for installing the CLI, scaffolding new Angular projects with IDS components, and managing development/build cycles. ```bash # Install CLI globally npm install -g @infor-up/m3-odin-cli # Verify installation odin -h # Create new Angular project with IDS/SOHO components odin new my-app --angular --soho # Create with M3 proxy pre-configured odin new my-app --angular --soho --proxy 'https://my.m3.environment:1234' # Navigate and install dependencies cd my-app npm install # Start development server odin serve --port 8080 # Build for production (creates dist/my-app.zip) odin build ``` -------------------------------- ### Create New M3 Odin Project Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Initiates the new project creation wizard. This command guides you through setting up a new M3 Odin application. ```bash odin new ``` -------------------------------- ### Serve M3 Odin Project Locally Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Starts the development server for an M3 Odin project. The application will be accessible at http://localhost:8080 and will auto-reload on code changes. ```bash odin serve ``` -------------------------------- ### Clone and Update Bookmark Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IBookmark.html Example of cloning an existing bookmark definition and assigning specific key values. ```typescript var bookmark = Object.assign(this.bookmark);bookmark.values = { OKCONO: '100', OKCUNO: 'TEST'}; ``` -------------------------------- ### Define MI Request Options Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIOptions.html Example of creating an object that implements IMIRequest using IMIOptions properties. ```typescript const request = { program: 'CRS610MI', transaction: 'LstByNumber', excludeEmptyValues: true, maxReturnedRecords: 10} as IMIRequest; ``` -------------------------------- ### Import Label Class from M3 Odin SDK Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Label.html Demonstrates how to import the Label class from the @infor-up/m3-odin package. Ensure the package is installed and configured in your project. ```typescript import { Label } from '@infor-up/m3-odin'; ``` -------------------------------- ### Create an IMIRequest for GetUserData Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIRequest.html Example of creating an IMIRequest object to fetch user data. It specifies the program, transaction, a record with user ID, and desired output fields. ```typescript const record = { USID: 'MVXSECOFR' }; const request = { program: 'MNS150', transaction: 'GetUserData', record: record, outputFields: ['CONO', 'DIVI', 'USID', 'NAME'] }; ``` -------------------------------- ### Execute MI Transaction and Handle Response Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIResponse.html Example of executing an MI transaction and accessing the response. It demonstrates how to retrieve and use the 'NAME' field from the 'item' property of the IMIResponse. ```typescript this.miService.execute(request).subscribe((response: IMIResponse) => { const item = response.item if (item) { this.updateName(item.NAME); } }) ``` -------------------------------- ### Extend CoreBase and Log Information Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.CoreBase.html Example of extending the CoreBase class and using its logInfo method. Ensure the super constructor is called with the class name. ```typescript import { CoreBase } from '@infor-up/m3-odin'; export class MyCustomClass extends CoreBase { constructor() { super('MyCustomClass'); } onClick(): void { this.logInfo('onClick: Called'); } } ``` -------------------------------- ### Create New Projects Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Scaffold new projects with various framework and style configurations. ```bash # Interactively create a new project > odin new # Create a basic project with no view frameworks or style libraries: > odin new projectName # Create an Angular project > odin new projectName --angular # Create an Angular project with SOHO > odin new projectName --angular --soho # Create an Angular project prepared with an M3 proxy > odin new projectName --angular --proxy 'https://my.m3.environment:1234' # Create a project with SOHO style & controls, but no Angular > odin new projectName --soho ``` -------------------------------- ### Build and Deploy Application Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Commands for building the production bundle and instructions for H5 administration deployment. ```bash # Build production bundle (creates dist/my-app.zip) odin build # The zip file structure: # dist/ # my-app.zip # index.html # main.js # styles.css # assets/ ``` ```bash # H5 Deployment Steps: 1. Open Infor M3 H5 client 2. Navigate to: Administration Tools -> H5 Administration 3. Go to Applications tab 4. Click "Install" and select the dist/my-app.zip file 5. Application appears under "Installed applications" # Access installed application in H5: # Press Ctrl+R and enter: /mne/apps/my-app # Or add to Start Page: # Go to Start -> Add Page -> Custom Menu Widget -> New Link # Set link to: /mne/apps/my-app ``` -------------------------------- ### Execute a GET request with IonApiService Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Execute a GET request to an ION API endpoint, such as the datalakeapi. The response includes status, body, and retry information. ```typescript // Execute ION API request callDataLakeApi() { const request: IIonApiRequest = { source: "my-application", method: "GET", url: "/IONSERVICES/datalakeapi/v1/datacatalog/tables", headers: { "Content-Type": "application/json" } }; this.ionApiService.execute(request).subscribe( (response: IIonApiResponse) => { console.log("Response status:", response.status); console.log("Response body:", response.body); console.log("Was retry:", response.isRetry); }, (error) => { console.error("ION API call failed:", error); } ); } ``` -------------------------------- ### Initialize a new project Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Commands to create new projects with or without specific naming conventions. ```bash odin new ``` ```bash odin new my-project-name ``` -------------------------------- ### Build for Production Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Compile and optimize the application for production deployment. ```bash > odin build ``` -------------------------------- ### NumUtil.getInt Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.NumUtil.html Gets an integer value from a string. ```APIDOC ## Static `getInt` Method Gets an integer value from a string. ### Method `static` `getInt` ### Parameters * **s** (string) - The string to parse. * **defaultValue** (number, optional, default: 0) - Optional default value to return if the string cannot be parsed. The default is zero. ### Returns number - An integer parsed from the string or the default value. ### Example ```typescript NumUtil.getInt('123'); // Returns 123 NumUtil.getInt('abc', 10); // Returns 10 NumUtil.getInt('45.67'); // Returns 45 ``` ``` -------------------------------- ### Initialize M3 Odin Theme and Application Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/index.html Sets the document theme based on local storage and manages the application display state during initialization. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Get ION API Context Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiService.html Gets the ION API context, which includes the OAuth token required for ION API HTTP requests. This is useful when more control over the request is needed, or when executeIonApiAsync cannot be used. It can also be used to refresh the OAuth token. ```typescript getContext(options?): Observable; ``` -------------------------------- ### getEnvironmentContext API Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IFormService.html Gets the environment context information. ```APIDOC ## GET /api/environment/context ### Description Gets the environment context information. If there is an existing user context, the values will be retrieved from the user context. Do not call this method if the application will run within the H5 tab system. The values in the Environment context are also available on the user context if the application is running in a H5 tab. ### Method GET ### Endpoint /api/environment/context ### Response #### Success Response (200) - **context** (Observable) - An observable that will be completed with the environment context. #### Response Example ```json { "context": { "environment": "PROD", "company": "100", "division": "001", "language": "EN" } } ``` ``` -------------------------------- ### hasPanel() Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IFormResponse.html Gets a value that indicates if the response has at least one panel. ```APIDOC ## hasPanel() ### Description Gets a value that indicates if the response has at least one panel. ### Method N/A (Method signature provided) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (boolean) - **Returns** (boolean) - True if the response has at least one panel. #### Response Example ```json true ``` ``` -------------------------------- ### Theme Initialization Script Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IFormControlInfo.html Initializes the theme for the application based on local storage or defaults to 'os'. It then hides the body and shows the app after a delay, or removes the display property if the app is not available. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### NumUtil.getDefaultOptions Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.NumUtil.html Gets the default options used by the functions in the NumUtil class. ```APIDOC ## Static `getDefaultOptions` Method Gets the default options used by the functions in the class. ### Method `static` `getDefaultOptions` ### Returns [INumberFormatOptions](../interfaces/_infor_up_m3_odin.INumberFormatOptions.html) - The default options. ### Example ```typescript const defaultOptions = NumUtil.getDefaultOptions(); console.log(defaultOptions); ``` ``` -------------------------------- ### launch Method Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IApplicationService.html Launches a specified link within the H5 client environment. ```APIDOC ## launch(link) ### Description Launches a link in H5. This function will not have any effect when not running in the H5 client. ### Parameters - **link** (string) - Required - The link to launch. ### Returns - **void** ``` -------------------------------- ### Time Utility Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Log.html Provides a utility for getting the current time in a specific format. ```APIDOC ## Time Utility ### `Private` `Static` getTime * `getTime(): string` * Gets a military time string with hours, minutes, seconds and milliseconds on the format hh:mm:ss,ttt. #### Returns `string` - A military time string. ``` -------------------------------- ### Access CLI Help Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Display help information for the CLI or specific commands. ```bash # Show available commands and options: > odin --help # Show help for the 'new' command. > odin new --help ``` -------------------------------- ### Define a Stateless Bookmark Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IBookmark.html Example of defining a stateless bookmark for the E-panel in program CRS610. ```typescript private bookmark = { program: 'CRS610', table: 'OCUSMA', keyNames: 'OKCONO,OKCUNO', option: '5', panel: 'E', isStateless: true} as IBookmark; ``` -------------------------------- ### Get ION API Authorization Header Name Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiContext.html Retrieves the name of the HTTP Authorization header, which is 'Authorization'. ```typescript getHeaderName(): string; ``` -------------------------------- ### Configure Project Settings Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/cli/README-CLI.md Update project configuration keys like name and proxy settings. ```bash # Set project name > odin set name myNewProjectName # Configure M3 Proxy > odin set m3-proxy https://example.com # Configure ION API Proxy > odin set ion-proxy https://ion.example.com/tenant ``` -------------------------------- ### isDebug Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.FormService.html Gets a value indicating if the debug log level is enabled. Protected method inherited from CoreBase.isDebug. ```APIDOC ## GET /api/isDebug ### Description Gets a value indicating if the debug log level is enabled. ### Method GET ### Endpoint /api/isDebug ### Response #### Success Response (200) - **boolean** - True if the debug log level is enabled. #### Response Example ```json { "isDebug": true } ``` ``` -------------------------------- ### M3 Odin SDK - Constructor and Properties Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.List.html Details on the constructor and various properties available for M3 Odin SDK objects. ```APIDOC ## Constructor and Properties ### Description This section outlines the constructor and key properties of the M3 Odin SDK objects, which are used to manage data, constraints, and UI elements. ### Methods #### Constructor - **constructor** - Initializes a new instance of the object. #### Properties - **aggregateDepth** (number) - The depth of aggregation. - **columns** (Array) - The columns associated with the object. - **constraint** (Constraint) - The constraint applied to the object. - **fieldHelp** (string) - Help text for a field. - **hasSubRows** (boolean) - Indicates if the object has sub-rows. - **id** (string) - The unique identifier of the object. - **isAggregate** (boolean) - Indicates if the object is an aggregate. - **isCleared** (boolean) - Indicates if the object has been cleared. - **isEnabled** (boolean) - Indicates if the object is enabled. - **isEnd** (boolean) - Indicates if the object is at the end. - **isReadDisabled** (boolean) - Indicates if the object is read-disabled. - **isScrollToEnd** (boolean) - Indicates if scrolling to the end is enabled. - **isSlave** (boolean) - Indicates if the object is a slave. - **isSpecial** (boolean) - Indicates if the object is special. - **isVisible** (boolean) - Indicates if the object is visible. - **items** (Array) - The items associated with the object. - **masterColumn** (Column) - The master column. - **name** (string) - The name of the object. - **originalName** (string) - The original name of the object. - **position** (number) - The position of the object. - **referenceField** (string) - The reference field. - **referenceFile** (string) - The reference file. - **scroll** (Scroll) - The scroll object. - **subColumns** (Array) - The sub-columns. - **tabIndex** (number) - The tab index. - **type** (string) - The type of the object. - **value** (any) - The value of the object. ### Request Example ```json { "example": "No request body for constructor or property access" } ``` ### Response #### Success Response (200) - **constructor** - Returns a new instance of the object. - **properties** - Returns the value of the respective property. #### Response Example ```json { "example": "Instance of the object or property value" } ``` ``` -------------------------------- ### Configure H5 Application URL Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md The relative path used to reference an installed application within the H5 environment. ```text /mne/apps/my-project-name ``` -------------------------------- ### Import ISortOptions Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.ISortOptions.html Import the interface from the @infor-up/m3-odin package. ```typescript import { ISortOptions } from '@infor-up/m3-odin'; ``` -------------------------------- ### Instantiate UserService in a Component Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.UserService.html Example of how to inject and use the UserService within an Angular component. The UserService is injected via its constructor. ```typescript @Component({ templateUrl: './my-component.html' }) export class MyComponent { constructor(private userService: UserService) { } } ``` -------------------------------- ### Launch a program with ApplicationService Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Launch a specific M3 program or a custom URL within the H5 tab system using `ApplicationService.launch()`. This can be done by providing a program name or a URI. ```typescript openCustomer(customerId: string) { // Create bookmark and convert to URI const bookmark: IBookmark = { program: "CRS610", table: "OCUSMA", keyNames: "OKCONO,OKCUNO", option: "5", panel: "E", values: { OKCUNO: customerId } }; const uri = Bookmark.toUri(bookmark); this.applicationService.launch(uri); } openProgram() { // Launch program directly this.applicationService.launch("mforms://CRS610"); } openCustomUrl(path: string) { // Launch custom application this.applicationService.launch(`/mne/apps/${path}`); } ``` -------------------------------- ### hasError() Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IFormResponse.html Gets a value that indicates if an error exists. An error is considered to exist if any of the error, errorMessage or errorCode properties are set. ```APIDOC ## hasError() ### Description Gets a value that indicates if an error exists. An error is considered to exist if any of the error, errorMessage or errorCode properties are set. Note that if one property is set there is no guarantee that any of the other properties are set. ### Method N/A (Method signature provided) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (boolean) - **Returns** (boolean) - True if an error exists. #### Response Example ```json true ``` ``` -------------------------------- ### Configure Angular Module and Dependency Injection Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Sets up the M3 Odin module and demonstrates service injection within an Angular component. ```typescript import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { HttpClientModule } from "@angular/common/http"; import { M3OdinModule, IonApiConfig } from "@infor-up/m3-odin-angular"; import { AppComponent } from "./app.component"; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, HttpClientModule, M3OdinModule ], providers: [ // Optional: Configure IonApiService { provide: IonApiConfig, useValue: { withCredentials: false } } ], bootstrap: [AppComponent] }) export class AppModule {} // Component usage - services are automatically injectable @Component({ selector: "app-root", template: `` }) export class AppComponent { constructor( private miService: MIService, private userService: UserService, private formService: FormService, private applicationService: ApplicationService, private ionApiService: IonApiService ) { // All services available via dependency injection } } ``` -------------------------------- ### Static toParams Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Bookmark.html Converts a bookmark and user context into parameters. ```APIDOC ## Static toParams ### Description Converts a bookmark and user context into a parameter object. ### Parameters - **bookmark** (IBookmark) - Required - The bookmark object. - **userContext** (IUserContext) - Required - The user context. ### Response - **Returns** (any) - The resulting parameters object. ``` -------------------------------- ### Get User Context Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IUserService.html Retrieves the M3 user context as an Observable. This method is part of the IUserService and provides user-specific information. ```typescript getUserContext(): Observable<[IUserContext](_infor_up_m3_odin.IUserContext.html)> ``` -------------------------------- ### Execute MI Transaction with IMIService Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIService.html Demonstrates how to execute an MI transaction using the IMIService. Requires importing IMIService and defining an IMIRequest. The response is handled via subscribe, with separate callbacks for success and error. ```typescript import { IMIService } from '@infor-up/m3-odin'; const record = { USID:'MVXSECOFR' }; const request: = { program: 'MNS150MI', transaction: 'GetUserData', record: record, outputFields: ['CONO', 'DIVI', 'USID', 'NAME'] } as IMIRequest; this.miService.executeRequest(request).subscribe((response: IMIResponse) => { // Handle the response... }, (response: IMIResponse) => { // Handle the error response... }); ``` -------------------------------- ### Get M3 Environment Context Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IFormService.html Retrieves the current M3 environment context. This is useful for understanding the current operational environment. ```typescript getEnvironmentContext(): Observable; ``` -------------------------------- ### Import IApplicationService Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IApplicationService.html Import the IApplicationService interface from the @infor-up/m3-odin package. ```typescript import { IApplicationService } from '@infor-up/m3-odin'; ``` -------------------------------- ### Getting H5 Version Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IEnvironmentContext.html Retrieve the H5 version from the environment context. This optional property can be useful for version-specific logic or debugging. ```typescript version?: string; ``` -------------------------------- ### Get M3 API Decimal Separator Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.MIConstants.html Retrieve the decimal separator used for M3 API values. This constant is defined as '.' ```typescript decimalSeparator: "." = '.' ``` -------------------------------- ### MIServiceCore Constructor Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.MIServiceCore.html Initializes a new instance of the MIServiceCore class. ```APIDOC ## Constructor ### Description Creates a new instance of the MIServiceCore class. ### Parameters #### Path Parameters - **http** (IHttpService) - Optional - An optional HTTP service implementation to be used by the service. ``` -------------------------------- ### IonApiServiceCore Constructor Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.IonApiServiceCore.html Initializes a new instance of the IonApiServiceCore class. It requires an httpService and a formService for its operation. ```APIDOC ## IonApiServiceCore Constructor ### Description Initializes a new instance of the IonApiServiceCore class. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "httpService": "IHttpService", "formService": "IFormService" } ``` ### Response #### Success Response (200) - **IonApiServiceCore** (IonApiServiceCore) - A new instance of IonApiServiceCore. #### Response Example ```json { "instance": "IonApiServiceCore" } ``` ``` -------------------------------- ### Get User Context Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.UserService.html Retrieves the current user's context. This method returns an Observable that emits the user context information. ```typescript getUserContext(): Observable { // Implementation of IUserService.getUserContext } ``` -------------------------------- ### Get ION API context Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Retrieve the ION API context, which includes the URL and authentication token. This method is asynchronous and returns an Observable. ```typescript // Get ION API context (URL and token) getContext() { this.ionApiService.getContext().subscribe( (context: IIonApiContext) => { console.log("ION API URL:", context.getUrl()); console.log("Token available:", !!context.getToken()); }, (error) => { console.error("Failed to get ION context:", error); } ); } ``` -------------------------------- ### Get M3 API Date Pattern Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.MIConstants.html Retrieve the standard date pattern used for M3 API transactions. This constant is defined as 'yyyyMMdd'. ```typescript datePattern: "yyyyMMdd" = 'yyyyMMdd' ``` -------------------------------- ### Launch Application Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.ApplicationService.html The launch method is used to initiate an application or a specific link within the M3 environment. ```typescript launch(link): void ``` -------------------------------- ### Configure M3 Odin Project Settings Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Commands to update project configuration files, including proxy URLs for M3 and ION API, and handling authentication. ```bash # Set project name odin set name myNewProjectName # Configure M3 proxy URL for development odin set m3-proxy https://m3server.example.com # Configure ION API proxy URL odin set ion-proxy https://ionserver.example.com/TENANT # Login for cloud/multi-tenant authentication odin login --m3 --update-config ``` -------------------------------- ### IonApiService Constructor Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.IonApiService.html Initializes a new instance of the IonApiService. It requires an HttpClient, a FormService, and optionally an IIonApiConfig. ```APIDOC ## constructor IonApiService ### Description Initializes a new instance of the IonApiService. ### Parameters - **http** (HttpClient) - The HttpClient instance. - **formService** (FormService) - The FormService instance. - **config** (IIonApiConfig) - Optional configuration object for the Ion API. ### Returns [IonApiService] ### Overrides CoreBase.constructor ``` -------------------------------- ### Static toUri Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Bookmark.html Converts a bookmark into a URI string. ```APIDOC ## Static toUri ### Description Generates a URI string from a bookmark, optionally using a user context. ### Parameters - **bookmark** (IBookmark) - Required - The bookmark object. - **userContext** (IUserContext) - Optional - The user context. ### Response - **Returns** (string) - The generated URI string. ``` -------------------------------- ### Get ION API Base URL Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiContext.html Retrieves the base URL for making ION API requests. This URL is required to construct absolute API endpoints. ```typescript getUrl(): string; ``` -------------------------------- ### Configure and Execute IMIRequest Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Demonstrates defining MI request options, handling typed responses, and configuring legacy API versions. ```typescript import { IMIRequest, MIRecord } from "@infor-up/m3-odin"; import { MIService } from "@infor-up/m3-odin-angular"; // Basic request with all common options const request: IMIRequest = { program: "CRS610MI", transaction: "LstByNumber", // Output configuration outputFields: ["CUNO", "CUNM", "CUA1", "STAT"], maxReturnedRecords: 100, excludeEmptyValues: true, // Company/Division override (optional - defaults to user context) company: "100", division: "AAA", // Metadata options includeMetadata: true, // Include field metadata in response typedOutput: true, // Convert output to typed values (Date, Number) // Advanced options enableCsrf: true, // Enable CSRF token (default: true) version: 2, // Use v2 API endpoints (default: 2) tag: { customData: "myTag" } // Custom data returned in response }; // Input record for transaction const inputRecord = new MIRecord(); inputRecord.setString("CUNO", "1000"); request.record = inputRecord; // Execute and handle typed response miService.execute(request).subscribe((response) => { if (!response.hasError()) { console.log("Tag data:", response.tag); console.log("Metadata:", response.metadata); // With typedOutput: true, dates are Date objects, numbers are numbers response.items.forEach(item => { const date = item["RGDT"]; // Date object const amount = item["CUCD"]; // Number }); } }); // Force v1 API endpoint (legacy compatibility) const v1Request: IMIRequest = { program: "CRS610MI", transaction: "GetBasicData", record: { CUNO: "ACME" }, version: 1 }; ``` -------------------------------- ### Button Class Constructor Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Button.html Initializes a new instance of the Button class. ```APIDOC ## Constructor ### Description Creates a new instance of the Button control. ### Syntax `new Button()` ### Returns - **Button** - A new instance of the Button class. ``` -------------------------------- ### Get ION API OAuth Token Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiContext.html Retrieves the OAuth token required for authenticating ION API calls. This token must be included in the Authorization header. ```typescript getToken(): string; ``` -------------------------------- ### Constructor DatePicker Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.DatePicker.html Initializes a new instance of the DatePicker class with specific date formatting options. ```APIDOC ## Constructor DatePicker ### Description Creates a new DatePicker instance to manage date input fields. ### Parameters - **dateFormat** (string) - Required - The format string for the date. - **hideDateFormat** (boolean) - Required - Flag to determine if the date format should be hidden. ### Request Example new DatePicker("YYYY-MM-DD", false); ``` -------------------------------- ### Array Utility Functions Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.ArrayUtil.html Provides functions for manipulating arrays, such as finding items by predicate or property, getting the last item, moving items, and removing items. ```APIDOC ## itemByPredicate ### Description Gets the item matching the predicate. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (T[]) - Required - The array to search within. * **predicate** ((item: T) => Object) - Required - A function that returns true for the desired item. ### Returns T[] - The item matching the predicate. ### Defined in lib/util.ts:156 ``` ```APIDOC ## itemByProperty ### Description Gets the item in an array by matching the value of a specific property. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (any[]) - Required - The array to search within. * **name** (string) - Required - The name of the property to match. * **value** (any) - Required - The value the property should match. ### Returns any[] - The item matching the property. ### Defined in lib/util.ts:148 ``` ```APIDOC ## last ### Description Gets the last item in an array. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (any[]) - Required - The array to get the last item from. ### Returns any - The last item or null if the array is null or empty. ### Defined in lib/util.ts:190 ``` ```APIDOC ## move ### Description Moves an object in an array to another index. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (any[]) - Required - The array to modify. * **index** (number) - Required - The current index of the item to move. * **newIndex** (number) - Required - The new index for the item. ### Returns void - This function does not return a value. ### Defined in lib/util.ts:234 ``` ```APIDOC ## remove ### Description Removes an item in an array. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (any[]) - Required - The array to remove an item from. * **item** (any) - Required - The item to remove. ### Returns void - This function does not return a value. ### Defined in lib/util.ts:72 ``` ```APIDOC ## removeByPredicate ### Description Removes the first item in an array that matches a predicate function. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (T[]) - Required - The array to remove an item from. * **predicate** ((item: T) => boolean) - Required - A predicate function that returns true for a matching item in the array. ### Returns T - The removed item or null if the item could not be found. ### Defined in lib/util.ts:103 ``` ```APIDOC ## removeByProperty ### Description Removes an item in an array by matching the value of a specific property. ### Method Static ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **array** (any[]) - Required - The array to remove an item from. * **name** (string) - Required - The name of the property. * **value** (any) - Required - That value that the property should match. ### Returns any - The removed item or null if the item could not be found. ### Defined in lib/util.ts:87 ``` -------------------------------- ### Import IUserContext Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IUserContext.html Import the IUserContext interface from the @infor-up/m3-odin package. ```typescript import { IUserContext } from '@infor-up/m3-odin'; ``` -------------------------------- ### Import IIonApiService Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiService.html Import the IIonApiService interface from the @infor-up/m3-odin package. ```typescript import { IIonApiService } from '@infor-up/m3-odin'; ``` -------------------------------- ### Accessing Field Metadata Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIMetadataMap.html Example of how to access metadata for a specific M3 field using the IMIMetadataMap. The field name 'ITNO' is used as the key to retrieve its metadata object. ```typescript const info = metadataMap['ITNO']; ``` -------------------------------- ### Import IonApiService Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin_angular.IonApiService.html Import the service from the @infor-up/m3-odin-angular package. ```typescript import { IonApiService } from '@infor-up/m3-odin-angular'; ``` -------------------------------- ### Static getSource Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.Bookmark.html Retrieves the source string from a bookmark. ```APIDOC ## Static getSource ### Description Extracts the source identifier from a provided bookmark object. ### Parameters - **bookmark** (IBookmark) - Required - The bookmark object. ### Response - **Returns** (string) - The source string. ``` -------------------------------- ### IErrorState Interface Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IErrorState.html Represents an error state. This interface is implemented by classes that need a common way to indicate an error state. Common examples are response objects for services. ```APIDOC ## Interface IErrorState ### Description Represents an error state. This interface is implemented by classes that need a common way to indicate an error state. Common examples are response objects for services. #### Since 2.0.0 ### Properties #### `Optional` error - **error** (any) - Gets or sets an error. #### `Optional` errorCode - **errorCode** (string) - Gets or sets an error code. #### `Optional` errorMessage - **errorMessage** (string) - Gets or sets an error message. ### Methods #### hasError - **hasError**(): boolean - Gets a value that indicates if an error exists. An error is considered to exist if any of the error, errorMessage or errorCode properties are set. Note that if one property is set there is no guarantee that any of the other properties are set. #### Returns - boolean - True if an error exists. ### Example Usage ```typescript import { IErrorState } from '@infor-up/m3-odin'; // Assuming 'response' is an object implementing IErrorState const response: IErrorState = { errorMessage: 'An error occurred', errorCode: '500' }; if (response.hasError()) { console.error(`Error: ${response.errorMessage} (Code: ${response.errorCode})`); } ``` ### Implemented by * [ErrorState](../classes/_infor_up_m3_odin.ErrorState.html) ### Hierarchy * IErrorState * [IUserContext](_infor_up_m3_odin.IUserContext.html) * [IFormResponse](_infor_up_m3_odin.IFormResponse.html) ``` -------------------------------- ### Import IMIResponse Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IMIResponse.html Import the IMIResponse interface from the '@infor-up/m3-odin' package. ```typescript import { IMIResponse } from '@infor-up/m3-odin'; ``` -------------------------------- ### Get ION API Authorization Header Value Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiContext.html Retrieves the value for the HTTP authorization header, including the OAuth 2.0 Bearer token. This follows the format specified in RFC6750. ```typescript getHeaderValue(): string; ``` -------------------------------- ### Import IIonApiOptions Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiOptions.html Import the interface from the @infor-up/m3-odin package. ```typescript import { IIonApiOptions } from '@infor-up/m3-odin'; ``` -------------------------------- ### Retrieve Customer Basic Data Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md An example of retrieving basic customer data using the CRS610MI program and GetBasicData transaction. It specifies output fields for performance and includes error handling. ```typescript import { Component, OnInit, ViewChild } from "@angular/core"; import { CoreBase, IMIRequest, IMIResponse, IUserContext, MIRecord } from "@infor-up/m3-odin"; import { MIService } from "@infor-up/m3-odin-angular"; @Component({ templateUrl: "./customer.component.html" }) export class CustomerSampleComponent extends CoreBase implements OnInit { constructor(private miService: MIService) { super("CustomerComponent"); } ngOnInit() { this.getDetails(); } private getDetails() { const inputRecord = new MIRecord(); const customer = "ACME"; inputRecord.setString("CUNO", customer); const request: IMIRequest = { program: "CRS610MI", transaction: "GetBasicData", record: inputRecord, outputFields: ["CUNM", "CUNO", "CUA1", "CUA2", "CUA3", "CUA4", "YREF", "CSCD"] }; this.setBusy(true); this.miService.execute(request).subscribe((response: IMIResponse) => { this.setBusy(false); if (!response.hasError()) { this.logInfo("Customer Basic data for " + customer); const record: MIRecord = response.item as MIRecord; const address1 = record["CUA1"]; const address2 = record["CUA2"]; this.logInfo("Address 1 " + address1); this.logInfo("Address 2 " + address2); } else { this.handleError(response, customer); } // Handle error }, (response) => { this.setBusy(false); this.handleError(response, customer); }); } private handleError(response: IMIResponse, customer: string): void { this.logWarning("MI transaction " + response.transaction + " failed"); const errorCode = response.errorCode; const errorField = response.errorField; const errorMessage = response.errorMessage; let message = "Unable to get basic data for customer " + customer; if (errorCode === "WCU0203") { message = "The customer " + customer + " does not exist"; } this.logError(message + " " + errorMessage); } ``` -------------------------------- ### Configure IonApiService Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/README.md Configure the `IonApiService` using the `IonApiConfig` DI token to set optional properties and overrides, such as `withCredentials`. ```typescript import { IonApiConfig, M3OdinModule } from '@infor-up/m3-odin-angular'; @NgModule({ imports: [ M3OdinModule, ], providers: [ { provide: IonApiConfig, useValue: { withCredentials: true, // Override XMLHttpRequest.withCredentials. Default is false }, }, ], }) ``` -------------------------------- ### getContext Method Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IIonApiService.html Gets an ION API context required for making ION API HTTP requests. This method is asynchronous and may require a server request to obtain the OAuth token. ```APIDOC ## getContext * getContext(options?): Observable * Gets an ION API context required when making ION API HTTP requests. This function is asynchronous since a server request might be required to get the OAuth token for ION API. In most cases an ION API request can be executed using the executeIonApiAsync function that will automatically get the ION API context and retry requests when the OAuth token has expired. This function can be used when more control is required when making the request or when the executeIonApiAsync fuction cannot be used for some other reason. The OAuth token has a limited lifetime and will become invalid once it has timed out. The OAuth token might be invalid if an ION API HTTP request returns 401. A client can get a new ION API context with a new OAuth token by setting the refresh property to true on the options parameter. #### Parameters * `Optional` options: IIonApiOptions Optional object for specifying options when getting the context. #### Returns Observable A promise that will be resolved when the ION API context is available. * Defined in [lib/types.ts:294](https://github.com/infor-cloud/m3-h5-sdk/blob/de0703f2c73b36d9c8990310d46afb30b989ef48/m3-odin/projects/infor-up/m3-odin/src/lib/types.ts#L294) ``` -------------------------------- ### IEnvironmentContext Interface Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/interfaces/_infor_up_m3_odin.IEnvironmentContext.html Defines environment context values. These values are also available on the user context if the application is running in a H5 tab. This context is only useful when there is an application without an existing H5 session but there is still the need to get the ION Api URL. Calling this method might result in a login if the data isn't already available. ```APIDOC ## Interface IEnvironmentContext Defines environment context values. The values are also available on the user context if the application is running in a H5 tab. This context is only useful when there is an application without an existing H5 session but there is still the need to get the ION Api URL. Calling this method might result in a login if the data isn't already available. ### Properties * **ionApiUrl** (string) - The ION Api Url. Default if not configured is null. * **isMultiTenant** (boolean) - If H5 is running multiple tenants. Default is false. * **version** (string) - Optional. Get the H5 version. ``` -------------------------------- ### Import IonApiServiceCore Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.IonApiServiceCore.html Import the IonApiServiceCore class from the @infor-up/m3-odin package. This is typically done at the beginning of a TypeScript or JavaScript file where the service will be used. ```typescript import { IonApiServiceCore } from '@infor-up/m3-odin'; ``` -------------------------------- ### M3 Odin SDK - Methods Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.List.html Details on the various methods available for M3 Odin SDK objects. ```APIDOC ## Methods ### Description This section details the methods available for M3 Odin SDK objects, used for retrieving information about the object's state and dimensions. ### Methods #### Get Methods - **getLeft**() - Returns the left position of the object. - **getTop**() - Returns the top position of the object. - **getTypeName**() - Returns the type name of the object. - **getWidth**() - Returns the width of the object. ### Request Example ```json { "example": "No request body for method calls" } ``` ### Response #### Success Response (200) - **getLeft** - Returns the left coordinate (number). - **getTop** - Returns the top coordinate (number). - **getTypeName** - Returns the type name (string). - **getWidth** - Returns the width (number). #### Response Example ```json { "example": "Number or String representing the returned value" } ``` ``` -------------------------------- ### Settings Source: https://github.com/infor-cloud/m3-h5-sdk/blob/master/m3-odin/docs/classes/_infor_up_m3_odin.ListCell.html Configuration settings for theme and member visibility. ```APIDOC ## Settings ### Member Visibility * Protected * Inherited ### Theme OSLightDark ``` -------------------------------- ### Configure IonApiService with custom settings Source: https://context7.com/infor-cloud/m3-h5-sdk/llms.txt Configure the IonApiService with custom settings like withCredentials. This is typically done in the application's module configuration. ```typescript import { Component } from "@angular/core"; import { IIonApiRequest, IIonApiResponse, IIonApiContext } from "@infor-up/m3-odin"; import { IonApiService, IonApiConfig, M3OdinModule } from "@infor-up/m3-odin-angular"; // Module configuration for IonApiService @NgModule({ imports: [M3OdinModule], providers: [ { provide: IonApiConfig, useValue: { withCredentials: true // Set XMLHttpRequest.withCredentials } } ] }) export class AppModule {} ```