E: Open Sales Order from Workorder

In the following example we insert a golden arrow in a Work order document.

 

workorder2salesorder

 

If the customer clicks on it, the system opens the linked Work order.

 

Note: This only works

- if the work order is created from "sales order" or "sales order to production order"

- "Collective order", "Merge work order" not supported.

 

beasscript-logo-small

global function form_loaded
item.auftrag.detailbitmap=opensalesorder()
end global
 
global function opensalesorder

// Read from work order position the linked Document
// Note: This is only working for SalesOrder to Production orders. 
// Pre Invoice or other base documents not supported in this example
select top 1 "BEAS_FTPOS"."DocEntry" into :ll_docEntry &
  from "BEAS_FTPOS" where "BEAS_FTPOS"."BELNR_ID" = <dw_1.item.belnr_id.value,#0> and "BEAS_FTPOS"."DocEntry">0
if <ll_docEntry> n> 0 then
  openwindow=fo_Order=<ll_docEntry>
end if
end global

 

help-hinweis Example Notes