Pulling in field from Customer (ShipTo.Number01)

Thanks for all the valuable feedback.  This is what I've decided to use: 



  Private Sub btnEpiCustom1_Click(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles btnEpiCustom1.Click
  
 Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"), EpiDataView)
Dim [VarName] As String = [edvVarName].dataView([edvVarName].Row)("ShipToNum")
         Dim recordSelected As Boolean
        Dim showSearch As Boolean = False
        Dim sClassID as string 
        Dim whereClause As String = "ShipToNum = '" & [VarName] & "'"
        '// messagebox.show("whereClause = " & whereClause)
        Dim dsPartInfo As DataSet = SearchFunctions.listLookup(SalesOrderForm,"ShipToAdapter", recordSelected, showSearch, whereClause)
         If recordSelected Then
        sDays = dsPartInfo.Tables(0).Rows(0)("Number01").ToString()
    
       Messagebox.Show(sDays)
End IF
 End Sub


Had some trouble with the syntax of the where clause and the correct adapter to use.  

Thanks for all the help!

I'm in the Sales Order and trying to pull in the Customer ShipTo.Number01


Can this be done with the searchfunction and shipto adapter?

Thanks.

I would do that in a bpm like this in a post processing bpm on SalesOrder ChangeShipToID

no condition

 

ABL Code

 

/* get cust shipto number01 */

 

For Each ttOrderHed Where ttOrderHed.Company = cur-comp,

                                Each ShipTo where ttOrderHed.Company = ShipTo.Company and ttorderHed.CustNum = ShipTo.CustNum and ttorderhed.ShipToNum = ShipTo.ShipToNum.

 

                                Assign ttOrderHed.Number01 = ShipTo.Number01.

               

 

End.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, July 03, 2015 12:32 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Pulling in field from Customer (ShipTo.Number01)

 

 

I'm in the Sales Order and trying to pull in the Customer ShipTo.Number01

 

Can this be done with the searchfunction and shipto adapter?

Thanks.



CONFIDENTIALITY NOTICE

The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at 727-578-6280 and immediately delete the communication.

"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."
Thanks for the response, but I'm trying to use a customization instead of a BPM.

Can you use a whereclause of dssearch on  a dataset to retrieve the shipto.number01 based on orderhed.shiptonum == shipto.shiptonum

Thanks in advance
You should be able to do what you want with the adapter.
Below is something I used to do something similar...


Private Sub GetPart_ClassID()
    '// messagebox.show("Start GetPart_ClassID")
    Dim sPartNum as String
        for Each dr as datarow in edvOrderDtl.DataView.Table.Rows
            if not IsDBNull(dr("PartNum")) then
                 sPartNum = dr("PartNum")
                '// messagebox.show("Part " & sPartNum)
                 dr("ClassID") = PartLookup(sPartNum)
            end if
        next

    End Sub
    Private Function PartLookup(ByVal sPartNum As String) As String
         Dim recordSelected As Boolean
        Dim showSearch As Boolean = False
        Dim sClassID
        Dim whereClause As String = "PartNum = '" & sPartNum & "'"
        '// messagebox.show("whereClause = " & whereClause)
        Dim dsPartInfo As DataSet = SearchFunctions.listLookup(SalesOrderTrackerForm,"PartAdapter", recordSelected, showSearch, whereClause)
         If recordSelected Then
        sClassID = dsPartInfo.Tables(0).Rows(0)("ClassID").ToString()
        Else
        sClassID = ""
        End If
        Return sClassID
       

    End Function