Remove related entity records

Hi All,
I have one mother  entity    'BTHeaderPartnerSet',  which contains the relation ship enties those are having the data .
One of the relation ship entity is '  BTPartnerOpportunity' , which contains the all partners data those are existing in opportunity .  According to my requirement I need to remove or delete some records from above entity '   'BTPartnerOpportunity'  by chekcing the partner function . Please help me in this .
    IF lr_entity IS BOUND.
    lr_partnerset = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderPartnerSet' ).
    IF lr_partnerset IS BOUND.
      lr_partneropp = lr_partnerset->get_related_entities( iv_relation_name = 'BTPartnerOpportunity' ).
      IF lr_partneropp IS BOUND.
        lr_iterator = lr_partneropp->get_iterator( ).
        lr_iterator->filter_by_property( iv_attr_name = 'PARTNER_FCT'
                                         iv_value     = 'Z000003' ).
even though I have used filter by property it is not working .
Regards,
Ram

Hi Dharama,
I wrote the below code, still it is not deleting the entities from Relationship child entity .
DATA:
   lr_current     TYPE REF TO if_bol_bo_property_access,
   lr_partnerset  TYPE REF TO cl_crm_bol_entity,
   lr_entity      TYPE REF TO cl_crm_bol_entity.
   lr_current ?= me->collection_wrapper->get_current( ).
   lr_entity ?= focus_bo.
   IF lr_entity IS BOUND.
     lr_partnerset = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderPartnerSet' ).
   ENDIF.
   DATA: lr_bo TYPE REF TO if_bol_bo_property_access,
             lr_iterator TYPE REF TO if_bol_bo_col_iterator,
            lr_entity1 TYPE REF TO cl_crm_bol_entity,
             lr_col TYPE REF TO if_bol_bo_col.
   lr_partneropp = lr_partnerset->get_related_entities( iv_relation_name = 'BTPartnerOpportunity' ).
   lr_iterator = lr_partneropp->get_iterator( ).
*  lr_entity1 = lt_iterator->find_by_property( iv_attr_name = 'PARTNER_FCT' iv_value = '0000021' ).
    lr_entity1 ?= lr_iterator->get_first( ).
    WHILE lr_entity1 is BOUND.
      lr_partneropp->remove( lr_entity1 ).
      lr_entity1 ?= lr_iterator->get_next( ).
      ENDWHILE.
   lr_current->set_property( iv_attr_name = 'PARTNER_SET ' iv_value = lr_partnerset ).
regards,
ram

