26
Views
7
Comments
Get CRUD logic from another module

As i put everything in one module, and some data has been imported too. 

I am now working on split the module, by copying the screens to another module. The entity and logic will not be moved, as data has been imported.


Inside below module (Entity and logic), i have stored the entity and logic inside. 

E.g. Delete computer


In another new created module, i have added the dependancy of all entity and logic. 

However, when I copied the Company screen to this new module, the CRUD (Delete ) seems cannot be copied as below:






May I know how should I solve above problem in new module? Thanks.

Hi Winnie,

Please check the readOnly property of that entity, i think it is marked as true.

Make it false and then refresh the dependency.

Hope it helps.

Thanks

Oh yes, 

I have another question, 

In the original one, i have a server action which can click inside, and i have already set to "Yes" in public, 


For my UI module, I have added the dependency to it. But when I double click the action, I cant click inside to see the above logic, is it normal?

yes it is normal, but to check the logic inside you need to right click on that server action and click on open in (your module name)

hope it helps.

thanks.

Got it, 


Sorry i have another question here. 

This is my original one, i have a menu here with the link for original one, but eventually i will delete all screen from this module , and only put the raw entity and logic here


Below is my UI module:

Should I create the menu here?? as the link of submenu should refer to the link of the screen in this module instead of the above one

Yes, i think you should create your menu in your UI module.

It is common to expose your entities as Read Only as much as possible. The cruds are not accessibel outside of that module. Therefore you have to write your own public serveraction that calls the original CRUD action.
The new serveraction, called a "CRUD Wrapper" will be exposed to the other modules.

Hi Winnie Lam, 

It is always recommended to keep your entities as Read Only Yes, because you must not allow any of it's consumers to directly perform any CRUD operations on it. 

You can create your own public server actions in order to perform the CRUD operations in the UI module and in those actions, you can build your logics to perform some basic security checks like maybe Role checks etc (If that is a requirement).

Hope this helps!

Regards,
Prakhar Sharma

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.