infor-cloud / m3-h5-sdk

https://infor-cloud.github.io/m3-h5-sdk/
35 stars 20 forks source link

Infor M3 Odin 2.0.0 => bookmark CMS100 #19

Closed jrgwan closed 4 years ago

jrgwan commented 4 years ago

Description

I want bookmark a CMS100 InforBrowserCategory and then I want to see the results in my bookmark-cms100.component.html . … my Basic example was CRS610/E ... The bookmark is running, but I get no data back in my HTML dataForm … could someone help me ? //Jörg

Version

Angular CLI: 7.1.4 Node: 10.13.0 OS: win32 x64 Angular: 7.1.4 angular-devkit/architect 0.11.4 angular-devkit/build-angular 0.13.4 angular-devkit/build-optimizer 0.13.4 angular-devkit/build-webpack 0.13.4 angular-devkit/core 7.1.4 angular-devkit/schematics 7.1.4 angular/cdk 7.1.1 angular/material 7.1.1 ngtools/webpack 7.3.4 schematics/angular 7.1.4 schematics/update 0.11.4 rxjs 6.3.3 typescript 3.1.6 webpack 4.40.2

Below my bookmark-cms100.component.html

Bookmark-CMS100 sample

Stateless detail bookmark (CMS100/E) ...

<button mat-raised-button color="primary" (click)="onClickOpen()" [disabled]="!isEnabled()" class="inline-btn">Open <div *ngIf="controlInfos">

EK-VK-Preise

Below my bookmark-cms100.component.ts import { Component } from '@angular/core'; import { MatSnackBar } from '@angular/material'; import { CoreBase, IBookmark, IFormControlInfo, IFormResponse } from '@infor-up/m3-odin'; import { FormService } from '@infor-up/m3-odin-angular';

@Component({ templateUrl: './bookmark-cms100.component.html' }) export class BookmarkCMS100SampleComponent extends CoreBase { // fieldNames = ['WWNFTR,WWAGGR,WWSUB1,WWSUB2,WWSUB3']; fieldNames = ['ODPRRF,MSTX40,ODCUNO,ODSAPR,ODCUCD,DSAPPR,&MARG']; controlInfos: IFormControlInfo[]; canExecute = true; ITNO: string;

constructor(private readonly formService: FormService, private snackBar: MatSnackBar) { super('BookmarkCMS100SampleComponent'); }

isEnabled(): boolean { return this.canExecute && !!this.ITNO; }

onClickOpen(): void { this.logDebug('open: ' + this.ITNO); this.canExecute = false; this.openBookmark(); }

private openBookmark(): void { const bookmark = this.getBookmark(); bookmark.values = { ODITNO: this.ITNO };

  this.formService.executeBookmark(bookmark).subscribe((r) => {
     this.onResponse(r);
  }, (r) => {
     this.onError(r);
  });

}

private onResponse(response: IFormResponse): void { if (response.result !== 0) { this.onError(response); return; }

  const panel = response.panel;
  if (panel) {
     this.controlInfos = panel.getControlInfos(this.fieldNames);
  }

  this.canExecute = true;

}

private onError(response: IFormResponse): void { const message = response.message || 'Unable to open bookmark'; this.logError(message); this.snackBar.open('Bookmark error' + message + '. More details might be available in the browser console.', 'Close', { duration: 5000 } );

  this.canExecute = true;

} / private getBookmark(): IBookmark { return { program: 'CRS610', table: 'OCUSMA', keyNames: 'OKCONO,OKCUNO', option: '5', panel: 'E', isStateless: true }; } /

private getBookmark(): IBookmark { return { program: 'CMS100', table: 'CSYIBC', includeStartPanel: false, requirePanel: false, suppressConfirm: false, sortingOrder: '6', view: 'CD151_V01', keyNames: 'ODCONO,ODITNO', fieldNames: 'ODCONO,ODITNO', // fields: 'WWNFTR,WWAGGR,WWSUB1,WWSUB2,WWSUB3', fields: 'ODPRRF,MSTX40,ODCUNO,ODSAPR,ODCUCD,DSAPPR,&MARG', parameters: 'XXIBCA,CD150_V01,XXSIMU', informationCategory: 'CD151_V01', isStateless: false, startPanel: 'B', }; console.log('jwLogging: '); } }

Package Version

@angular-devkit/architect 0.11.4 @angular-devkit/build-angular 0.13.4 @angular-devkit/build-optimizer 0.13.4 @angular-devkit/build-webpack 0.13.4 @angular-devkit/core 7.1.4 @angular-devkit/schematics 7.1.4 @angular/cdk 7.1.1 @angular/material 7.1.1 @ngtools/webpack 7.3.4 @schematics/angular 7.1.4 @schematics/update 0.11.4 rxjs 6.3.3 typescript 3.1.6 webpack 4.40.2 ``

jrgwan commented 4 years ago

IBookmark_2

AMG762 commented 4 years ago

Hi Jörg, maybe you are missing this fix ? Depending in which environment you are working ?

JT-1149705 CMS100 bookmark parameters do not work | JT-1149705 CMS100 bookmark parameters do not work

In CMS100: Method getBookmarkParameters is added to make bookmark parameters to work and added two new bookmark parameters XXIBCA and XXSIMU. If they are active, the corresponding values as startPanelFields are ignored and table name are retrieved from CSYIBC instead of from bookmark.getTableName(). If no SIMU field is transferred, WWSIMU will get value = 0 and new heading A_00120 (Custom list) will be displayed. >> Related corrections/Comment: MUA-13105 needed to be able to create the bookmark correctly in H5 In CMS100: Method getBookmarkParameters is added to make bookmark parameters to work and added two new bookmark parameters XXIBCA and XXSIMU. If they are active, the corresponding values as startPanelFields are ignored and table name are retrieved from CSYIBC instead of from bookmark.getTableName(). If no SIMU field is transferred, WWSIMU will get value = 0 and new heading A_00120 (Custom list) will be displayed. >> Related corrections/Comment: MUA-13105 needed to be able to create the bookmark correctly in H5

In CMS100: Method getBookmarkParameters is added to make bookmark parameters to work and added two new bookmark parameters XXIBCA and XXSIMU. If they are active, the corresponding values as startPanelFields are ignored and table name are retrieved from CSYIBC instead of from bookmark.getTableName(). If no SIMU field is transferred, WWSIMU will get value = 0 and new heading A_00120 (Custom list) will be displayed. >> Related corrections/Comment: MUA-13105 needed to be able to create the bookmark correctly in H5

//Andrea