Skip to Content

Copy UDF value from Orders to Invoices

Hi all,

I need to do the following:

The user has one UDF in marketing documents called NAlb. It is filled in the sales orders.

In invoices, the user uses the sales orders button to select several orders related to a customer and create a single document. I need to carry NAlb´s values from each sales order into the NAlb UDF in the invoice.

I have tryed several event, without any succedd. et_CLICK event in the "Sales Orders" button happens before the wizard is shown (for both BeforeAction values).

With the et_ITEM_PRESSED event, the ActionSuccess parameter is never true, and when BeforeAction becomes false the wizard has just started.

I have tryed the et_DATASOURCE_LOAD and et_MATRIX_LOAD too but they are not fired.

I have tryed the et_VALIDATE event for the matrix columns too, but it is not fired.

Could someone give me an approach to get this problem solved? Any advice is wellcome too.

Thanks in advance,

Ibai Peñ

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on Mar 02, 2005 at 09:02 AM

    Hello Ibai,

    Why dont you catch the event when the user selects the orders he wants to add?

    If pVal.FormType = "10016" And pVal.ItemUID = "1" And pVal.BeforeAction = False Then

    oForm = B1_Application.Forms.ActiveForm

    End If

    Then you can get the document number form the matrix of the form and load the Nalb.

    Regards,

    Felipe

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Felipe,

      I have already solved.

      I use the event et_CLICK in the "Select" button in the the form you say. I loop throw all selected orders, and save the UDF values into variables.

      Then I catch the invoice form activate event, when the variables are not empty. Then I paste the values, and clear the variables.

      Regards,

      Ibai Peñ