For Receipts Screens in Inventory Module
The following users will be the only users allowed to use sites that do not begin with either “TRK” or “SVC”:
User1
User2
First Have modified Sp and Pvrec.csv and try to send current User ID as a new Parameter In CsiteId PV field but it shows "Set Property Returned an error .Check scode for value" error.
Actually i want to customize this screen only i don't want to Customize with same PV for other screen like Transfers.
so how can i do that?please help me
*This post is locked for comments
Mr.Rick Thanks for your response.
I have create a new Pv in Intran.User1 field in Recipts Screen.
Have altered Site_With_InvtFlag Procedure ,Have a custom Table X_site in X_Site Columns are UserID,SiteId and Enable .
Intran.USer1 PV:"X_Site_With_InvtFlag", "bpes.cpnyid"; 0; 0; 0; 0, "bintran.invtid"; 0; 0; 0; 0, "bPes.UserId"; 0; 0; 0; 0,
CustomPv.Csv: X_Site_With_InvtFlag,,,SELECT * FROM vi_SiteWithInvtFlag WHERE CpnyID = @Parm1 AND (InvtID = @Parm2 or (InvtID is null and not exists (select 'x' from vi_SiteWithInvtFlag v2 where vi_SiteWithInvtFlag.CpnyID = v2.CpnyID AND v2.InvtID = @Parm2 AND vi_SiteWithInvtFlag.SiteID = v2.SiteID ))) And siteid =(CASE WHEN @Parm3 not in (select Top 1 UserId from X_site x where x.UserId=@Parm3) then SiteId WHEN vi_SiteWithInvtFlag.User5=0 then SiteId when vi_SiteWithInvtFlag.User5=1 AND vi_SiteWithInvtFlag.SiteId is not null and (not exists (select 'x' from X_site x where vi_SiteWithInvtFlag.SiteId=x.SiteId and not (x.UserId = @Parm3 and enable =1 ))or exists(select 'x' from X_site x where vi_SiteWithInvtFlag.SiteId=x.SiteId and (x.UserId = @Parm3 and enable=1))) Then siteid end) AND vi_SiteWithInvtFlag.SiteId LIKE @Parm4 ORDER BY vi_SiteWithInvtFlag.SiteID,Site,vi_SiteWithInvtFlag.SiteID;Site ID;118;0,vi_SiteWithInvtFlag.Name;Name;110;0,vi_SiteWithInvtFlag.ExistingSiteFlag;Active Site for this Item;0;0
if Site.User5=1 then it's restricted site and if the particular user have access in X_Site then only he can see the site.
X_site Table Sample:
UserId SiteId Enable
SYSADMIN 200 1
USerA 400 1
Thillai 200 1
ANBURAJ 200 1
My StoreProcedure is
In procedure have passing CurrentUserID as @Param3
Create PROCEDURE X_Site_With_InvtFlag
@Parm1 VARCHAR (10),--'0060' CpnyID
@Parm2 VARCHAR (30),--'0RBOLT' InvtID
@Parm3 VARCHAR (30),--'SYSADMIN' --Here have changed Invt Id to USerID
@Parm4 VARCHAR (10)--% --SiteID
As
SELECT distinct * FROM vi_SiteWithInvtFlag WHERE CpnyID = @Parm1 AND (InvtID = @Parm2 or (InvtID is null and not exists
(select 'x' from vi_SiteWithInvtFlag v2 where vi_SiteWithInvtFlag.CpnyID = v2.CpnyID AND v2.InvtID = @Parm2 AND vi_SiteWithInvtFlag.SiteID
= v2.SiteID ))) And siteid = ( CASE WHEN @Parm3 not in (select Top 1 UserId from X_site x where x.UserId=@Parm3) then SiteId WHEN
vi_SiteWithInvtFlag.User5=0 then SiteId when vi_SiteWithInvtFlag.User5=1 AND vi_SiteWithInvtFlag.SiteId is not null and (not exists
(select 'x' from X_site x where vi_SiteWithInvtFlag.SiteId=x.SiteId and not (x.UserId = @Parm3 and enable =1 ))or exists(select 'x' from X_site
x where vi_SiteWithInvtFlag.SiteId=x.SiteId and (x.UserId = @Parm3 and enable=1))) Then siteid end) AND vi_SiteWithInvtFlag.SiteId
LIKE @Parm4 ORDER BY vi_SiteWithInvtFlag.SiteID
The above sp is Perfectly working in Sql .but in Screen i press f3 then error only showing .Have attached the First error screen shot and 2 nd error is The cursor (82) has 0 columns associated it should be greater then o and less then or equal to 256.
Please any one help me.
Here UserID as @Param3 but in Error screen showing X.userid='0060' so it collaspe the Params.but have removed the case statement in Store procedure then it will works fine.but very difficult to write without case statements.
Here i can not insert image so i posted as new question .the link is
"community.dynamics.com/.../149147.aspx"
what i did wrong?please can you help me?
Several SL PV statements use CASE statements and I have used them in custom PVRECs. So, the answer is: yes, you can use a case statement.
Hi Perumalsamy ,
In My New SP Have used Case statements but if i used case statements then in screnn i press f3 then error only showing.if i remove the case statements then working fine.but in my sp very tough to create a sp without case statements?is possible to use case statements in PV?
Mr.Perumalsamy
my previous post also you gave the solution, now also you save me .. very thanks.
Yes, you don't have to add the same PV into new field. You have to do the followings
1.You have to create a stored procedure that has to fulfil the above requirement
2.You need to create new PVrec based on your requirement.
3.Import the PVRec file into Dynamics SL Using Possible Values Import
4.Add that PV procedure into the PV property of new field.
Hope this explains.
Mr.Perumalsamy thanks for your quick response. i am not correctly getting this line
"add the new field with the same exact properties with the exception of the PV".it mean by don't add the PV properties to that new field? please can you explain bit more?
Hello ThillaiRaja,
You cannot change the standard PV property in Customization Manager, but you are able to modify/add (to an extent) some of the fields that the stored procedure called by the PV displays.
You can do the work around for this.
You have to add a copy of an existing table structure (e.g. Intran) and aliased it with another name. You are able to go into the insert object wizard and add the aliased structure with the field you wanted
You have to hide the original field and add the new field with the same exact properties with the exception of the PV.
On the chk event of the new field, you have to setup the original field to the value of the new one. On form_display, you have to setup the value of the new field to the original so that it would properly display on the screen.
Hope this explains.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156