Cloning a record - Forum - Rollbase - Progress Community

Cloning a record

 Forum

Cloning a record

This question is not answered

Hi,

I have some unclarity's about cloning a record; This is the case: I have an order object and also related records (orderline, ordertyre and orderlynedetails are related (n:1) to order). In the case i clone the order record the orderlines should also be cloned but the original orderlines should be related to the old order; only the newly created orderlines should be connected to the new order. However all the related records (orderline, orderlinedetails and ordertyres are related to the newly created order!

Should i do something special so that the orginal orderline, orderlinedetails and ordertyres stay to the orginial order?

Kindly reply

All Replies
  • I see what you mean. For this I would suggest that you create a hierarchy relationship on your parent object and map it in your data map. Map it so that the cloned record would be the One in the one:many relationship, this way from the parent's perspective, you can access the token of the cloned record easily.

    Then call your "run trigger on related records" on the related cloned record using runTrigger() API and possibly an object script appended to your workflow action (don't forget to remove the other trigger from the workflow).

    This should make the trigger run on the cloned record.

    Hope that helps.

  • Hi,
    I managed following your suggestions as earlier mentioned:
    Button on order page
    Three triggers that are fired:

    1.      Put negative values in orderline (quantity etc)

    2.      Clone object order (which creates also orderlines (with negative values)

    3.      Put negative value (which reverses point 1) so we have positive values in original orderline again.

    Works great, thanks again, you have been a great help
     
    Wim
     
    Van: mpiscoso@gmail.com [mailto:bounce-mpiscosogmailcom@community.progress.com]
    Verzonden: maandag 21 november 2016 18:29
    Aan: TU.Rollbase@community.progress.com
    Onderwerp: RE: [Technical Users - Rollbase] Cloning a record
     
    Update from Progress Community
     

    I see what you mean. For this I would suggest that you create a hierarchy relationship on your parent object and map it in your data map. Map it so that the cloned record would be the One in the one:many relationship, this way from the parent's perspective, you can access the token of the cloned record easily.

    Then call your "run trigger on related records" on the related cloned record using runTrigger() API and possibly an object script appended to your workflow action (don't forget to remove the other trigger from the workflow).

    This should make the trigger run on the cloned record.

    Hope that helps.

    View online

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.