Skip to content

Howto validate reservation number in additional fields with extension #1372

Discussion options

You must be logged in to vote

For someone trying to build something similar, here ist my now working solution:

function executeScript(scriptEvent) {
    var ticketIds = Object.keys(form.tickets);
    var validationFailure = 0;
    log.info('hello from script with event: ' + scriptEvent);
    log.info('extension parameters are: ' + extensionParameters);
    log.info('the reservation number is: ' + reservationId);
    for(var i=0; i < ticketIds.length; i++) {
        var ticketId = ticketIds[i];
        log.info("validating ticket {}", ticketId);
        var ticket = form.tickets[ticketId];
        if(ticket.additional !== null){
            var additionalFields = Object.keys(ticket.additional);
            for(var j=0; j<

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@SilentResonance
Comment options

Comment options

You must be logged in to vote
2 replies
@cbellone
Comment options

@SilentResonance
Comment options

Answer selected by SilentResonance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants