Aperto Chiuso

what is the best practice of many lookups in transaction screen ? #7149


User avatar
0
nabass creato
  • ABP Framework version: v8.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered (for MVC)
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I would like to ask about the best practice of this scenario: i have a transaction screen has many lookups bind to dropdowns , which way is better for reusability and maintenance of code , **first **: make App service for each entity of lookup Data ,but i have problem with this solution because i have to inject all services of lookups in transaction screen and this make the screen slower **second **: put all functions of lookups in the app service which is responsible of the transaction screen(this is the way of suite generate page) ,but if i make new transaction screen use this lookups i have to put the same code of get lookups in App service of new transaction screen **third **:make lookup App service and put all functions of lookups in it ,then inject this lookupAppService in transaction screen.

for example : - sales order transaction screen ,has currency lookup and Status Lookup and etc... -Purchase order screen ,has the same lookup dropdown currency lookup and Status Lookup and etc..


4 risposte
  • User Avatar
    0
    liangshiwei creato
    Team di supporto Fullstack Developer

    Hi,

    For me, I prefer the third one

    sales order transaction screen

    SalesOrderLookupAppService

    urchase order screen

    PurchaseOrderLookupAppService

  • User Avatar
    0
    nabass creato

    I want to handle permission of SalesOrderAppService which handle the transaction screen, and if user allow only SalesOrder.Create in permission how i enable second service "SalesOrderLookupAppService" automatically from code.

  • User Avatar
    0
    liangshiwei creato
    Team di supporto Fullstack Developer

    Hi,

    You can consider to add a new permission named SalesOrder.Screen

  • User Avatar
    0
    nabass creato

    Thank you ,I appreciate your quick response.

Made with ❤️ on ABP v8.2.0-preview Updated on marzo 25, 2024, 15:11