Similar Messages

  • Remove related entity, oracle.toplink.essentials.indirection.IndirectList

    I have two entities autogenerated by the jdev 10.1.3.1 JPA wizard, Proveedor(codprov varchar2 PK) having n Lineas(codprov varchar2 PK, Codline varchar2 PK) related as:
    in entity Proveedor:
    private List<Linea> lineas;
    @OneToMany(mappedBy="proveedor")
    public List<Linea> getLineas() {
    return lineas;
    public Linea removeLinea(Linea linea) {
    System.out.println(" is at:" + getLineas().indexOf(linea));
    getLineas().remove(linea);
    linea.setProveedor(null);
    return linea;
    in Linea:
    @Id
    @ManyToOne
    @JoinColumn(name="CODPROV", referencedColumnName="CODPROV")
    public Proveedor getProveedor() {
    return proveedor;
    the delete method on the service bean is :
    public void delLinea( String codprov,String codline){
    EntityManager em = jpaResourceBean.getEntityManager();
    try{
    em.getTransaction().begin();
    Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
    em.remove(linea);
    em.getTransaction().commit();
    linea.getProveedor().removeLinea(linea);
    finally {
    em.close();
    when i try to remove the entity linea calling delLinea on the service bean
    the List (oracle.toplink.essentials.indirection.IndirectList) is NOT removing the entity linea, the system output show that is not there:
         06/08/30 16:59:23 is at:-1
    the relationship is not lost, as linea.getProveedor().removeLinea(linea); works so it's being held ok (at least from Linea to Proveedor)
    what i'm doing wrong, is IndirectList is mantaining copies of the related entities ??

    thank you, after reading your reply i tried this:
    public void delLinea( String codprov,String codline){
    EntityManager em = jpaResourceBean.getEntityManager();
    try{
    em.getTransaction().begin();
    Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
    linea.getProveedor().removeLinea(linea);
    em.remove(linea);
    em.getTransaction().commit();
    finally {
    em.close();
    As you advised, I'm reading the Proveedor in the transaction and clearing the relation before removing the entity Linea, but em.getTransaction().commit() throws:
    GRAVE: #{ProveedorBean.linea_Del}: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
    javax.faces.FacesException: #{ProveedorBean.linea_Del}: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         ... 25 more
    Caused by: javax.persistence.RollbackException: java.lang.NullPointerException
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:109)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:45)
         at services.inventario.impl.InventarioServiceBean.delLinea(InventarioServiceBean.java:473)
         at ui.ProveedorBean.linea_Del(ProveedorBean.java:152)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         ... 26 more
    Caused by: java.lang.NullPointerException
         at oracle.toplink.essentials.internal.identitymaps.CacheKey.computeHash(CacheKey.java:183)
         at oracle.toplink.essentials.internal.identitymaps.CacheKey.setKey(CacheKey.java:366)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMap.getCacheKey(IdentityMap.java:277)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMap.remove(IdentityMap.java:399)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMapManager.removeFromIdentityMap(IdentityMapManager.java:1036)
         at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:801)
         at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:793)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.postMergeChanges(UnitOfWorkImpl.java:2834)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeChangesIntoParent(UnitOfWorkImpl.java:2556)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:93)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:842)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:90)
         ... 34 more
    The following variation throws the same exception:
    public void delLinea( String codprov,String codline){
    EntityManager em = jpaResourceBean.getEntityManager();
    try{
    em.getTransaction().begin();
    Proveedor prov = em.find(Proveedor.class, codprov);
    Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
    prov.removeLinea(linea);
    em.remove(linea);
    em.getTransaction().commit();
    finally {
    em.close();
    the following variation:
    public void delLinea( String codprov,String codline){
    EntityManager em = jpaResourceBean.getEntityManager();
    try{
    em.getTransaction().begin();
    Proveedor prov = em.find(Proveedor.class, codprov);
    Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
    prov.removeLinea(linea);
    em.getTransaction().commit();
    em.getTransaction().begin();
    linea = em.find(Linea.class, new LineaPK(codprov, codline));
    em.remove(linea);
    em.getTransaction().commit();
    finally {
    em.close();
    after the second commit(); throws the same:
    Caused by: javax.persistence.RollbackException: java.lang.NullPointerException
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:109)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:45)
         at services.inventario.impl.InventarioServiceBean.delLinea(InventarioServiceBean.java:477)
         at ui.ProveedorBean.linea_Del(ProveedorBean.java:152)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         ... 23 more
    Caused by: java.lang.NullPointerException
         at oracle.toplink.essentials.internal.identitymaps.CacheKey.computeHash(CacheKey.java:183)
         at oracle.toplink.essentials.internal.identitymaps.CacheKey.setKey(CacheKey.java:366)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMap.getCacheKey(IdentityMap.java:277)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMap.remove(IdentityMap.java:399)
         at oracle.toplink.essentials.internal.identitymaps.IdentityMapManager.removeFromIdentityMap(IdentityMapManager.java:1036)
         at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:801)
         at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:793)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.postMergeChanges(UnitOfWorkImpl.java:2834)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeChangesIntoParent(UnitOfWorkImpl.java:2556)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:93)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:842)
         at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:90)
         ... 31 more

  • Can't remove an entity record

    I am developing my JSF application following the Java Version sample application SRDEMO from Oracle.
    I couldn't get remove function work. (there is no "remove" used in the demo).
    When the method removeEmployee(Employee employee) is called from MyFacadeClientEmbed which is in "Model" project, it works and the selected employee can be removed.
    But when removeEmployee(Employee employee) is called from a sessional managed bean in "ViewController" project, the record is not removed!
    in "Sample Java Client File" MyFacadeClientEmbed within "Model":
    MyFacade mf = (MyFacade)context.lookup("MyFacade");
    Employee theRec = my.findEmployeeById(200);
    mf.removeEmployye(theRec);
    in "MyPage.java" managed bean in "ViewController" project:
    ServiceLocator sl = sl.getInstance;
    MyFacadeLocal mfl = (MyFacadeLocal)sl.getFacadeService("java:comp/env/ejb/MyFacade");
    Employee theRec = my.findEmployeeById(200);
    mf.removeEmployye(theRec);
    Any ideas?
    Thanks in advance.

    Thank you for replying.
    I have the environment entry defined:
    <ejb-local-ref>
    <ejb-ref-name>ejb/MyFacade</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>MyFacadeLocal</local>
    <ejb-link>MyFacade</ejb-link>
    </ejb-local-ref>
    Other methods, like persist(), work fine and changes are commited to database right after. "Remove" is the only function that seems excuted from ViewController but not committed to database.

  • HTML Client related entity look ups

    How are you folks handling the very typical scenario where the user is completing a form and realizes that they need to add a record to a related entity lookup table before they can complete their entry. The primary form will have validation so I
    don't want to force them to save, and as a result they have to quit and abandon their entry, every time they need to add a look up, and then come back and start over. This was easy in the Silverlight client.  Any ideas?

    Hi Hessc,
    The Code from Paul's article is here:
    https://code.msdn.microsoft.com/Reusable-search-screens-in-91c64c30/
    The simplest way to this is to add a button which opens a browse screen and then passes the selected item from that screen back to the calling screen using the afterClosed event.
    This is what Paul is doing here for selecting the customer from an order entry screen:
    myapp.AddEditOrder.BrowseForCustomer_Tap_execute = function (screen) {
    myapp.showBrowseCustomers(screen.Order.Customer, true,
    beforeShown: function (myscreen) {
    afterClosed: function (myscreen, action) {
    screen.Order.Customer = myscreen.SelectedCustomerParameter;
    He uses the same technique to set the selected item on BrowseCustomers screen after adding a new customer. 
    Additionally he is reusing an existing BrowseCustomer screen by showing and hiding buttons based on a screen property called 'IsInSelectMode".
    So the flow for new customer is:
    OrderScreen > Tap BrowseForCustomer >
    BrowseCustomerScreen > Tap AddCustomer >
    AddEditCustomerScreen > Save (afterClosed sets selected customer on BrowseCustomer screen) >
    BrowseCustomer > Close (afterClosed sets Customer on OrderSreen) >
    OrderScreen
    HTH,
    Josh

  • Changing the default associated view for a related entity

    A question from a peer:
    Hey there
    Do you know how in CRM 2015 to change the default associated view for a related entity?
    Say you are in an Account and from the menu open the opportunities for that account.
    That new pop up window states “Opportunity Associated View” I want to change that to “My Custom View”
    I thought we covered this in class years back but cannot remember

    There are a few ways to get what you want, the easiest being
    Create a document as you want it for a particular site, save it is junk.php or similar and create a new file by saving as this as the proper document name such as index.php
    Use the Dreamweaver template system, i.e. create a template with a .dwt.php extension like template.dwt.php and use that to create new pages.
    There are other ways like creating your own php template system. But you can put that in the too hard basket.

  • How to Remove the Entity usage from View object at runtime

    Hi,
    A ViewObject can be created dynamically based on the Existing ViewObject Defintions. The newly created dynamic ViewObject will have all the defintion including Attributes, its structure along wtih Entity usage of the existing ViewObject definition.
    My requirement is i don't want to have the Entity usage alone whereas Remaining structure need to be retained.
    Can any body suggest on how to do it.
    regards.

    Hi,
    design time or runtime? At designtime, have you tried to just remove the entity reference? Given the disadvantage of removing the entity (and the changed behavior associated with it) what is the use case for which you want to disable the entity reference?
    Frank

  • Material Fright Group related Condition record is not captured in billing

    Dear all,
       As i am creating Credit Memo with respect to Credit memo Request (Sales Order) and my freight condition record is maintained in Material Freight Group level. This field is there in Sales Order but when i am creating Credit memo it is not captured and also i am unable to find Material Freight Group field in Billing Document.
    Please help urgently.
    Regards,
    Chirag Pedhadiya.

    Hi...
          But why we have to write this code in User Exit. Is this Standard SAP Problem ??
    I just wonder that in Delivery Related Billing Document it is finding Material Freight Group related Condition record in Billing means in Billing Pricing it is getting value in Material Freight Group filed and set this condition record value, though there is no any field like MFRGR (Material Freight group) in Billing Tables VBRK or VBRP.
    So for Order related Billing Document only why this filed is not getting any value in Pricing ??
    Thnaks,
    Chirag  Pedhadiya.

  • Master-Detail Relation- Detail records not displaying

    Hi All,
    I am working forms(10g) customization for an oracle applications. our requirement is to develop a new window(screen) which should display all the related child records for the master record in the main form on a button press.
    i have developed a new database block based on a vew and provided the relation with master block, and done the required customization.
    But, when i run the form, and clicked on button, it is giving an error
    FRM-40350 Query caused no records to be retrieved.below is the code that i have written on button click
    BEGIN
              IF event = 'WHEN-BUTTON-PRESSED'
              THEN
              SHOW_VIEW('XXSCP_GBL_CUST_PEGGING_CON');
              SHOW_VIEW('XXSCP_GBL_CUST_PEGGING_STK');
              app_window.set_window_position('XXSCP_GBL_CUST_PEGGING_WIN',
                                             'CASCADE',
                                             'XXSCP_GBL_EXCEP_DETAILS_WIN');
          SET_BLOCK_PROPERTY('XXSCP_GBL_EXP_DETAIL_V',NEXT_NAVIGATION_BLOCK,'XXSCP_GBL_CUST_PEG_V');                                        
          GO_BLOCK('XXSCP_GBL_CUST_PEG_V');
         -- fnd_message.DEBUG('before execute');
          EXECUTE_QUERY;
          :parameter.p_excep_detail := 'FALSE';
              ELSE
                   NULL;
              END IF;
              EXCEPTION
                   WHEN OTHERS
                   THEN
                   fnd_message.DEBUG('other error at button press'||SQLERRM);
              --     NULL;
    END;I am able to query records in my view from database, but not working when i run the form.
    ANy suggestion will be helpful.
    Thanks in advance,
    pavan

    Duplicate post -- Re: Master-Detail Relation- Detail records not displaying

  • Problem While creating the related entity DocFlowSet

    Hi,
    i am trying to create a Business Transaction and attach it to the another transaction.
    I am creating the Transaction T1 using the factory methods and I am facing issues while creating the related entity DocFlowSet to attach T1 as a follow on document to T0.
    i am using the model DocFlowSingle and passing the parameters like.
    ObjKeyA GUID of T0
    OBJTYPEA
    OBJKEYB GUID of newly created transaction T1
    OBJTYPEB
    RELKING
    RELATEDGUID: GUID of T1
    RELATIONID GUID: creating a new 22 character GUID and then assigning it
    But still I am not able to create the related entity. Can any one please help me in resolving this.
    Thanks,
    Ravi G

    Resolved by self

  • I have an original iPhone running version 2.2.1.  I wish to get rid of the phone, but before discarding it I want to remove the email records, phone book information, and photos.  I would like to leave the other apps in place.  Any suggestions?

    I have an original iPhone running version 2.2.1.  I wish to get rid of the phone, but before discarding it I want to remove the email records, phone book information, and photos.  I would like to leave the other apps in place.  Any suggestions?

    Delete you mail account on the phone and disable to sync your mail account in the info pane in iTunes with your phone connected, same for contacts. Also deselect photo syncing in the photo pane. After the following sync, your mail, contact and photos should be gone.
    Photos inside the camera roll have to be deleted on the phone.
    Remember, that apps only can be used with the account they were bought with. If the phone will be set up with a different iTunes account, all of your apps will be removed.
    Message was edited by: Ingo2711

  • How to remove soft deleted records?

    Hi everybody,
    Are there any ways to remove soft deleted records from LT table?
    For instance, table is versioned and database has few workspaces. The user removes some data from LIVe workspace (or from other workspaces). The removed records are marked as deleted in the LT table, but never removed from LT table even the compression is executed on all workspaces.
    I found the only way to remove them is to remove all workspaces and savepoints and when run compression. After that it removes all soft deleted records (records that are marked as deleted in LT table).
    I have a thousands active records while hundred of thousands are soft deleted, which causes performance degradation.
    Any suggestions?
    Thanks for any input.
    Edited by: dmbond on Jan 14, 2010 7:15 AM

    Thanks Ben for such quick replay.
    Please correct my understanding if i wrong somewhere...
    From you last post i understood that soft deleted records cannot be removed from versioned table where the same data were existed prior to versioning.
    I made a quick test and can see version 0 on the data that was originally there, and running compression did not removed it (choice by OWM).
    However, another case when brand new table (empty) was versioned), (new workspace created after versioing), and then new data is added into LIVE which later was removed. After compressing LIVE workspace the soft records still in LT table and version is not 0.
    Here is my last test example:
    create table dm_test (
    column1 number primary key,
    column2 number not null);
    call dbms_wm.enableVersioning('DM_TEST');
    call dbms_wm.createWorkspace('DUMMY');
    --No records
    select * from dm_test_lt;
    insert into dm_test values (9,1);
    insert into dm_test values (10,2);
    insert into dm_test values (11,3);
    insert into dm_test values (12,4);
    commit;
    --Shows data with version different than 0
    select * from dm_test_lt;
    --Delete data from LIVE workspace
    delete from dm_test;
    commit;
    --LT has delstatus negative (-1)
    select * from dm_test_lt;
    --compress LIVE workspace
    declare
    begin
         DBMS_WM.CompressWorkspace('LIVE',
         compress_view_wo_overwrite => TRUE,
         auto_commit => TRUE,
         remove_latest_deleted_rows=>TRUE);
    end;
    --The data is still there after compression
    select * from dm_test_lt;

  • State code or status code is invalid while deactivate the custom entity record

    Hi,
    We have migrated to CRM 2013 and facing one issue while deactivating the custom entity record
    Error-  State code or status code is invalid: State code is invalid or state code is valid but status code is invalid for specified state code
    when downloading the log, it is giving below error.
    <s:Envelope xmlns:s="<faultcode>s:Client</faultcode><faultstring">http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring
    xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">-1 is not a valid state code on new_partner.</faultstring><detail><OrganizationServiceFault xmlns="<ErrorCode>-2147187704</ErrorCode><ErrorDetails">http://schemas.microsoft.com/xrm/2011/Contracts"><ErrorCode>-2147187704</ErrorCode><ErrorDetails
    /><Message>-1 is not a valid state code on new_partner.</Message><Timestamp>2014-03-18T05:42:04.5523897Z</Timestamp><InnerFault><ErrorCode>-2147187704</ErrorCode><ErrorDetails /><Message>-1 is not a
    valid state code on new_partner.</Message><Timestamp>2014-03-18T05:42:04.5523897Z</Timestamp><InnerFault><ErrorCode>-2147220970</ErrorCode><ErrorDetails /><Message>System.ArgumentException: -1 is not a valid
    state code on new_partner.
    Parameter name: stateCode</Message><Timestamp>2014-03-18T05:42:04.5523897Z</Timestamp><InnerFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true"
    /><TraceText xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true" /></InnerFault><TraceText xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
    i:nil="true" /></InnerFault><TraceText xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true" /></OrganizationServiceFault></detail></s:Fault></s:Body></s:Envelope>
    I checked into system, we have not customized the status reason. We have only two option value "Active"(1) and Inactive(2).
    Also we don't have any plugin on SetStateDynamicEntity, we have only one plugin on create for that entity.
    Did anyone face this issue? any pointer why its giving this issue??
    Thanks in Advance.
    Arvind
    Regards, Arvind

    posting the trace log here..
    # ScaleGroup:
    # ServerRole: AppServer, AsyncService, DiscoveryService, ApiServer, HelpServer, DeploymentService, SandboxServer, DeploymentManagementTools, VssWriter, EmailConnector
    [2014-03-18 04:13:32.491] Process: w3wp |Organization:d133c867-097c-e011-a247-02bf9d3bc4f8 |Thread:   62 |Category: Exception |User: 7492ef42-9460-e311-940e-002dd80b0ca0 |Level: Error |ReqId: fdb76819-9781-4299-9e45-2b6f296f4fce | CrmException..ctor 
    ilOffset = 0x7
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)  ilOffset = 0x7
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode)  ilOffset = 0x5
     at StatusCodeValidator.Validate(EntityMetadata entityMetadata, Int32 stateCode, Int32 statusCode)  ilOffset = 0x54
     at BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)  ilOffset = 0x0
     at BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)  ilOffset = 0x1A
     at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)  ilOffset = 0xFFFFFFFF
     at RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)  ilOffset = 0x25
     at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)  ilOffset = 0x89
     at LogicalMethodInfo.Invoke(Object target, Object[] values)  ilOffset = 0x4F
     at InternalOperationPlugin.Execute(IServiceProvider serviceProvider)  ilOffset = 0x57
     at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)  ilOffset = 0x58
     at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)  ilOffset = 0x65
     at Pipeline.Execute(PipelineExecutionContext context)  ilOffset = 0x65
     at MessageProcessor.Execute(PipelineExecutionContext context)  ilOffset = 0x1C5
     at InternalMessageDispatcher.Execute(PipelineExecutionContext context)  ilOffset = 0xE4
     at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode,
    ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)  ilOffset = 0x16E
     at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext
    context, Boolean returnResponse)  ilOffset = 0x16A
     at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x3D
     at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x24
     at   ilOffset = 0xFFFFFFFF
     at SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)  ilOffset = 0x241
     at DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)  ilOffset = 0x100
     at ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)  ilOffset = 0x48
     at ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)  ilOffset = 0xC6
     at MessageRpc.Process(Boolean isOperationContextSet)  ilOffset = 0x62
     at ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)  ilOffset = 0x256
     at ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)  ilOffset = 0xF1
     at ChannelHandler.AsyncMessagePump(IAsyncResult result)  ilOffset = 0x39
     at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)  ilOffset = 0x0
     at AsyncResult.Complete(Boolean completedSynchronously)  ilOffset = 0xC2
     at AsyncQueueReader.Set(Item item)  ilOffset = 0x21
     at InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)  ilOffset = 0xD6
     at InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)  ilOffset = 0x0
     at SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)  ilOffset = 0x3D
     at EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)  ilOffset = 0x61
     at EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)  ilOffset = 0x13
     at AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)  ilOffset = 0x52
     at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)  ilOffset = 0x0
     at AsyncResult.Complete(Boolean completedSynchronously)  ilOffset = 0xC2
     at ParseMessageAsyncResult.OnRead(IAsyncResult result)  ilOffset = 0x43
     at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)  ilOffset = 0x0
     at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  ilOffset = 0x70
     at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  ilOffset = 0x4
     at ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(Task completingTask)  ilOffset = 0x45
     at Task.FinishContinuations()  ilOffset = 0x67
     at Task.Finish(Boolean bUserDelegateExecuted)  ilOffset = 0x3C
     at Task.ExecuteWithThreadLocal(Task& currentTaskSlot)  ilOffset = 0xC4
     at Task.ExecuteEntry(Boolean bPreventDoubleExecution)  ilOffset = 0x96
     at ThreadPoolWorkQueue.Dispatch()  ilOffset = 0xA2
    >Crm Exception: Message: -1 is not a valid state code on new_partner., ErrorCode: -2147187704, InnerException: System.ArgumentException: -1 is not a valid state code on new_partner.
    Parameter name: stateCode
    [2014-03-18 04:13:32.562] Process: w3wp |Organization:d133c867-097c-e011-a247-02bf9d3bc4f8 |Thread:   62 |Category: Platform.Sdk |User: 7492ef42-9460-e311-940e-002dd80b0ca0 |Level: Error |ReqId: fdb76819-9781-4299-9e45-2b6f296f4fce | VersionedPluginProxyStepBase.Execute 
    ilOffset = 0x65
    >Web Service Plug-in failed in SdkMessageProcessingStepId: {1FE67FC9-85A6-E011-AEE1-002DD802FEB1}; EntityName: new_partner; Stage: 30; MessageName: SetStateDynamicEntity; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel,
    Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
       at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
       at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
    Inner Exception: Microsoft.Crm.CrmArgumentException: -1 is not a valid state code on new_partner.
       at Microsoft.Crm.BusinessEntities.StatusCodeValidator.Validate(EntityMetadata entityMetadata, Int32 stateCode, Int32 statusCode)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    Inner Exception: System.ArgumentException: -1 is not a valid state code on new_partner.
    Parameter name: stateCode
     --- End of inner exception stack trace ---
       at Microsoft.Crm.BusinessEntities.StatusCodeValidator.Validate(EntityMetadata entityMetadata, Int32 stateCode, Int32 statusCode)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, BusinessEntity originalEntity, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
    [2014-03-18 04:13:32.586] Process: w3wp |Organization:d133c867-097c-e011-a247-02bf9d3bc4f8 |Thread:   62 |Category: Platform |User: 7492ef42-9460-e311-940e-002dd80b0ca0 |Level: Error |ReqId: fdb76819-9781-4299-9e45-2b6f296f4fce | MessageProcessor.Execute 
    ilOffset = 0x1C5
    >MessageProcessor fail to process message 'SetStateDynamicEntity' for 'new_partner'.
    [2014-03-18 04:13:32.586] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:   62 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: fdb76819-9781-4299-9e45-2b6f296f4fce | ExceptionConverter.ConvertToFault 
    ilOffset = 0x69
    >UNEXPECTED: no fault?
    Thanks,
    Arvind Singh
    Regards, Arvind

  • After creation related entity method, child entity's Parent GUID not popu..

    Hi All,
    I am creating related entity with method create_related_entity of BOL Entity,
    then doing some modifications to this created entity fields with SET_PROPERTY method,
    then with BOL_CORE->MODIFY is functioning then getting Transaction context of BOL_CORE and doing SAVE & COMMIT,
    but due to after created related entity, no Paret GUID is present for this entity & TERR GUID of entity too, so its not saving....
    what we can do....?
                                            PARTNER_GUID                                             00000000000000000000000000000000
                                            TERR_GUID                                             00000000000000000000000000000000
                                            TERR_ID                                             500050
                                            TERR_DESC                                       
                                            VALID_FROM                                             20110817
                                            VALID_TO                                             99991231
                                            BP_NODE_GUID                                             00000000000000000000000000000000
                                            DIRECT                                       
                                            OVERRIDDEN                                       
    here Partner GUID & TERR GUID are not getting generating, after created related entities,
    when we can do, so that this child get saved under proper parent...?
    Thanking you.
    Regards,
    VIJHYD
    Edited by: vjmhyd on Aug 17, 2011 3:38 PM
    Edited by: vjmhyd on Aug 17, 2011 3:39 PM
    Edited by: vjmhyd on Aug 17, 2011 3:45 PM

    Self

  • Removing the entity object commit from transaction handler

    Hi,
    The business reuirement of the OAFWK page developed by us is as explained below:
    The basic functionality is of updating the attributes of items attached to the change order.
    The UI components displayed in the page(Item attribute changes region) are built based on the properties of the item attributes as LOV,poplist,textbox etc..
    The dynamic VO mapped to these UI components is based on a standard entity object.
    User operation:Select any attribute group and click on Go button.The Item attributes of the attribute group are displayed.Enter values in the Item Attributes and click on Apply button of the region.(changes made in the attributes related to the attribute group are committed to the database using
    &lt;Root AM&gt;.getTransaction.commit()).
    Now we have two such regions in the same page.
    On top of the page the item attributes of _{color:#800000}&lt;Item Type X&gt;{color}_ are displayed.
    Down the page, the item attributes of {color:#0000ff}&lt;_Item Type Y_&gt;{color} are displayed.
    In few special cases i.e for few item attributes, on click of Apply button for {color:#0000ff}_Item Y_{color} , the attributes of {color:#800000}I_tem X_{color} are to be updated by calling a PLSQL API.When Apply button in the Item attributes of _{color:#0000ff}Item Type Y{color}_ is clicked,the execution of controllers is :
    1.Controllers of Item attribute changes region of {color:#800000}&lt;Item Type X&gt; {color}The dynamic VO is built for the item attributes of Item Type X
    2.Controllers of the Item attribute changes region of {color:#0000ff}Item Type Y{color} The dynamic VO is built for the item attributes of Item Type Y.In the last controller of the hierarchy, the PLSQL API call is included(by invoking the method in AM) to update few attribute values of {color:#800000}Item Type X and finally &lt;Root AM&gt;.getTransaction().commit().
    Problem : The updated values by PLSQL API for {color:#800000}_Item Type X_{color} are not reflected in the database but indeed the values entered by user for {color:#800000}_Item Type X_{color} in the top of the page are committed(The Apply button for {color:#800000}_Item Type X_{color} is not clicked).
    _&gt;&gt;Please note that the dynamic VOs of both the Item Types are built on the same standard Entity Object_
    I am struggling to know the reason why the values updated by PLSQL API are overwrittem by the values in the entity object even though the PLSQL API is called in the last controller of execution.Please let me know if there is any OAFWK constraint.
    I tried the approach of removing the commit of the dynamic VO built in the region of {color:#800000}_Item Type X&gt;_ {color}{color:#000000}I fetched the entity implementation of the dynamic VO row and used removeandRetain(),revert().But this approach failed.I am referring to the jdevdoc for the built-in methods.
    {color}
    Now the requirement is the latest values updated by API (for {color:#800000}_Item Type X_{color}) should be committed in the database but not the values updated by the entity object for {color:#800000}_Item Type X_ {color}{color:#000000}in the item attributes region{color}.
    There should a single commit for the entire transaction of the page.
    Is there any chance to remove the commit of item attributes of {color:#800000}_Item X_{color} alone from the transaction handler?There are few methods in oracle.jbo.server.EntityImpl class such as doRemoveFromTransactionManager().But these methods are either protected or private.So classes of other packages cannot access them.
    So pelase suggest me if there is a workaround for this scenario.
    Thanks and Regards,
    Kiran
    Edited by: Kiran.A on Sep 20, 2008 3:34 AM

    Hi Sumit,
    Yes I agree on that front that updating the same record through PLSQL and EO is not the right approach.
    But the business requirement is as such and we do not have any workaround for this.
    Please let me know if there is any way to avoid the EO commit by removing from transaction listener.
    Regards,
    Kiran

  • EJB 3.0 relationship mapping fail to remove foreign table record

    I have a Customer class which declare the relationship as follow:
    @OneToMany(cascade={CascadeType.ALL}, mappedBy="book")
    private List<Book> book;
    At my Phone class I declare the relationship as follow:
    @ManyToOne
    private Customer customer;
    Whenever I remove the a book, the book is being removed as I iterate the List<Book> collection using the get method. But in the database, the records still exist!
    Anyone can explain where has gone wrong?

    Try flushing the entity manager directly after removing the book. But i think the book will still remain as you are not calling the remove method. In your case the relation maybe removed. you have to remove the book from the book class itself.
    Edited by: rebin on Sep 23, 2007 4:21 AM

Maybe you are looking for

  • Registering an ipod touch that went 1 month without backup?

    Daughter got brand new ipod for 13th bday. I set it up for her on her brand new email and brand new apple ID. and opted out of icloud and registering at first. She went to town on wifi, lots of apps, took pictures, created artwork, loves her ipod for

  • Itunes dosen't recognize my ipod

    itunes dosen't recognize my ipod

  • Ipod Button Not Appearing

    I have downloaded the latest version of software for my phone (v. 1.0.2) but the itunes button does not appear on the main screen. Amy suggestions???

  • OLSP not working for custom rule criteria to filter BWKEY

    Hi, I am using PC10.0. I created a rule criteria for BWKEY values and assigned. I assigned it the table T001K and the connector to the target system. I then assigned it to custom made OLSP. However when the results come out, it doesn't consider the v

  • Wi-Fi is getting disconnected after idle time

    I have following configuration:   Model Name:          MacBook Air   Model Identifier:          MacBookAir6,2   Processor Name:          Intel Core i7   Processor Speed:          1.7 GHz   Number of Processors:          1   Total Number of Cores: