Skip to content

Commit

Permalink
XSJS function to insert entry in PrintQueue after Ticket was used #25
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf committed Oct 5, 2016
1 parent 54f4b19 commit b45c9ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions odatareceptionist/procedures/PrintQueue.xsjslib
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function PrintQueueUpdate(param){
$.trace.debug('entered function PrintQueueUpdate');
// let before = param.beforeTableName;
let after = param.afterTableName;
// Update PrintQueue
let pStmt = param.connection.prepareStatement('SELECT * FROM "' + after + '"' );
let rs = pStmt.executeQuery();
if (rs.next()) {
var TicketUsed = rs.getNString(4);
}
$.trace.debug('TicketUsed: ' + TicketUsed);
$.trace.debug('leave function PrintQueueUpdate');
}
2 changes: 2 additions & 0 deletions odatareceptionist/service.xsodata
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ service {
"com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketRead" as "Ticket" key ("ParticipantID")
create forbidden
update using "com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketUpdate"
events ( after "com.sap.sapmentors.sitreg.odatareceptionist.procedures:PrintQueue.xsjslib::PrintQueueUpdate" )
delete forbidden;

association "Event_Ticket" principal "Events"("ID") multiplicity "1"
dependent "Ticket"("EventID") multiplicity "*";
association "Participant_Ticket" principal "Participants"("ID") multiplicity "1"
dependent "Ticket"("ParticipantID") multiplicity "1";

// Read PrintQueue
"com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" as "PrintQueue"
create forbidden
Expand Down

0 comments on commit b45c9ec

Please sign in to comment.