Ends in:
7 DAYS
23 HRS
36 MIN
13 SEC
Ends in:
7 D
23 H
36 M
13 S
Open Closed

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


User avatar
0
nabass created
  • 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 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    For me, I prefer the third one

    sales order transaction screen

    SalesOrderLookupAppService

    urchase order screen

    PurchaseOrderLookupAppService

  • User Avatar
    0
    nabass created

    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 created
    Support Team Fullstack Developer

    Hi,

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

  • User Avatar
    0
    nabass created

    Thank you ,I appreciate your quick response.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06