This topic is locked
[SOLVED]

 Insert orderLine

1/15/2020 5:20:56 AM
ASPRunnerPro General questions
F
Frank Erik author

Any tips how to approach this?

Any standard functionallity in ASPRunner, or do I have to make a button/snippet?
The process will be like this.

  1. Add New order line
  2. list Aricle table
  3. Search/filter article_list
  4. Select article form the list.
  5. Copy Field_value from the selected article into New Order_line.
    MasterTable = Order_head

    ChildTable = Order_line

    ExternalTable for lookup = Article

N
Nir Frumer 1/15/2020

hi

using lookup wizard with the option "list page with search" does (almost) everything you ask for.
hope it helps,

Nir.

F
Frank Erik author 1/23/2020



hi

using lookup wizard with the option "list page with search" does (almost) everything you ask for.
hope it helps,

Nir.


Thanks Nir,

i'll give it a try!

F
Frank Erik author 1/23/2020



Thanks Nir,

i'll give it a try!


....does (almost) everything....

Still missing no 5,

On my add-new-orderline I have now a lookup wizard (list page with search) linked on table.field [article].[articleNo]

I select the ArticleNo, but how to update the other fieldvalues (unit,price,stock) from the selected article to my add-form?

admin 1/24/2020

This can be also done with the help of some custom coding. Contact support directly and we'll see what we can do.

F
Frank Erik author 1/29/2020



This can be also done with the help of some custom coding. Contact support directly and we'll see what we can do.


Found a solution, se sample code.:
BeforeAdd=true
Dim SQL_Article

SQL_Article = "Select FROM XXXXXX.article WHERE ArticleNo = '" & Values("ArtNo") & "'" &";"

Dim rstDBEdit

Set rstDBEdit = Server.CreateObject("ADODB.Recordset")

rstDBEdit.Open SQL_Article, Conn,1,2

values.item("Article")= rstDBEdit.fields("Name")

values.item("ArticlePrice")= rstDBEdit.fields("SuggestedRetailPrice")

rstDBEdit.Close
If values("Discount")>0 then

Dim Discount2

Discount2=values("ArticlePrice")
values("Discount")/100

NewPrice=values("ArticlePrice")-Discount

values.item("LineSum")= NewPricevalues("Ammount")

Else

values.item("Linesum")=values("ArticlePrice")
values("Ammount")

End if