Sp ye istek atıp dönen id bir tane ise record fazla ise grid açan buton scripti

console.log('this', this);

let bankReceiptId = this.recordService.component.allFormControls['ID'].value;
let Id = this.recordService.component.allFormControls['ID'].value;
(async () => {
  if (Id) {
    this.recordService.component.api
      .execSP({
        Object: 'SP_EASYPMS_ACCOUNTING_BANKRECEIPT_INTEGRATE',
        Parameters: {
          BANKRECEIPTID: bankReceiptId,
          HOTELID: this.recordService.component.api.tenant.HOTELID,
          CREATORID: this.recordService.component.api.tenant.HOTELID,
        },
      })
      .subscribe((resp) => {
        console.log('resp', resp);
        if (resp[1].length == 1) {
          (async () => {
            let openRecord = await this.recordService.component.popupService
              .openRecord('accounting-receipt', resp[1][0].PrimaryKey)
              .toPromise();
          })();
        } else if (resp[1].length > 1) {
          (async () => {
            let ids = [];
            resp[1].forEach((element) => ids.push(element.PrimaryKey));
            console.log(ids);
            let openGrid = await this.recordService.component.popupService
              .openGrid('accounting-receipt', {
                extraFilters: [{ Column: 'ID', Operator: 'IN', Value: ids }],
              })
              .toPromise();
          })();
        }
      });
  } else {
    let msg3 = `Must Be Saved First`;
    msg3 = angus.languageService.staticTranslator.translate(msg3);
    throw msg3;
  }
})();

Last updated