Skip to Content

C4C SDK: Delete selected record in Advance List Pane

Hello Experts,

I have created a custom solution with a node that is binding to advance list pane. For this I have also provided an DeleteBin Icon on every row so that user can delete the specific record. Refer the below screenshot:

As of now irrespective to which record I try to delete, first one which is marked in red above gets deleted. In my Event Handler, I have added BOAction that has instance Binding to my DataList but somehow I can see in debug that all the 4 records are picked up and maybe that why my below line of code in my Action deletes first record:

this.fieldRules.Delete();

Kindly throw some lights how I will be enabling deletion of the selected record.

Thanks & Regards,

Chandan

Scn1.JPG (31.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2016 at 09:40 AM

    Hi Chandan,

    Make sure that you have followed all the given steps:

    1. Add layoutstack panel.
    2. In properties goto Misc->Items.
    3. One popup window will come. click Add
    4. There in Events->Onclick->create new event as shown

    Hope this works for you.

    As per my knowledge,there is no need of custom action to delete.

    Regards,

    Komal


    Capture.PNG (48.2 kB)
    Capture1.PNG (42.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2016 at 09:26 AM

    Hi Chandan,

    It seems you added the BOAction in the root node in business object definition.

    You have to add the BOAction in the fieldRules node.

    ->this.fieldRules.Delete();

    It is a bit strange that your code doesn't have a GetFirst() even you are accessing the instance of the fieldRules node.

    Best Regards,

    Fred

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Fred,

      Meanwhile, I indeed followed your suggestion and added the Action under my node and provided Instance binding to this Action. In DataModel, Root is bound to Root Node and Data List with my node fieldRules.

      Result, now whenever I delete any of the row ... Last row gets deleted !!

      Now I am trying to understand what is happening here 😔

      Regards,

      Chandan

  • Posted on Aug 10, 2016 at 11:46 AM

    Hello MOHD SIRAJUDDIN, Komal Choudhary & Fred K,

    I switch to try again the Event where I have used (same that was suggested by Komal and Siraj):

    1. RemoveRow method for List.

    2. Save

    3. Refresh the List.

    I worked fine now. Maybe I forgot to maintain the Target List in the third step (List Refresh) that threw the dump earlier. Now the delete icon that I click, deletes the same row it is in and refreshes the List after saving. 😊

    Only one issue now. I had 4 rows in my ALP. I deleted all one by one for testing. All worked as expected, unless there was only one row left. When I deleted this row, I could see some processing on screen followed by Save. But I can still see the left row on screen. Technically the row was deleted, but still visible on screen!!

    When I try to delete it again, it throw dump (as expected since row was already deleted) When I reopen the same record again. I can now see my ALP empty as expected.

    Any suggestion why this happens and how I will handle this situation?

    Your inputs on this discussion was really very valuable for me to learn and I am sure for many in future.

    Thanks for replying folks. 😊

    Regards,

    Chandan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2016 at 09:45 AM

    Hello Chandan,

    If you are using Delete Bin icon for deleting the selected record then no need of custom action just follow.

    1. On Delete bin icon onclick event create Event handler.

    2. Select list operation from the list of events available.

    3. Select operation as remove row

    4. Select the target list (your node data list);

    4. And also include another event windows action and select the action type as save it will save the entries after record gets deleted.

    Thanks,

    Siraj.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Siraj,

      Thanks for replying. 😊

      As mentioned to Komal, I did performed the mentioned steps but facing error. 😔

      Apart from that I also tried the third step that is mentioned by Sunil Kumar Maurya in another discussion:

      How to add DELETE functionality to an OWL autog... | SCN

      As seen there, I added BOOperation to read the Unique ID from the Data List before my BOAction. Doing so I ended up deleting not only the selected record but also the complete DataList (all 4 records) + Header Data. 😀

      You see I am trying all possible learnt option that I came across on this forum making my solution a Hybrid Solution now.

      So I have reverted my solution back to what I mentioned in this discussion as the situation and kept trying. Meanwhile thought posting here to know what exactly is missing.

      Regards,

      Chandan

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.