Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

What controls how the PVRec's @Parm1 or @Parm2 gets passed down or assigned on execution?

Posted on by 150

In MS Dynamics SL 7.0 Sp2,  We have Queries residing in the PVRec.csv, we need to know how the parameters (@Parm1, @Parm2...etc) are passed down to the respective SQL Procedure. We are trying to restrict recordset return based on a special  unique value being passed down. 

 

*This post is locked for comments

  • Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: What controls how the PVRec's @Parm1 or @Parm2 gets passed down or assigned on execution?

    If its not working, I've a couple of suggestions.

    First, the SQL in the PV definition and in the stored procedure, should use "like" rather than "=" for @parm1.

    If you can't get it to work, how about this approach?

    My thought is to use Customer_All, which we know works.

    Get it to work.

    The gradually change it to be the PV that you want.

    If you are interested in that approach, extract the Customer_all line from PVRec.csv & put it in your own file.

    Change "customer_all" to CT_SubProject_List, but change nothing else.

    Import it.

    Likewise script the stored Customer_All stored procedure, change the name to CT_SubProject_List and create it.

    Check that the PV Property is on your field is CT_SubProject_List.

    Now try running it.

    You should get a customer list when you hit F3.

    If you do, you can start changing it to look like the PV that you want.

    The PV definition is used for popping up the PV window.

    The proc is used for a final "existance check".

    So perhaps initially change the PV definition to be what you want.

    Hope those rambling thoughts help.

    Barry

  • mark bertram Profile Picture
    mark bertram 150 on at
    Re: What controls how the PVRec's @Parm1 or @Parm2 gets passed down or assigned on execution?

    ------------- Vendor Contract Maintenance --- CN.SUB.00 (Subcontract Maintenance)

    Custom User field Object as xuser1 (Bound to pjsubcon.user1)

    PV Property: "CT_SubProject_List", (Matching Query and proc below)

    -------------PVRec Query Line ----------------------------

    "CT_SubProject_List","","","select Distinct Project, Project_Desc, Purchase_order_Num, user2 As Parent from PJPROJ where user2 = @parm1 order by project","Sub Projects","PJPROJ.project;Project #;0;0","PJPROJ.project_desc;Description;0;0","PJPROJ.purchase_order_num;CIP Number;0;purchase_order_num","PJPROJ.user2;Parent Project;0;0"

    ------------Matching SQL Procedure -----------------------

    ALTER Procedure [dbo].[CT_SubProject_List] @parm1 varchar (16) AS

    select Distinct Project, Project_Desc, Purchase_order_Num, user2 As Parent from PJPROJ where user2 = @parm1

    order by project

    ----------------------------------------------------------

    Field PJProj.user2 is used as the Sub Project field in the PJProj Table establishing a Parent Child relationship.

    We Need @parm1 to be passed as the parent project (referenced On Screen as pjsubcon.project), then the SQL Procedure will return the Sub Projects (Children) as Possible values

    The SQL Procedure has been tested separately and will return the correct dataset when a project is passed in.

  • mark bertram Profile Picture
    mark bertram 150 on at
    Re: What controls how the PVRec's @Parm1 or @Parm2 gets passed down or assigned on execution?

    Thank You Barry!

  • Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: What controls how the PVRec's @Parm1 or @Parm2 gets passed down or assigned on execution?

    The PV property of the screen control specofoes which PV is to be used, and what parameters are passed.

    Barry

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans