Thursday, 12 March 2015
Find BatchId with a KanbanCardId
Public InventBatchId findByKanBanCardId(KanbanCardId _kanbanCardId)
{
Kanban kanban;
KanbanCard kanbanCard;
KanbanJob kanbanJob;
InventTransOrigin inventTransOrigin;
InventTrans inventTrans;
InventDim inventDim;
// Obviously for Batches of ONE
select firstOnly InventBatchId from inventDim
join inventTrans
where inventDim.inventDimId == inventTrans.inventDimId
join inventTransOrigin
where inventTrans.InventTransOrigin == inventTransOrigin.RecId
join kanbanJob
where inventTransOrigin.InventTransId == kanbanJob.InventTransId
&& inventTransOrigin.dataAreaId == kanbanJob.InventTransDataAreaId
join kanbanCard
where kanbanJob.RecId == kanbanCard.kanban
&& kanbanCard.CardId == _kanbanCardId;
return inventDim.InventBatchId;
}
Attach a document
static void attachDoc(RefTableId _refTableId, RefRecId _refRecId, selectableDataArea _refCompanyId,
FileName _name)
{
DocuRef docuRef;
DocuActionArchive archive;
;
docuRef.clear();
docuRef.RefRecId = _refRecId;
docuRef.RefTableId = _refTableId;
docuRef.RefCompanyId = _refCompanyId;
docuRef.Name = _name;
docuRef.TypeId = 'File';
docuRef.insert();
archive = new DocuActionArchive();
archive.add(docuRef, _name);
}
Subscribe to:
Posts (Atom)