Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
New Member
Posts: 7
Registered: ‎03-20-2013

Create entity with an address

Hello,

 

I am new in SLX development (I followed the class and begin some basic developements).

 

I have a problem for creating an entity using the address entity. I just have a Plant entity which has an addressid and a relation with an address.:M, save update . 

What is the best way to have the address created  and saved with my entity ?

I tried to create an empty address entity but for this I need the ID for my entity which is not yet existing beceause not persited...

So can someone can tell me how and where to do this please ?

 

Thank you very much for helping me !!

Highlighted
New Member
Posts: 7
Registered: ‎03-20-2013

Re: Create entity with an address

Up ! 

 

Can someone explain me how to generate a business rule for saving and entity linked to the Address entity please (and in which event  to handle this ?

My entity looks like : PlantID, PlantName ,...., Plant.Address.ID, Plant.Address.Addresse1 .....

 

When I save my entity the address fields are not saved  as the addressID is not filled and no address enttiy created.

 

So how to save them ?

 

thanks !!

 

 

Highlighted
New Member
Posts: 7
Registered: ‎03-20-2013

Re: Create entity with an address

Hi ! I would really really appreciate some advices or link on this topic because I was not able to find any solutions (the same problem yes but not the solution) and I really need to have this working. 

 

Thanks in advance for any help !!

Highlighted
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Create entity with an address

How are you creating these entities? Have you created relationships in App Architect?
Highlighted
New Member
Posts: 7
Registered: ‎03-20-2013

Re: Create entity with an address

Hi, thanks for the reply.

I created using App architect m, relationship is GuardianPlant 1 M Address .

I have already created some other entities with relationnship with no problem but in that case I have to create two new entities (generaly for my other enties I use a lookup so I have no problem becaue the other entity is already existing).

 

With the address I need to have the entityID of AddresseID field to be able to save my addresse , BUT this ID will be generated only when my entity will be persisted... So I am not able to have it before and  save my address at the same time !

 

So I probably need to use on after insert method to get back my entityID and be able to save my AddresseID but mya first test was not successful so I wanted to know how the creation of a new addresse ID is working,

 

thanls again !

Highlighted
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Create entity with an address

If I understand you correctly - yes, I think you'll want to try tacking it on via an external assembly onAfterInsert; you should be able to get a reference to the entity after and grab the ID. 

 

 

Highlighted
New Member
Posts: 7
Registered: ‎03-20-2013

Re: Create entity with an address

OK thanks I will continue but wanted to be sure I was on the right way.

Thanks !!