on 05-21-2014 3:04 AM
Dear Experts
I'd like to copy all data from Standard BO.
For example, I'd like to copy to my custom bo from "TradeReceivablesPayablesRegister" BO
But, I don't know how to implement...
Please tell me some advice.
Best regards,
Ryota Ichida
Hi Ryota,
there are different way to do this
1. Internal service integration, apply the logic the way you want to transfer
2. Use XML file input, in this case you have to download data from your standard BO (either from OWL or from available reports)
you can get more details about how to implement these two way in SDK document at page 471(studio_od_1402).
third way via ABSL coding, you can write an action in your custom BO and query the Standard BO, using query selection parameter fetch those data what you want to copy in your custom BO.
inside the loop you can use Create method to create all instance of std bo in custom bo.
here is the sample code
I want to copy ServiceRequest data in my custom BO,
Only those open ticket I want to copy
1. create you custom BO with required elements with an action
import AP.Common.GDT as apCommonGDT; businessobject Test_RecieverBO { [AlternativeKey]element TicketID:BusinessTransactionDocumentID;
element ServiceStatus:ServiceRequestLifeCycleStatusCode;
element CreationDateTime:BASIS.Global:GLOBAL_DateTime;
element LastChnageDateTime:BASIS.Global:GLOBAL_DateTime;
action CopySRdata;
}
ABSL code for copy the data in custom BO(Test_Reciever)
import ABSL;
import AP.CRM.Global;
var NodeElement:elementsof Test_RecieverBO;
var qrysr = ServiceRequest.ServiceRequestOverview.QueryByElements;
var qrySel = qrysr.CreateSelectionParams();
qrySel.Add(qrysr.Status.ServiceRequestLifeCycleStatusCode, "I", "EQ", "1");
var qryRes = qrysr.Execute(qrySel);
if (qryRes.Count()>0){
foreach( var ins in qryRes){
NodeElement.TicketID = ins.ID;
NodeElement.ServiceStatus = ins.Status.ServiceRequestLifeCycleStatusCode;
NodeElement.CreationDateTime = ins.ToRoot.SystemAdministrativeData.CreationDateTime;
NodeElement.LastChnageDateTime = ins.ToRoot.SystemAdministrativeData.LastChangeDateTime;
Test_RecieverBO.Create(NodeElement);
}
}
you can call this action in owl, if data will be huge then it will take time
Hope this help
Regards
Sunil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Sunil
Sorry for not explaining enough.
I run the following step using your coding
1. Click a Action button (Finished copy action)
2. Click a "Close" in QAF
3. Click a "Yes" in "Confirmation Dialog" screen
4. The blank data is registered
I would not like to register it. Please tell me some advice.
For example, is it possible to close directly without "Confirmation Dialog"?
Best regards,
Ryota Ichida
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.