Skip to Content
author's profile photo Former Member
Former Member

SP TN Query - How to block owner field from changes?

Hi all,

I need help, how to write the query to block "owner" field in document from being change other than default value ?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 22, 2016 at 07:02 AM

    Hi,

    For which document you want to do this ?

    Thanks,

    Harshal

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member kamlesh Naware

      Hi Kamlesh,

      Maybe before this my testing was not complete.

      Now having problem when user try to update the document that was not created by the user.

      For eg:

      Invoice 16001, created by user A, owner is user A

      User B tried to update the invoice 16001 and change the owner to user B, SP TN will still block it.

      Can this be solve?

      Thanks

  • Posted on Jun 22, 2016 at 03:42 AM

    Dear Olga

    Why you don't use data ownership?

    Regards

    Edmund

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 24, 2016 at 12:12 PM

    Hi Olga,

    IF (@object_type = '22' AND @transaction_type IN ('U')) BEGIN IF EXISTS ( SELECT top 1 T1.OwnerCode FROM OPOR T0 inner join ADOC T1 on T0.DocENtry = T1.DocENtry and T1.Objtype = '22' where T1.OwnerCode <> T0.OwnerCode and T0.DocEntry = @list_of_cols_val_tab_del ORDER BY T1.LogInstanc desc) BEGIN SELECT @ERROR=1,@ERROR_MESSAGE= 'Please you cant chage the owner' END END

    This query works in the Purchase Orders. I also have the same SP.

    Regards,

    Augusto

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Augusto,

      I assume this should work on update only, is that right?

      I need to work on both add and update.

      Anyway, Kamlesh query help to solve my solution, yours solution would giving help too.

      Thanks

  • Posted on Jun 24, 2016 at 03:02 PM

    Hi,

    Please let me know how document owner is updated from current setup.

    Below standard setup for document owner update in document.

    • When a default sales employee is defined for a business partner (Business Partner Master Data -> General tab), the employee who is linked to that sales employee (Employee Master Data window) is displayed automatically.
    • If the sales employee name selected in the document is not linked to an employee, the Owner field displays the employee linked to the user who is currently logged on to SAP Business One.

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.