cancel
Showing results for 
Search instead for 
Did you mean: 

Ship To and Bill To Addresses

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

sumeet_narang
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi Sumeet,

Thank you for your answer.

I already did that, I can see my field in the Account BO, but not on the Sales Quote BO

(I checked both Customer and CustomerQuote)

Thanks,

Dror/

sumeet_narang
Active Participant
0 Kudos

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