Cannot find the right BUS object for Customer Ship To Address Maintenance

SOLVED

Hello everybody,

Tnx for the support in last 2 questions!

I stuck again with some strange problem...

I have to extract data from the form : Customer Ship To Address Maintenance 

Account Receivable ->Main ->Customer Maintenance-> Main Tab on the right side of form there is a field called Primary Ship To which is clickable...When you click it there is a new form called : Customer Ship To Address Maintenance and there are alot  fields over there:

Local Code , Name , Address,Zip code,Country,Telephone,Fax,Contact and so on...

I have to extract data from those fields but i cannot find which is the BUS.

Please help it guys :(

  • 0
    verified answer
    Table is SO_ShipToAddress, Bus Object is SO_ShipToAddress_BUS or SVC
  • 0 in reply to Tim Efinger
    Hello Tim,
    Tnx for the answer

    At the moment i had extracted the value of AR_Customer_bus
    with this code :
    Set oVendor = oSession.AsObject(oSession.GetObject("AR_Customer_bus"))
    retVal = oVendor.SetKeyValue("ARDivisionNo$", strArDivisionNumber)
    retVal = oVendor.SetKeyValue("CustomerNo$", strCustomerNo)
    retVal = oVendor.SetKey()

    retVal = oVendor.GetValue("AddressLine1$", strBillToName)
    retVal = oVendor.GetValue("AddressLine2$", strBillToAddress2)
    retVal = oVendor.GetValue("City$", strBillToCity)

    Its working and get the values from Customer Maintenance...

    I tried SO_ShipToAddress_BUS to get the values Customer Ship To Address Maintenance
    with this code:
    Set oCustShipTo = oSession.AsObject(oSession.GetObject("SO_ShipToAddress_bus"))
    retVal = oCustShipTo.SetKeyValue("ARDivisionNo$", strArDivisionNumber)
    retVal = oCustShipTo.SetKeyValue("CustomerNo$", strCustomerNo)
    retVal = oCustShipTo.SetKeyValue("ShipToCode$", strShipToCode)
    retVal = oCustShipTo.SetKey()

    retVal = oCustShipTo.GetValue("ShipToAddress1$", strShipToName)
    retVal = oCustShipTo.GetValue("ShipToAddress2$", strShipToAddress2)
    retVal = oCustShipTo.GetValue("ShipToCity$", strShipToCity)

    Result from executing this part is that i got the values not from Customer Ship To Address Maintenance form but instead from Customer Maintenance.

    Is i'm doing something wrong?
  • 0 in reply to ndym1
    verified answer
    Based on the code I am seeing your strShipToCode would be blank which would not set a valid key for you to retrieve data out of SO_ShipToAddress. I assume you have default ship to codes set for customers in the AR_Customer.PrimaryShipToCode field. If this is the case then you need a line of code retVal = oVendor.GetValue("PrimaryShipToCode$",strShipToCode) after you do your set key on the AR_Customer table.