Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
// This operation reads and fills in the @@Warehouse, @@WarehouseFloor, @@WarehouseZone, @@WarehouseBlock objects from the database along with the @@Address object.
Address.Get("Address='@AdresBarkod@AddressBarcode'")
 
// This operation only fills the @Address object with the address information read from the database.
Address.Get("Address='@AdresBarkod@AddressBarcode'",@Adres@Address)

All objects in the script are global. Once it is filled in, it stays filled unless it is reset or filled by another command. To avoid saving errors, you should reset the variables to affect the operation before the operation.

...

You can call the frequently performed operations by transferring them to a common public form, and you can make your script shorter and compacter.

Code Block
Set(@AuthorizationCode, "ENTRY") // Assigning the authorization code to use for the address to the variable
CallForm(ListSelectAddress) //  Calling the address selection form
If(@AddressSelectionResult= -1,Goto(BasaDon)) //  Redirecting the script if the wrong result is returned from the form
 
BeginForm(ListSelectAddress) // CommonPublic address selection form
    Set(@AddressSelectionResult, 0) // Resetting result variable
    Address.List("AuthCode='@AuthorizationCode'","",@AddressList)
    If(@AddressList.rowCount<1)
        ShowMessage({"title":"WARNING","message":"No Address Defined","buttons":"OK"},@Option)
        Set(@AddressSelectionResult, -1) // Incorrect result variable
    Else()
        If(@AddressList.rowCount = 1) // If there is only one address, it is assigned directly to the @@Address variable
            Address.Get(@AddressList.rows.1.Id) 
        Else() // If there are more than one address, it is selected from the list
            PopupView(@AddressList.rows,{"mode":"list","title":"Acceptance Address List","fields":["Address|Address Definition|15|L"]},@order)
            Address.Get(@[email protected])
        EndIf()
    EndIf()
    ReturnForm() // Returning to the line that called this form
EndForm()

...

Code Block
// Set command supports variable assignment in JSON structure.
Set(@OrderStatus, {"Pending":12,"Processing":13, "Completed":14})
 
// EmirThe statüsüorder tamamlandıstatus olarak belirleniyor. JSON nesnelerin alt nesnelerine . (nokta) ile erişilebiliris set as completed. The sub-objects of JSON objects can be accessed with . (dot).
CustomState.Get(@OrderStatus.Completed)

Do not use SQL command to fill in objects from the database unless necessary. The List and Get commands retrieve data by performing many checks, including permissions.

...