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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 20, 2025, 18:00