You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »


4- Work Object Commands 

Command

Usage

Description

Example

Version

List

Object.List(filter

text/ID,

sorting, result

variable)

It enables the records to be retrieved from the database according to certain criteria for the relevant object.

The List command can return single or multiple records. Records can be accessed starting from variable @result variable.rows.1. This command returns a maximum of 1000 lines of records.

Results are not automatically displayed on the screen. After this command, it will be required to use the PopupView or TableView command to display the list on the screen.

SQL notation is used for filtering and sorting.

Arp.List("Code LIKE 'P%'","Code",

@cariListe)

If(@cariListe.rowCount <> 0)

PopupView(@cariListe.rows,

{"title":"Cari Listesi","fields":

["Code|Kodu|15|L","

Title|Adı|50|L"]},@secim)

EndIf()

1.0

Get

Object.Get(

filter

text

/ID, 

result

variable)

It enables a single record to be displayed according to certain criteria. It displays all fields of the record, and the additional table fields, if any.

The information returned as a result of the Get command is assigned to a result variable. If the variable is not specified, it is assigned to the related record object starting with @@.

In this case (when the command is used with a single parameter), the other related active objects are also filled in by the objects of the command if they are empty or different in the memory. (For example, the @@ItemUnit object is 1filled in with @@Item.)

It is shown below which objects are automatically filled in when the Get command is used for an object.

SQL notation is used for filter text. The Id information of the record can be written in the filter.

Item.Get("Code='@malzeme' OR

Name='@malzeme'")


Slip.Get(1) // 1 nolu fiş getirilir

Warehouse.Get("Code='20'",


@@Warehouse2) // 20 kodlu depo

bilgisi getirilir @@Warehouse2

nesnesine atanır.

1.0

New

Nesne.New

({"alan1" :

"değer1", "alan2" 

: "değer2"} 1/0)

Bu komut, yanına belirlenen alanları json dizisi formatında parametre olarak alır ve ilgili değerleri kullanarak yeni bir kayıt oluşturur. Oluşan kayıt aktif nesneye kaydedilir.

Komutun ikinci parametresi oluşturulan kaydın veritabanına kaydedilip kaydedilmeyeceğini belirler. (0-Kaydetme, 1-Kaydet) İkinci parametre yazılmaması halinde varsayılan olarak 0 değeri kullanılır.

WorkOrder.New({"SlipType":"3"},1)

1.0

Set

Nesne.Set

({"alan1" :

"değer1", "alan2"

: "değer2"})

Set komutu, yanına belirlenen alanları json dizisi formatında parametre olarak alır ve ilgili değerleri aktif nesneye kaydeder.

Nesnenin başka tablolarla ilişkilerini belirleyen referans alanları (Slip nesnesi için WarehouseId gibi) bu komutla güncellenemez. Bu tür bağlantılar için Get komutu kullanılarak (Warehouse.Get gibi) nesne hafızaya yüklenmelidir.

Parametre olarak @ ile başlayan (aynı yapıya sahip) bir nesne verilirse, o nesneyi aktif nesne olarak belirler.

Bu komut veritabanına kayıt yazmaz. Sadece hafızadaki aktif nesne güncellenir. Veritabanına kaydetmek için bu komuttan sonra Save komutunun kullanılması gerekir.

SlipLine.Set({"Approval":1})

1.0

Save

Nesne.Save()

Save komutu hafızada hazırlanmış olan nesneyi veritabanına kaydeder.

Bu komut kaydetme sırasında gerekli kontrolleri yapar. Nesnenin ilişkili olduğu diğer nesneler (Slip nesnesi için Warehouse nesnesi gibi) hafızaya yüklenmiş durumdaysa o nesnelerden Id bilgilerini alarak kayda ekler. Bu sebeple, bir nesne kaydedilmeden önce, daha önceden hafızaya alınmış ama kullanılmayacak nesnelerin ResetVariables komutuyla temizlenmesi gerekir.

SlipLine.Save()

1.0

Generate

Nesne.Generate

(nesneye göre

parametreler)

Fiş kayıtlarını toplu olarak oluşturmayı sağlar. Kullanıldığı nesneye göre yapısı değişiklik gösterir. Nesneye göre tek bir kayıttan ya da birden çok kayıttan toplu oluşturma işlemi yapabilir.

Planlama oluşturma: PlanningSlip.Generate(kaynak liste türü, kaynak sipariş listesi ya da sipariş satır listesi) OrderSlip.List komutundan dönen sipariş listesinin satırlarından ya da OrderSlipLine.List komutundan dönen listeyle bir planlama kaydı oluşturur.

Kaynak liste türü: Sipariş-153, Sipariş satırları-154 (v1.2 den itibaren)

Emir oluşturma: WorkOrder.Generate(kaynak fiş türü, hedef işlem türü, kaynak sipariş/planlama listesi)

Kaynak fiş türü: Sipariş-153, Planlama-155

Hedef işlem türü: 1-Giriş, 2-Çıkış, 3-Transfer (v1.2 den itibaren)

Stok fişi oluşturma: Slip.Generate(emir fişi nesnesi) Eğer hiç emir fişi nesnesi verilmezse, hafızadaki aktif emir nesnesinden (@@WorkOrder) stok fişi oluşturulur.

Taşıma kabı oluşturma: Container.Generate({"count": "oluşturulacak etiket sayısı"}) İsteğe bağlı olarak count değişkeninden sonra Container

nesnesinin alanları da (Description gibi) yazılabilir. Yazılan alanın değeri dolu olarak kaydedilecektir. Bu komut kullanılmadan önce mutlaka

ContainerType.Get nesnesiyle ilgili taşıma kabı türü hafızaya yüklenmelidir. İstenirse, oluşturulan taşıma kabı fişlerde hedef taşıma kabına

(@@Container2) atanabilir.

Generate komutu çalıştırıldığında sonuç olarak oluşan nesne otomatik olarak hafızaya yüklenir. Örneğin, Slip.Generate komutundan sonra @@Slip nesnesi dolar.

PlanningSlip.Generate(153, 1.0 @siparisler.rows)
PlanningSlip.Generate(154,
@siparissatirlari.rows)

WorkOrder.Generate(153, 1, @siparisler.rows) // giriş siparişi, giriş emri örneği
WorkOrder.Generate(154, 3,
@planlamalar.rows) // giriş
planlaması, transfer emri

Slip.Generate(@emir)
Slip.Generate()
Container.Generate({"Count":"1"})
Container.Generate({"Count":"1","
Description":"örnek"})
Container.Generate({"Count":"1"}, @@Container2)

1.0
Run
Kullanıcı tanımlı iş kurallarını script içinden çalıştırmak için kullanılır. Henüz kullanıma açılmamıştır.

Komutların nesnelere göre kullanım matrisini Komutların kullanıldığı iş nesneleri sayfasından inceleyebilirsiniz.


Related objects specified automatically with Get command


Object Name

Model Name

Objects specified automatically with Get command

Address

Address

Warehouse, WarehouseFloor, WarehouseZone, WarehouseBlock

Address Material Link

AddressItem Warehouse, Address, Item, ItemUnit


ERP Company Definitions

ErpFirm

Erp, Warehouse

Factories

Factory

Division

Materials

Item

ItemUnit, malzeme varyant ise Item+ItemVariant

Material Content

ItemContent

Item, ItemUnit

Material Parameters

ItemParameter

Warehouse, Item

Serial/Lot Information

ItemTracking

Item, ItemUnit

Material Units

ItemUnit

Item

Orders

OrderSlip

Warehouse, Warehouse2, Arp, DeliveryArp, ShipmentAddress, Carrier, SalesPerson, Vehicle, Project

Order Lines

OrderSlipLine

Warehouse, Item, ItemUnit, Arp, Project, Department, Department2, Division2, Factory2

Planning Slips

PlanningSlip

Warehouse, Warehouse2, Arp, DeliveryArp, ShipmentAddress, Carrier, SalesPerson, Vehicle, Driver, Project

Planning Slip Lines 

PlanningSlipLine

Warehouse, Address, Item, ItemUnit, Arp, Project, AssignedUser, Department, Department2, Division2, Factory2, OrderSlip,OrderSlipLine

Production Orders 

ProductionOrder

Item, ItemUnit, Arp, Project, Factory

Production Work Orders 

ProductionOrderLine

Item, ItemUnit, Factory

Reservation Slips

ReservationSlip

Warehouse, Department, Division, Factory, OrderSlip, PlanningSlip, ProductionOrder, WorkOrder

Reservation Slip Lines

ReservationSlipLine

Address, Container, ChildContainer

Sevkiyat Adresleri

Shipment Address

Arp

Shipment Days

Shipment Day

Arp/ShipmentAddress

Stock Slips

Slip

Warehouse, Warehouse2, Department, Division, Factory, Department2, Division2, Factory2, Arp, DeliveryArp, ShipmentAddress, Carrier, SalesPerson, Vehicle, Driver, Project, CustomSlipType, OrderSlip, PlanningSlip, ProductionOrder, WorkOrder

Stock Slip Lines

SlipLine

Warehouse, Address, Address2, Item, ItemUnit, Arp, Project, AssignedUser, Department, Division, Factory, Department2, Division2,Factory2, OrderSlipLine, PlanningSlipLine, ProductionOrderLine, WorkOrderLine, Container, ChildContainer

Material Unit Codes

UnitBarcode

Item, ItemUnit, varsa ItemVariant

Vehicles

Vehicle

Warehouse

Warehouses

Warehouse

Department, Division, Factory

Order Slips

WorkOrder

Warehouse, Warehouse2, Department, Division, Factory, Department2, Division2, Factory2, Arp, DeliveryArp, ShipmentAddress,SalesPerson, Vehicle, Driver, Project, OrderSlip, PlanningSlip, ProductionOrder

Order Slip Lines

WorkOrderLine

Warehouse, Warehouse2, Address, Address2, Item, ItemUnit, Arp, Project, AssignedUser, Department, Division, Factory, Department2, Division2, Factory2, OrderSlipLine, PlanningSlipLine, ProductionOrderLine, Container, ChildContainer