Transfer order receive codeunit

I want to run a function when transfer order receive Boolean OK is clicked.
whenever the user click ok of receive Boolean ,then the function will check the condition if the condition it meets for that user by running the function defined,if is ok then receive will work else it will show an error message.

Please help me where i have to write and call the function on transfer order codeunit

here is my function calling

IF NOT CheckLocationUser(user,"Transfer-to Code") THEN
ERROR('You are not allowed to Recieve beyond Your Location');


  • da_nealda_neal Member Posts: 76
    edited 2019-09-12
    5705 TransferOrder-Post Receipt (OnRun)
  • jhoomnewidjhoomnewid Member Posts: 5
    @da_neal I have written the the code on 5705 under "Onrun.But it is not working....
    in both cases it is showing the message.,ie, if user and transfer to location matches and if does not match...for both it is showing the defined error message.
    I have allocated transfer to location for each user in "mylocations" table.
    Now at time of recive if current logged in user trying too recieve the order beyond his allocated location, then the error message will spark.But in my casemessage is showing whether use and transfer to location matches or not with mylocation table...


    this is where i defined the locations against the user


    Code and function "on run" of 5705 codeunit


    additional info....

    plz help
  • da_nealda_neal Member Posts: 76
    hm... Where in your function filter to User?
  • jhoomnewidjhoomnewid Member Posts: 5
    @da_neal yaa....u r right...

    I have written the same function for "transfer from code" in transfer header....
    as below
    Transfer-from Code - OnValidate()

    user := USERID;
    //MESSAGE(Text008, USERID);
    IF NOT CheckLocationUser(user,"Transfer-from Code") THEN
    ERROR('You are not allowed to Ship/Recieve beyond Your Location');

    will the same work here in 5705?
  • da_nealda_neal Member Posts: 76

    advice one: name parameter not same as field, in your function best to name TransferToCode, not
    "Transfer-to Code".
    advice two: check which variable you use. TransferHeader is a global variable not initialized yet in your sequence code.
Sign In or Register to comment.