2pack SQL statements cross client borders

Description

When I create a packout line of type "SQL Statement" I can use an SQL UPDATE command to change my data. My axample is this:

This code does not only inactivate the DocTypes in the active client but in all clients. A WHERE clause could help but at the time when I create the 2pack file I can not know which Client ID the user has when he uses PackIn.

One solution could be to automatically add an appropriate WHERE clause. I think this is nit easy to implement for all possible SQL texts. My idea is to allow context variables like this:

wdyt?

Environment

None

Attachments

2

Activity

Show:

Carlos Ruiz February 3, 2016 at 5:16 PM

Thanks , I would like a solution like you proposed (escape) but in a more general approach - I think we have found similar issues in past with other functionalities - so implementing some ability to "escape" pounds on Env.parse could be good.

But that sounds like another ticket for improvement.

I'll close this one as per your advice.

Regards,

Carlos Ruiz

Hiep Lq February 3, 2016 at 2:10 AM

hi , for me, your suggest at forum is a solution, not only work-around.
but i already done a patch for it, so just attach here.
if you think chr(64) is ok, please help me close this ticket.

Hiep Lq February 2, 2016 at 8:19 PM

this improve will avoid input sql like update for display logic.
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/idempiere/hNs9Kwcdkjo/RJ13s-ZoDQAJ

Thomas Bayen August 13, 2014 at 11:53 AM

This patch works for me. I tested it with the given SQL command. Please review.

Carlos Ruiz August 12, 2014 at 9:59 PM

IMHO sounds like a good improvement

Fixed

Details

Assignee

Reporter

Components

Priority

Created August 12, 2014 at 7:05 PM
Updated April 6, 2016 at 3:36 PM
Resolved February 3, 2016 at 5:16 PM