on 04-18-2016 10:53 AM
Hello every one,
I have craeted a Custom Code list and then BCS that contains, Order Type and Partner Role and Desription.
Here when we want to craete a new salesOrder, we can define a DocumentType. and then chose the Account.
I want to say that if we chose Ho.re.ca. Order DocumentType, in the account we have to chose one of the accounts that has the "Customer" role.
But I do not know in my script how can I say if this.DocumentType = order type of BCS ,...
Can anyone help me with this?
Thanks
Hi,
You can do a query by elements on the BCO which will give you the entries available in the BC set.
BCOname.QuerybyElements;
This will give you the list of values maintained in the BC set. You can then compare the document type and proceed further.
Regards,
Sumeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As Pradeep suggested you should write logic in Validation-OnSave in of SalesOrder extension.
First you have to define a message in xbo see the below syntax
businessobject SalesOrderXBO raises Invalid_Account {
message Invalid_Account text "For Document type &1 select account Roele as customr" :DocumentTypeCode
In your script you can get help from below code.
if(!this.documentType.IsInitial()){
if( this.documentType.GetDescription() == "HO.re.ca" && qry.CustomerRole != "customer" ){
raise Invalid_Account.Create("E",this.documentType);
return false;
}
else {
return true;
}
}
Regards
Sunil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sunil and Pradeep,
Thanks for your reply,
Actually I dont want to write it all of the possibilities through code. I want to create a custom code list ( that I have created it)and also the view of my custom code list. I just want to read the data from my custom code list view.
I would be happy if you have any idea.
Thanks
Hi,
You could create a extension BO on SalesOrder,
Create Validation-OnSave event on Root and
then check for DocumentType and the selected Account customer role in the event.
Thanks, Pradeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.