on 11-01-2015 5:37 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.