myothet
8/7/2017 - 12:16 PM

remove_relationships.js

/** remove relationships before adding new **/
document.thisItem.fetchRelationships("sop_sale_order_details");
var relationshipsCollection = document.thisItem.getRelationships("sop_sale_order_details");
var relCount = relationshipsCollection.getItemCount();
for (var index = 0; index < relCount; index++) {
    document.thisItem.removeRelationship(relationshipsCollection.getItemByIndex(index));
}
/** remove relationships before adding new **/