static server void RegorrerGrid(FormDataSource _fds_custtable)
{
custtable buffer2;
;
for(buffer2 = _fds_custtable.getFirst(true) ? _fds_custtable.getFirst(true) : _fds_custtable.cursor();
buffer2;
buffer2 = _fds_custtable.getnext())
{
info(buffer2.AccountNum);
}
}
jueves, 4 de agosto de 2011
miércoles, 3 de agosto de 2011
Crear Calidades en una ruta y abrir su respectiva pantalla ax 2009
void crear_calidad(ProdJournalRoute ProdJournalRoute )
{
InventQualityOrderTable InventQualityOrderTable;
ProdTable ProdTable;
//ProdJournalRoute ProdJournalRoute;
FormDataSource fds;
NumberSequenceCode NumberSequenceCode;
NumberSeq NumberSeq;
TubOperPruebas TubOperPruebas;
NumberSeqFormHandler NumberSeqFormHandler;//=NumberSeqFormHandler::construct();
Args args;
FormRun formRun;
;
ttsbegin;
NumberSeq=NumberSeq::newGetNum( NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(InventQualityOrderId))));
ProdTable=ProdJournalRoute.prodTable();
InventQualityOrderTable.initValue();
InventQualityOrderTable.initFromProdTable(ProdTable);
InventQualityOrderTable.initFromReferenceBuffer(ProdJournalRoute.prodRoute());
InventQualityOrderTable.QualityOrderId=NumberSeq.num();
InventQualityOrderTable.Qty=ProdJournalRoute.QtyGood;
TubOperPruebas =TubOperPruebas::find(InventQualityOrderTable.RouteOprId);
if(!TubOperPruebas)
{
throw(InventQualityOrderTable.RouteOprId+" no encuentra grupo de test");
}
InventQualityOrderTable.TestGroupId=TubOperPruebas.TestGroupId;
InventQualityOrderTable.insert();
ttscommit;
/////////////////////abrir pantalla/////////////7
args = new Args();
args.name(formStr("InventQualityOrderTable")); //form SysBoxForm is used to show the message
formRun = classFactory.formRunClass(args); //creating a FormRun object
args.record(InventQualityOrderTable); // as argument is optional
formRun.init();
formRun.run();
formRun.wait(); //waiting for user action
///////////////////////////////////////
}
{
InventQualityOrderTable InventQualityOrderTable;
ProdTable ProdTable;
//ProdJournalRoute ProdJournalRoute;
FormDataSource fds;
NumberSequenceCode NumberSequenceCode;
NumberSeq NumberSeq;
TubOperPruebas TubOperPruebas;
NumberSeqFormHandler NumberSeqFormHandler;//=NumberSeqFormHandler::construct();
Args args;
FormRun formRun;
;
ttsbegin;
NumberSeq=NumberSeq::newGetNum( NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(InventQualityOrderId))));
ProdTable=ProdJournalRoute.prodTable();
InventQualityOrderTable.initValue();
InventQualityOrderTable.initFromProdTable(ProdTable);
InventQualityOrderTable.initFromReferenceBuffer(ProdJournalRoute.prodRoute());
InventQualityOrderTable.QualityOrderId=NumberSeq.num();
InventQualityOrderTable.Qty=ProdJournalRoute.QtyGood;
TubOperPruebas =TubOperPruebas::find(InventQualityOrderTable.RouteOprId);
if(!TubOperPruebas)
{
throw(InventQualityOrderTable.RouteOprId+" no encuentra grupo de test");
}
InventQualityOrderTable.TestGroupId=TubOperPruebas.TestGroupId;
InventQualityOrderTable.insert();
ttscommit;
/////////////////////abrir pantalla/////////////7
args = new Args();
args.name(formStr("InventQualityOrderTable")); //form SysBoxForm is used to show the message
formRun = classFactory.formRunClass(args); //creating a FormRun object
args.record(InventQualityOrderTable); // as argument is optional
formRun.init();
formRun.run();
formRun.wait(); //waiting for user action
///////////////////////////////////////
}
martes, 2 de agosto de 2011
Registrar Diario Contable
server static void registrar_pago_cobranza(journalId id_jou)
{
LedgerJournalCheckPost LedgerJCP;
;
LedgerJCP = LedgerJournalCheckPost::newLedgerJournalTable(LedgerJournalTable::find(id_jou),NoYes::Yes,NoYes::Yes);
LedgerJCP.run();
}
{
LedgerJournalCheckPost LedgerJCP;
;
LedgerJCP = LedgerJournalCheckPost::newLedgerJournalTable(LedgerJournalTable::find(id_jou),NoYes::Yes,NoYes::Yes);
LedgerJCP.run();
}
lunes, 1 de agosto de 2011
LookUp Programado Con Rango de fechas, query, tabla Temporal
server static void lookupResponsable(object cont,FormDataSource fdsf,date fecha_Inicio,date fecha_fin)
{
SysTableLookup myLookup =
SysTableLookup::newParameters(tablenum(SMAGSTempserviceObject),cont);
Query query = new Query(querystr(SMAServiceOrderTableLine));
QueryBuildDataSource qbds;
QueryBuildRange qbr;
str rangos;
SMAServiceOrderTable _SMAServiceOrderTable;
SMAServiceOrderLine _SMAServiceOrderLine;
queryrun qr;
SMAGSTempserviceObject _SMAGSTempserviceObject;
RecordInsertList _SMAGSTempserviceObjectList;
//tcDateTime fecha_ini_t;
//UtcDateTime fecha_fin_t;
;
rangos = strfmt("%1..%2",Date2StrXpp(fecha_Inicio)+" 12:00:00 am",Date2StrXpp(fecha_fin)+" 11:59:59 pm");
qbds = query.dataSourceTable(tablenum(SMAServiceOrderTable));
qbds.addRange(fieldnum(SMAServiceOrderTable,ServiceDateTime)).value(rangos);
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Responsible));
qr=new queryrun(query);
while(qr.next())
{
_SMAServiceOrderLine=qr.get(tablenum(SMAServiceOrderLine));
_SMAServiceOrderTable=qr.get(tablenum(SMAServiceOrderTable));
_SMAGSTempserviceObject.ServiceObjectId=_SMAServiceOrderTable.Responsible;
_SMAGSTempserviceObject.descripcion= _SMAServiceOrderTable.ServiceResponsibleName();
_SMAGSTempserviceObject.doInsert();
}
myLookup.addLookupField(fieldnum(SMAGSTempserviceObject,ServiceObjectId));
myLookup.addLookupField(fieldnum(SMAGSTempserviceObject,descripcion));
myLookup.parmTmpBuffer(_SMAGSTempserviceObject);
myLookup.performFormLookup();
}
{
SysTableLookup myLookup =
SysTableLookup::newParameters(tablenum(SMAGSTempserviceObject),cont);
Query query = new Query(querystr(SMAServiceOrderTableLine));
QueryBuildDataSource qbds;
QueryBuildRange qbr;
str rangos;
SMAServiceOrderTable _SMAServiceOrderTable;
SMAServiceOrderLine _SMAServiceOrderLine;
queryrun qr;
SMAGSTempserviceObject _SMAGSTempserviceObject;
RecordInsertList _SMAGSTempserviceObjectList;
//tcDateTime fecha_ini_t;
//UtcDateTime fecha_fin_t;
;
rangos = strfmt("%1..%2",Date2StrXpp(fecha_Inicio)+" 12:00:00 am",Date2StrXpp(fecha_fin)+" 11:59:59 pm");
qbds = query.dataSourceTable(tablenum(SMAServiceOrderTable));
qbds.addRange(fieldnum(SMAServiceOrderTable,ServiceDateTime)).value(rangos);
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Responsible));
qr=new queryrun(query);
while(qr.next())
{
_SMAServiceOrderLine=qr.get(tablenum(SMAServiceOrderLine));
_SMAServiceOrderTable=qr.get(tablenum(SMAServiceOrderTable));
_SMAGSTempserviceObject.ServiceObjectId=_SMAServiceOrderTable.Responsible;
_SMAGSTempserviceObject.descripcion= _SMAServiceOrderTable.ServiceResponsibleName();
_SMAGSTempserviceObject.doInsert();
}
myLookup.addLookupField(fieldnum(SMAGSTempserviceObject,ServiceObjectId));
myLookup.addLookupField(fieldnum(SMAGSTempserviceObject,descripcion));
myLookup.parmTmpBuffer(_SMAGSTempserviceObject);
myLookup.performFormLookup();
}
LookUp Programado Con Rango de fechas y query
server static void lookupOT(object cont,FormDataSource fds,date fecha_Inicio,date fecha_fin)
{
SysTableLookup myLookup =
SysTableLookup::newParameters(tablenum(SMAServiceOrderTable),cont);
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange qbr;
str rangos;
SMAServiceOrderTable _SMAServiceOrderTable;
;
rangos = strfmt("%1..%2",Date2StrXpp(fecha_Inicio)+" 12:00:00 am",Date2StrXpp(fecha_fin)+" 11:59:50 pm");
qbds = query.AddDataSource(tablenum(SMAServiceOrderTable));
qbds.addRange(fieldnum(SMAServiceOrderTable,ServiceDateTime)).value(rangos);
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Serviceorderid));
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Description));
myLookup.addLookupField(fieldnum(SMAServiceOrderTable,Serviceorderid));
myLookup.addLookupField(fieldnum(SMAServiceOrderTable,Description));
myLookup.parmQuery(query);
myLookup.performFormLookup();
}
{
SysTableLookup myLookup =
SysTableLookup::newParameters(tablenum(SMAServiceOrderTable),cont);
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange qbr;
str rangos;
SMAServiceOrderTable _SMAServiceOrderTable;
;
rangos = strfmt("%1..%2",Date2StrXpp(fecha_Inicio)+" 12:00:00 am",Date2StrXpp(fecha_fin)+" 11:59:50 pm");
qbds = query.AddDataSource(tablenum(SMAServiceOrderTable));
qbds.addRange(fieldnum(SMAServiceOrderTable,ServiceDateTime)).value(rangos);
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Serviceorderid));
qbds.addGroupByField(fieldnum(SMAServiceOrderTable,Description));
myLookup.addLookupField(fieldnum(SMAServiceOrderTable,Serviceorderid));
myLookup.addLookupField(fieldnum(SMAServiceOrderTable,Description));
myLookup.parmQuery(query);
myLookup.performFormLookup();
}
Registrar lineas de servicio
SMAServiceFunctionLine serviceFunction;
Args args;
SMAServiceOrderLine Buffer2;
;
//// selecciona varias lineas
while select * from Buffer2 where Buffer2.ServiceOrderId==ot.text()
&& Buffer2.ServiceOrderStatus==SMAServiceOrderStatus::Created
&& Buffer2.TransactionType==SMATransactionType::Item
&& Buffer2.SignOff==noyes::Yes
{
SMAServiceOrderLineSurtidas_ds.markRecord(buffer2,1);
}
args= new Args();
args.caller(element);
args.record(SMAServiceOrderLineSurtidas);
args.parmEnum(SMAServiceFunctionType::Transfer);
serviceFunction = SMAServiceFunctionLine::construct(args);
serviceFunction.initDefaults(args);
/// // if (serviceFunction.checkSetup() && serviceFunction.prompt() /////Con dialogo
if (serviceFunction.checkSetup() ) ///sin dialogo
{
serviceFunction.run();
}
Args args;
SMAServiceOrderLine Buffer2;
;
//// selecciona varias lineas
while select * from Buffer2 where Buffer2.ServiceOrderId==ot.text()
&& Buffer2.ServiceOrderStatus==SMAServiceOrderStatus::Created
&& Buffer2.TransactionType==SMATransactionType::Item
&& Buffer2.SignOff==noyes::Yes
{
SMAServiceOrderLineSurtidas_ds.markRecord(buffer2,1);
}
args= new Args();
args.caller(element);
args.record(SMAServiceOrderLineSurtidas);
args.parmEnum(SMAServiceFunctionType::Transfer);
serviceFunction = SMAServiceFunctionLine::construct(args);
serviceFunction.initDefaults(args);
/// // if (serviceFunction.checkSetup() && serviceFunction.prompt() /////Con dialogo
if (serviceFunction.checkSetup() ) ///sin dialogo
{
serviceFunction.run();
}
Mandar E-mail
static void EnviarMail(Args _args)
{
SysMailer mail;
;
///Inicializar objeto SysMailer
mail = new SysMailer();
mail.SMTPRelayServer("ServidorSMTP.com",25,"CuentaMail","ContraseñaMail");
mail.fromAddress("CuantaMail");
mail.tos().appendAddress("CuantaMailDestino");
// Construir mensaje
mail.htmlBody(strfmt("Mensaje"));
mail.subject(strfmt("Asunto"));
mail.attachments().add("Ruta del archivo a Adjuntar");
mail.sendMail();
}
{
SysMailer mail;
;
///Inicializar objeto SysMailer
mail = new SysMailer();
mail.SMTPRelayServer("ServidorSMTP.com",25,"CuentaMail","ContraseñaMail");
mail.fromAddress("CuantaMail");
mail.tos().appendAddress("CuantaMailDestino");
// Construir mensaje
mail.htmlBody(strfmt("Mensaje"));
mail.subject(strfmt("Asunto"));
mail.attachments().add("Ruta del archivo a Adjuntar");
mail.sendMail();
}
Suscribirse a:
Entradas (Atom)