D365 F&O offers you the possibilty to customize many processes in your warehouse. One way to do it is using custom work types. Typically you would use for the picking work template, work types of ‘Pick’ and ‘Put’. But you can add the type ‘Custom’.
Custom Work Type
To add custom work types navigate to: Warehouse amanagement -> Setup -> Work -> Custom work types
Custom method
Below you can see a example code for a custom work type. You need to implement WhsIWorkTypeCustomProcessor and do not forget to decorate the class with WhsWorkTypeCustomProcessorFactor and add as the parameter the custom method name of the corresponding custom work type you created or going to create. And then add your code that should be executed in the process function. Read out over _parameters different data. Like for example the workline or the captured data from the work only if you checked Capture data.
[WhsWorkTypeCustomProcessorFactory('SampleUpdateWorkType')]
public class SampleUpdateWorkType implements WhsIWorkTypeCustomProcessor
{
#WHSRF
public void process(WhsWorkTypeCustomProcessParameters _parameters)
{
WHSWorkId currentWorkId = _parameters.workLine.WorkId;
var userId = _parameters.pass.lookup(#UserId);
str notes = _parameters.data;
//DO SOMETHING WITH THE DATA
}
}
*This post is locked for comments