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

Creating a Query to Change Price

Hi,

I have created a query to change the price in the Sales Order that looks like:

SELECT CASE A WHEN COND1 THEN 120.0 ELSE $[$38.17] END FOR BROWSE

This means, when A <> COND1 I want the existing price ($[$38.17])to be maintained (no modification). And, I want to modify the price to 120.0 only when A=COND1.

However, the above query results in the price getting modified to its own value when A <> COND1 and sales order identifying this as a field value change; and, the OK button changes to Update.

To avoid this, is there a way to write a query such that price field is left untouched when A <> COND1?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 10:32 AM

    Hi Satish,

    I think I found a solution to this problem. It might look as a tedious solution, but I think it will work. Try the following:

    declare @Val varchar(10)
    select @val = CASE A WHEN COND1 THEN 120.0 end
    if @val is not null
    select @val

    I have managed with this to get the result I think you are looking for. Certain documents will update and on others it will only select a result if the value is not null.

    Hope it helps,

    Adele

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Satish,

      If you remove the formatted search is the prices added correctly then? Do you do an automatic refresh on the field? I have only tested with a "manual" formatted search by pressing Shift+F2 to test. Will test later and give you my result.

      Hope it helps,

      Adele

      Message was edited by: Adele le Roux

      OK, I see what you mean with the value is blank. It overwrites the value if you have Automatically refresh on. If you do a manual refresh it works 100%. Sorry for the confusion

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.