Saving 2 entities when using a consumed Web Block

Saving 2 entities when using a consumed Web Block

  

Hi,

I have 2 applications, let's call one "Core" and the other "App".

In the Core, I have a web block that displays a form for the entity "Contract". The web block also has a placeholder below the fields because I expect to add some other fields (and have them save in a different entity) in the consumer application (App).

In the App, I dragged this web block on a screen to allow the end-user to view and update a Contract. I also placed the "ContractExtended" entity fields into the placeholder, so that these additional custom fields are displayed right below the basic/core fields of the Contract entity.

I now need to be able to save all this data through ONE button - and here is my issue:

I can try adding a Save button on the web block and have it save the Contract entity, but since the Save button is in the Core and is agnostic to the entity ContractExtended found in the App, I cannot have this Save button ALSO save the other ContractExtended fields placed in the placeholder.

I can try placing a Save button outside the web block on the screen in App, but if I do that I can't access the form inside the block to save the data on the Contract entity. It's almost like the web block needed to have some sort of Output Parameter that I can use in the consumer app to access the web block's data/form.

I am not sure how to go about achieving this. What I am truly looking for is the best way to have some core entities in Core, while allowing these entities to be seamlessly extended (visually) in the consumer apps (App). Any recommendations would be greatly appreciated!

David

Solution

Hi David,


One approach is to use events (OS 11) or notify (OS 10).


Please check the example in attachment (OS 11).


Cheers,

Renato


DavidA wrote:

Hi,

I have 2 applications, let's call one "Core" and the other "App".

In the Core, I have a web block that displays a form for the entity "Contract". The web block also has a placeholder below the fields because I expect to add some other fields (and have them save in a different entity) in the consumer application (App).

In the App, I dragged this web block on a screen to allow the end-user to view and update a Contract. I also placed the "ContractExtended" entity fields into the placeholder, so that these additional custom fields are displayed right below the basic/core fields of the Contract entity.

I now need to be able to save all this data through ONE button - and here is my issue:

I can try adding a Save button on the web block and have it save the Contract entity, but since the Save button is in the Core and is agnostic to the entity ContractExtended found in the App, I cannot have this Save button ALSO save the other ContractExtended fields placed in the placeholder.

I can try placing a Save button outside the web block on the screen in App, but if I do that I can't access the form inside the block to save the data on the Contract entity. It's almost like the web block needed to have some sort of Output Parameter that I can use in the consumer app to access the web block's data/form.

I am not sure how to go about achieving this. What I am truly looking for is the best way to have some core entities in Core, while allowing these entities to be seamlessly extended (visually) in the consumer apps (App). Any recommendations would be greatly appreciated!

David



Solution

Hi Renato,


Wow, thank you so much for the example! I think that this will work exactly as we intended.


Thank you,

David


Great!


DavidA wrote:

Hi Renato,


Wow, thank you so much for the example! I think that this will work exactly as we intended.


Thank you,

David