Participant
IDFC
Participant
TATA , MRF
Asset
FINANCEPROGRAM
Transaction
(Data need to submit)
participant(TATA) ,Asset (FINANCEPROGRAM ) ,loanAmount , loantenure
I need to check whether the transaction for FINANCEPROGRAM and TATA are already exist.
If so exist i need to reject the transaction.
var query1 = query('SELECT com.ett.blockchain.Programmeben WHERE (beneficiary == _$beneficiary AND bankprogramme == _$bank program) ');
return query('query1',{beneficiary : 'resource:com.ett.blockchain.Beneficiary #'+pgben.beneficiary .customerid,bankprogram: 'resource:com.ett.blockchain.Bankprogramme#'+pgben.bankprogramme.programmeid})
.then(function (transactions1) {
transactions1.forEach(function (trans1) {
console.log("transaction exist " );
});
throw Error("Transaction already exist");
});
you are missing a
buildQuery
statement.eg
See examples here (specifically, the 'Javascript code js' section) -> Why are the following added assets not persisted in the hyperledger registry?