Skip to Content

Hi everyone,

Sometimes, we want to create data on the fly by using the advanced search pane. 

e.g Retrieve data from multiple business objects using Search Values from advanced search pane and and create data on the fly.

But search pane can only be used for the existing data. Basically, I create a QA screen as a temp screen for this kind of requirement. Luckily, I found a workaround to connect Search pane and BO Actions on OWL.


Please feel free to point me out if there is any mistake in this document.

Idea:

1. Create Dummy Instance

2. Get search value and transfer to Dummy Instance

3. Perform BO Action

4. Delete the instance back

For simplicity, this document only contains simple Create and Update actions on a custom BO.

Simple BO Actions.png

BO definition:

businessobject N_Product {

  element ProductID :ProductID;

  element Description : LANGUAGEINDEPENDENT_MEDIUM_Text;

  action update;

  action create;

}

Steps:

1. Create Search parameters

     i) Add two new data field under Root/SearchParameters and bind with query elements

2. Add elements under Root

3. Create event handlers

i) Create two event handlers

ii) For Update Button – Create a DUMMY instance

iii) For Update – Get Search value from Search pane and assign to Root elements which are added on step 2.

a) Product Assignment

b) Description Assignment

iv) For Update Button – Add BOAction

v) For Create Button – Repeat i) to iv)

vi) Add two buttons on OWL and assign the created event handlers to the button click events

4. Implement BO Actions

5. Testing

     i) Testing Create button

     ii) Testing Update button

Let’s start.

1. Create Search parameters

i) Add two new data field under Root/SearchParameters and bind with query elements

Search Parameters.png

2. Add elements under Root

(* not under Data List)

Root elements.png

3. Create event handlers

i) Create two event handlers

new event handlers.png

ii) For Update Button – Create a DUMMY instance

Update Dummy Instance.png

iii) For Update – Get Search value from Search pane and assign to Root elements which are added on step 2.

a) Product Assignment

Search value assignment to ProductID.png

b) Description Assignment

Search value assignment to Description.png

iv) For Update Button – Add BOAction

(*Instance Binding must be Root)

Update BO Action.png

v) For Create Button – Repeat i) to iv)

vi) Add two buttons on OWL and assign the created event handlers to the button click events

4. Implement BO Actions

i) Create

import ABSL;

var temp : elementsof N_Product;

temp.ProductID = this.ProductID;

temp.Description =this.Description;

var createdInstance = N_Product.Create(temp);

this.Delete();      // delete the Dummy Instance


ii) Update

import ABSL;

var query =N_Product.QueryByElements;

var selParams = query.CreateSelectionParams();

selParams.Add(query.ProductID.content,”I”,”EQ”,this.ProductID.content);

var results = query.Execute(selParams);

foreach(var result in results){

  result.Description = this.Description;

}

this.Delete();      // delete the Dummy Instance


5. Testing

i) Test Create button

Testing - Create.png

ii) Test Update button

Testing- Update.png

That’s all folks.


Thanks for reading.

Fred

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. bhupinder sharma

    Hi Fred,

    Brilliently explained document and quite helpful,

    But i have one doubt as you are using object based screens but in my solution we have created screens as thing based,

    so do you think it will work there also,

    as in thing based we usually use advance search using SADL query and we dont have dont option of advance menu in OWL .

    Thanks,

    Bhupi.

    (0) 
    1. Fred K Post author

      Hi bhupinder,

      I am not familiar with Thing based screens for I am mainly working on ByD and have no access to C4C. Advanced search pane does not depend on Query type as far as I know.

      Best Regards,

      Fred

      (0) 
  2. Sunil Kumar Maurya

    Nice details .. It’s an alternative of Quick Create, with your finding now user can add value in ByD just like they do using QC in C4C.

    Keep sharing .. 🙂

    Regards

    Sunil

    (0) 
        1. Fred K Post author

          Hi Pradeep,

          As for me, there are times when we need a temporary search function.

          e.g  we need to retrieve data from multiple standard BOs and combine the retrieved data as we want and create and show the result rows as we want. We use a middle screen (a QA), and add Selection Criteria to the screen and create the result rows from the middle screen.

          Best Regards,

          Fred

          (0) 

Leave a Reply