Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
AppLab error e.replace is not a function when reading from data set
function Checkout(Payment_Type, Tip_Amt){
    var Cust_Order = [];
    readRecords(Order_Data,{},function(Rec){
        for (var i = 0; i < Rec.length; i++) {
            appendItem(Cust_Order, Rec[i].Table);
            appendItem(Cust_Order, Rec[i].Type);
            appendItem(Cust_Order, Rec[i].Item);
            appendItem(Cust_Order, Rec[i].Price);
    }
    console.log(Cust_Order);
  });
}

This is part of a restaurant ordering app I have to build for uni. I've saved the customers order in a data set and now I wish to read from that dataset and get the order to be able to calculate the bill and produce an itemised bill

WARNING: Line: 176: readRecords() table parameter value ([object Object]) is not a string.ERROR: Line: 176: TypeError: e.replace is not a function. (In 'e.replace(m,"-")', 'e.replace' is undefined)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Well, for one, your code is really botched. The table name in readRecords isn't a string, and you don't actually need to loop through every entry in the bill to get everything. The returned records are formatted as an object.

function Checkout(Payment_Type, Tip_Amt){
    var Cust_Order = [];
    readRecords("Order_Data",{},function(Rec){
        // Use Rec to get the bill after this line.
        console.log(Rec);
    }
  });
}

From there, you could effectively give them an itemized bill. Just make sure that you clear the table each time you get a new customer.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda