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

Copy CardName into Quotation line by using formatted search

I'm looking for the right query to copy the CardName from the OCRD table into a quotation line (QUT1) by using a formatted search. The UDF field in the QUT1 is U_Levnaam. In the field U_Levnaam I want to place the formatted search with the query.

I don't no if this is possible, because the field CardName of the OCRD table doesn't have a direct link to the QUT1 table. There is a link between the OCRD and OITM table.

This is how far I came. I have tried other solutions as well but without any result. Probably is has to be a complete other query

+SELECT T0.CardName FROM OCRD T0 INNER JOIN OITM T1 ON T0.CardCode = T1.CardCode Where T0.CardCode = $[OITM.ItemCode]+

So if anyone has a solution your help will be very appreciated.

Regards,

Tim

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 04:03 PM

    Try this one then:

    SELECT T0.CardName FROM OCRD T0

    INNER JOIN OITM T1 ON T0.CardCode = T1.CardCode

    WHERE T1.ItemCode = $[$38.1.0\]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 03:03 PM

    Hiho,

    your query does not make sense, look here :

    SELECT T0.CardName 
    FROM OCRD T0 
    INNER JOIN OITM T1 ON T0.CardCode = T1.CardCode 
    Where T0.CardCode = $[OITM.ItemCode]
    

    What do you do :

    First select T0.CardName...from the Table OCRD with a inner join of OITM (that means you request each

    record from OITM where the CardCode from OCRD is equal to the CardCode from OITM). Ok thats wrong,

    cause you got a CardCode in OCRD, but in OITM is not a CardCode, cause it is the item table.

    Your where clause did not match at all. You want to fetch records where a CardCode is equal to a ItemCode.

    Ok lets see what do you need :

    You want to select a CardName from the OCRD into a line of your quotation. Therefor are 2 possibilities :

    1.If your quotation is already saved:

    
    SELECT T0.CardName FROM OCRD TO, QUT1 T1 WHERE T0.CardCode = T1.BaseCard
    
    

    2.If you creates a new quotation:

    SELECT T0.CardName FROM OCRD T0 FROM T0.CardCode = $[$4.0.0]
    
    or this works too
    
    SELECT $[$54.0.0]
    

    Regards Steffen

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI,,

      $[$xx.xx.xx]
      
      or
      
      $[$Tabel.ColumnName]
      

      this pick up a screen value by using the field id. Caution you only can pick up values from active forms!

      OK you did say, that you want to display the supplier. Lets see, what we can do :

      
      SELECT T0.CardName FROM OCRD TO 
      INNER JOIN QUT1 T1ON T0.CardCode=T1.CardCode
      WHERE T1.ItemCode = $[$QUT1.ItemCode]
      
      

      Regards Steffen

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 03:10 PM

    SELECT $[$54.0.0\] will work for both cases.

    Thanks,

    Gordon

    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.