Copy ค่าจาก List อื่นด้วย Workflow

ในบรรดาการทำงานของ workflow ที่เราใช้ๆกัน มี ทริกนึงที่น่าสนใจคือการเอา WorkFlow มาช่วยในการ หาค่า จาก List อื่นๆ มาใส่ใน List ที่รัน workflow ดูตัวอย่างเลย

Product Price list มีหน้าตาแบบนี้

image

Sales Order List ก็มีหน้าตาแบบนี้ required Field แค่สอง fields

image

แล้วเราก็มาสร้าง Workflow กันครับ ทำตามภาพได้เลย

image

พอกด Allow รอหนึ่งอึดใจก็จะได้หน้าตาแบบนี้ครับ

image

ใน Action ให้เราเลือก Set Field in Current Item  หรือจะพิมพ์เอาก็ได้คับ

image

Set Lookup Price เพื่อบอกกับ workflow ว่าให้ set ค่านี้

image

Data source ให้เลือก List ชื่อ ProductPriceList ที่เราเตรียมไว้ แล้วให้ return ค่า Price

image

เมื่อเลือกแล้ว หน้าตา Filter จะออกมาเป็นแบบนี้ ในส่วนของ Find the List item ให้เลือก filter Title (ของ ProductPriceList)

แล้ว Filter ด้วย Current item field ชื่อ Product

image

อันนี้ระบบจะเตือนเราในกรณีที่ ค่าที่ได้มีเกินหนึ่งค่า ระบบจะโยนค่าสุดท้ายมาให้แต่เรามั่นใจว่า ค่าที่ได้มีค่าเดียวแน่นอน

image

สุดท้าย workflow จะหน้าตาประมาณนี้ครับ

image

Save แล้วก็ Publish

image

อย่าลืมมาปรับค่าตรง Start Optionให้ workflow ทำงานตอนสร้าง (Created) และตอนเปลี่ยนแปลงด้วยคับ

image

ทดสอบ

ให้กลับมาที่ Sales order แล้ว new item กรอกข้อมูลแค่สอง fields พอ

image

แล้วกด Save ควรจะได้หน้าตาแบบนี้ครับ

image

รอแว๊บเดียว ก็จะได้ตามนี้  (ตรง Title สงสัยพิมพ์สูตรผิด แหะๆ) แต่เอาเป็นว่า ดึงราคามาถูก และ ฟังก์ชันการทำคำนวณถูก เป็นใช้ได้

image

ก็ประมาณนี้ครับ

สวัสดีครับ

LinkedInFlipboardEmailOutlook.comPrintFriendlyWhatsAppYahoo BookmarksYahoo MessengerKindle ItGoogle BookmarksBaiduDeliciousShare

5 thoughts on “Copy ค่าจาก List อื่นด้วย Workflow”

  1. :Joooooooooooooooooo das ist ja ne *Zierde* und ich werde in Zukunft immer nachsehen , was ich wieder bekomme , denn sowas dreistes ist mir noch nie passiert und wird auch nimmer passieren.Hmm ich war nur froh aus dem Taxi zu kommen , weil der mit 90 durch die Stadt raste , zum Glück waren es nur 4 km.Aber vielleicht dauert es ja auch wieder 10 Jahre , bis ich mal wieder mit nem Taxi fahre

  2. , closing the border to immigrants is a huge structural impediment. With borders open to goods, services, labor and capital, the supply-side argument becomes strange. We have plenty of supply of everything, many times that of the 1970s. We can source globally. What we need is demand, great honking gobs of it.

Leave a Reply to http://www.insurance.darktech.org/ Cancel reply

Your email address will not be published. Required fields are marked *