Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.

Create new row in an BO based on an existing row in same BO

wings

We are trying to create a new row in a bo based on an existing row in the same bo. We need to do this because further processing occurs on both objects.

When we try and create the new object is wont let us copy the multi-allowed field and we get the following error:

Attribute path ParcelProcess.Parcels.Categories is not valid because attribute Categories has 'multiple allowed' flag on.


aware_support

The problem is not related to the copy - it is in the original object. You cannot have an attribute path like this:

MyObject.MyMultipleAttribute.MyAttribute

where MyMultipleAttribute is a reference with "multiple allowed". The reason is that it is unclear which instance of the multiple reference you are referring to.

So in your path ParcelProcess.Parcels.Categories the Parcels attribute of the ParcelProcess must be a multiple reference. You cannot refer to the Catogories attribute (or any other attribute) using a path like this.


wings

How can we then copy the data to create an identical copy of its parent?

If we have objects like

ParcelProcess --<Parcels --<Categories

We want to copy the Parcel and copy the categories linked to the parcel.


aware_support

So you need to create a copy of each instance of the Category linked to the original Parcel and link it to the new copy of the Parcel?

If so, there is no easy way of doing this - you need to write a process that would create a copy of the Category, create a copy of the Parcel and re-link everything.


tford

wings,

I have a sample bsv that shows how to do this. Also search the forums for the word: clone.

If you want the sample, PM me your email address.


wings

Thanks Tom, Thats a great example for cloning a 1 to 1 relationship but we need to copy a 1 to Many relationship.

If aware handles the 1 to 1 then, I don't understand why it wont handle a 1 to many, to do this in SQL only takes seconds.

This is something that we will need to do over an over for different bo's and its relationships, if it can't be done as easier as your example or if at all then we have wasted months of development.

Surley this is functionality that everyone would want in an application generator without having to copy an relink the data.

If you have to copy and relink the data how would you do this?



wings

Thanks Tom your a Champion!!

To help everyone else out this is what I did (With Tom's Help)

Process 1
Rule:CreateOne INPUT Parcel
CREATE Parcel WITH Parcel.Description=ThisParcel.Description

Rule:FindLinkCategories
FIND Categories WHERE Categories IN ThisParcel.Categories

Rule:CopyCategories
Process 2

Process 2
Rule:CopyCategories INPUT Categories, Parcel
INSERT Categories IN Parcel.Categories


gust

aware_support wrote

The problem is not related to the copy - it is in the original object. You cannot have an attribute path like this:

MyObject.MyMultipleAttribute.MyAttribute

where MyMultipleAttribute is a reference with "multiple allowed". The reason is that it is unclear which instance of the multiple reference you are referring to.

So is there a way to FIND MyObject WHERE MyObject.MyMultipleAttribute.MyAttribute=smt. ?

Three days I am trying to achieve this with different approaches.
Simple task but difficult to make it .

Supplier BO has a CategorySubcategory BO - multiple allowed. CategorySubcategory BO has Category BO and Subcategory BO. So when you enter new CategorySubcategory BO you choose one Category and one or more Subcategories. Subcategories are

So now how can you find a Supplier BO who has certain subcategory of certain category? Or it is not possible in AwareIM now?

I tried to make smt like this:

FIND Supplier WHERE (CategorySubcategory IN Supplier.CategorySubcategory AND Supplier.CategorySubcategory.Category=A AND Supplier.CategorySubcategory.Subcategory(that is in that CategoryA)=B)

But Attribute path Supplier.CategorySubcategory.Category is not valid because attribute Category has 'multiple allowed' flag on.