Skip to Content
avatar image
Former Member

Ship To and Bill To Addresses

Hi all,

I'm using external web service in order to create a sales order from C4C  sales quote to my ERP system.

I want to send the WS the complete sales quote- product lines as well as account details such as ID, contacts and addresses information.

I have an extension field for each BO (Account, Address, Contact) which hold the external ID of the ERP system.

I wrote an ABSL script in the BeforeSave event of the sales quote whoich invokes the WS (I already configured that part)

My problem is this:

I want to send to the ERP system both Bill To and Ship To Address, but in order to identify those address I have to use the field I created "ERP address name) , however, inside my script I can't reach this field.

When i checked the field definition in KUT, I saw there is no extension scenario for this field.

so,

1. How can I reach the ERP address name field within sales quote ABSL?

2. why can't I extend this field to include it also in sales quote involved parties?

My script:

var    Request : Library::ExSalesOrders.InsertOrder.Request;

   

                Request.composite.CardCode = this.BuyerParty.Party.BusinessPartnerInternalID;

                Request.composite.ContactId = this.BuyerParty.MainPartyContactParty.PartyKey.PartyID.content;

                Request.composite.BillToAddressId = ???;

                Request.composite.Discount = 5;

                Request.composite.DocCurrency = "USD";

                Request.composite.ShipToAddressId = ???;

                Request.composite.VAT = 20;

var Response = Library::ExSalesOrders.InsertOrder(Request,"","ExSalesOrders");

var CommFault = Response.InsertOrderResult;

Thanks,

Dror

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 02, 2015 at 11:24 AM

    Hello Dror,

    You need to create Customer Object References for the Address fields which you want to access in the studio. Once you create the Customer Object References, you need to check the check box against these fields to access these fields in the solution.

    HTH,

    Sumeet

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Ok, so you need to access the account details then.

      If you are writing your code in Customer quote BO :

      For Bill-To :

      var party = this.Party;

      var BillTo  = party.Where(n=>n.RoleCode == "10");

      if (BillTo.GetFirst().IsSet()){

      var BillToParty = Customer.Retrieve(BillTo.GetFirst().PartyUUID);

      var addressid : BillToParty.AddressID;

      }

      Similarly for Ship to the Role Code is 1005.

      Regards,

      Sumeet