Open Forum

WebApps and PVs

  • 1.  WebApps and PVs

    BRONZE CONTRIBUTOR
    Posted Jul 12, 2019 02:25 PM
    Edited by Lewis Shaw Jul 12, 2019 02:45 PM
    ​Hello All,

    Does anyone have a guide or tips for modifying or creating PVs in WebApps?

    I can create them in Dynamics no problem, but have been struggling with them in WebApps.

    Thanks.


    ------------------------------
    Lewis Shaw
    Raytheon Canada Ltd
    ------------------------------


  • 2.  RE: WebApps and PVs

    SILVER CONTRIBUTOR
    Posted Jul 12, 2019 06:36 PM
    Edited by Marc DeLozier Jul 12, 2019 07:10 PM
    Hi Lewis,
    I can try to explain here...feel free to call or email me to discuss further - I have modified and created my own lookups in web apps, so I've been down this road before.

    You will need to edit the 'GetLookupString' and 'GetSearchFields' functions in web apps. Most of these are in the UIHelper of the respective project with which you are working.

    If you look at the ProjectTimecardUIHelper, you can see this example for looking up the Project Task::



    What this means...if the String = "ProjectTask" (this is passed by the lookup), then the following happens:
    1. the web service lookup name is TaskTEList, but this is not actually the stored procedure that is run. There is a table in the system database, webservicelookup, that has the correlation beteween the Name and the Procedures. in this case, the TaskTEList will run the WSL_TaskTEList stored procedure.

    2. For parm1, it passes the Project
    3. For parm2, it pass the Employee (ProjectTimecardUIHelper.TimecardModelDefaultBase.InnerTimecard.Employee)
    ----these 2 are what is passed when the list first loads (the next 2 are sent as %)

    4. Parm3 and Parm4 are 'Search Only' --these are used (along with the first 2 when you start typing)


    In the 'GetSearchFields' function, you can see that Parm3 and Parm4 are listed for the ProjectTask and match the output column names of the Stored procedure (and relate to the [SearchOnly] above)



    ​Also, each lookup is prepended with @page, @size, and @sort for proper paging of search results.  and these procs are usually all dynamic SQL.  ​​​​

    What you need to change depends on whether you need to pass another 'limiting' parameter, another search parameter, or just take over the whole lookup with your own procedure.  If you do create your own stored procedures, be sure to insert records into the webservicelookup and webservicelookupit tables in the SYS database .

    Again, feel free to reach out if you want to discuss.



    Marc

    ------------------------------
    Marc DeLozier
    Finance SysAdmin
    David Evans and Associates Inc.
    Portland OR
    ------------------------------



  • 3.  RE: WebApps and PVs

    SILVER CONTRIBUTOR
    Posted Jul 14, 2019 01:35 PM
    Edited by Marc DeLozier Jul 14, 2019 11:39 PM
    Hi Lewis,
    Just realized that I may have made an assumption and accidentally answered the GetLookup, not GetPV - they both do similar things, but are built differently.   Some projects within web apps use Lookups and some use PVs (and some use both.) . We recently started using resource planning which did use some 'PVs' and I converted them all to use 'Lookups' instead and wrote my own stored procedures - I didn't want to deal with the PV lookups!

    Marc

    ------------------------------
    Marc DeLozier
    Finance SysAdmin
    David Evans and Associates Inc.
    Portland OR
    ------------------------------



  • 4.  RE: WebApps and PVs

    BRONZE CONTRIBUTOR
    Posted Jul 15, 2019 12:56 PM
    Hey Marc,

    Thanks for this, I will see if working with the Lookups is more straight forward.

    ------------------------------
    Lewis Shaw
    Raytheon Canada Ltd
    ------------------------------