on 11-14-2017 2:59 PM
HI all,
am developing custom Business object which contains entries or records from Opportunity BO extended TAB.
i have created before-save event, and query on custom Bo to check the consistence.
var query_customer = CustomLG.QueryByElements;
var selparam = query_customer.CreateSelectionParams(); selparam.Add(query_customer.OpportunityID , "I", "EQ", this.ID.content);
var result = query_customer.Execute(selparam);
if (result.Count() == 0) {
var customerRoot : elementsof CustomLG;
customerRoot.OpportunityID = this.ID.content ;
customerRoot.LgStatus = "Requested" ;
customerRoot.LgAmountData.content = this.LgAmount.content ; customerRoot.LgAmountData.currencyCode = this.LgAmount.currencyCode ;
could you please suggest a solution to create statement which adds instance entry using this data??
best Regards,
Hi,
I'm not sure if I got your problem right but if your problem is to create an instance of CustomLG with the given data see the following line.
var newCreatedInstance = CustomLG.Create(customerRoot);
Best regards
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tobias,
thank you very much for reply,
- Yes you have got what i needed but, by adding this statement to my code, it returns an error says,
(customerRoot) Parameter type 'OpportunityNodeElements' is not Valid.
Best Regards,
Hello Motaz,
This command will work only if the "elementsof" belong to the BO for which the Create is called.
In your case is the elementsof Opportunity not the same as the BO CustomLG.
Bye,
. Horst
Based on your screenshot the line should be
var newCreatedInstance = Opportunity.Create(Root);
Hi Horst,
Is that solution works for update OWL screen with data inserted on Standard BO.
https://blogs.sap.com/2015/04/23/how-custom-queries-work-on-owl/
Hello Motaz,
based on the heading you want to create an instance of your custom BO CustomLG where the data is populated from the SAP BO Opportunity?
Then this should do the work:
var CustomLGRootData : elementsof CustomLG;
CustomLGRootData.??? = this.???;
...
var CustomLGRootNode = CustomLG.Create( CustomLGRootData );
Please replace the "???" with the resp. elements of your CustomBO and the SAP BO.
HTH,
. Horst
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.