Page History
...
You can call the frequently performed operations by transferring them to a common form, and you can make your script shorter and compacter.
Code Block |
---|
Set(@YetkiKodu@AuthorizationCode, "GIRISENTRY") // Assigning the authorization code to use for the address to the variable CallForm(AdresListeleSecListSelectAddress) // Calling the address selection form If(@AdresSecimSonucu @AddressSelectionResult= -1,Goto(BasaDon)) // Redirecting the script if the wrong result is returned from the form BeginForm(AdresListeleSecListSelectAddress) // Common address selection form Set(@AdresSecimSonucu@AddressSelectionResult, 0) // Resetting result variable Address.List("AuthCode='@YetkiKodu@AuthorizationCode'","",@AdresListesi@AddressList) If(@AdresListesi@AddressList.rowCount<1) ShowMessage({"title":"UYARIWARNING","message":"TanımlıNo AdresAddress BulunamadıDefined","buttons":"TAMAMOK"},@Secenek@Option) Set(@AdresSecimSonucu@AddressSelectionResult, -1) // Incorrect result variable Else() If(@AdresListesi@AddressList.rowCount = 1) // TekIf adresthere varsais direkt @@Address değişkenine atanıyoronly one address, it is assigned directly to the @@Address variable Address.Get(@AdresListesi@AddressList.rows.1.Id) Else() // BirdenIf çokthere adresare varsamore listedenthan seçipone yaptırılıyoraddress, it is selected from the list PopupView(@AdresListesi@AddressList.rows,{"mode":"list","title":"KabulAcceptance AdresAddress ListesiList","fields":["Address|AdresAddress TanımıDefinition|15|L"]},@sira@order) Address.Get(@AdresListesi@AddressList.rows.@sira@order.Id) EndIf() EndIf() ReturnForm() // BuReturning formuto çağıranthe satıraline gerithat dönülüyorcalled this form EndForm() |
Sık kullandığınız sabitleri bir kez tanımlayıp, scriptin her yerinde kullanabilirsinizYou can define your favorites once and use them everywhere in the script.
Code Block |
---|
// Set komutucommand JSONsupports yapısındavariable değişkenassignment atamasınıin desteklerJSON structure. Set(@EmirDurum@OrderStatus, {"BekliyorPending":12,"IslemeAlindiProcessing":13, "TamamlandiCompleted":14}) // Emir statüsü tamamlandı olarak belirleniyor. JSON nesnelerin alt nesnelerine . (nokta) ile erişilebilir. CustomState.Get(@EmirDurum@OrderStatus.Tamamlandi) |
...
Completed) |
Do not use SQL command to fill in objects from database unless necessary. The List and Get commands retrieve data by performing many checks, including permissions.
Code Block |
---|
// KullanıcınınIt yetkisi olduğu-olmadığı, aktif firmaya ait olan-olmayan, kullanımda olan-olmayan bütün depoları getirirretrieves both the active and inactive warehouses of both the active and inactive company, whether it is authorized by that user. Sql("SELECT * FROM SysWarehouse", @Depolar@Warehouses) // SadeceIt aktifretrieves firmayaonly ait,the kullanımdaactive olanwarehouses veof othe kullanıcınınactive yetkisicompany, olanwhich depoları getiriris authorized by that user. Warehouse.List("","", @Depolar) |
...
@Warehouses) |
Do not use SQL commands for database update operations unless necessary. The Save command performs many checks while saving.
Code Block |
---|
// FişUpdates statüsünüthe Entegreslip Edildistatus olarakas güncellerIntegrated amabut entegrasyonu tetiklemezdoes not trigger the integration. Sql("UPDATE Slip SET StateId=19", @sonuc@result) // FişUpdates statüsünüthe Entegreslip Edildistatus olarakas güncellerIntegrated veand ointegrates statününinto otomatikERP eylemias olarakan ERP'yeautomatic entegreaction olmasınıof sağlarthat status. CustomState.Get(19) Slip.Save() |