Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, April 29, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Reporting & Notification Forums - Reporting
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Reporting | New ThreadView:  Search:  
 Author  Thread: Problem with passing current User id to the crystal report.
Anil
Posts: 4
 
Problem with passing current User id to the crystal report.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Mar 11 3:22 AM
fiogf49gjkf0d


Hi,


        I want to show all the opportunities related to that Sales Person only in the crystal report. To get sales person id (CurrentUserID), i have written this following plug-in and added it to Reports on open section. Even if i hard-coded with some name, it is not working fine. Can any one please help me?            


Plug-in I have used


option explicit


sub Main


 Dim UserID


    'UserID = Application.BasicFunctions.CurrentUserID


    UserID = "XXXXXXX"


 With Application.BasicFunctions


    .ReportClearConditions


    .ReportAddCondition "Opportunity:AccountManagerID", "=", "'" & UserID & "'" , "string", ""


 End With


end sub


[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Problem with passing current User id to the crystal report.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Mar 11 8:11 AM
fiogf49gjkf0d

Haven't done this in a while, but I believe the problem is that you are adding Single Quotes around the UserID variable.


Try the following:


.ReportAddCondition "Opportunity:AccountManagerID", "=", UserID, "string", ""

[Reply][Quote]
Anil
Posts: 4
 
Re: Problem with passing current User id to the crystal report.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Mar 11 3:38 AM
fiogf49gjkf0d

I have done the same as per your suggestion. But it is not working fine. Can you please help where i am doing wrong? Let me explain all what i have done so far.


I have created a crystal report using the following three tables "Opportunity", "Account" "UserInfo" tables and created a field parameter to filter the opportunity based on the status (that will be prompted with description when running the report). Till this point, it is working fine.


When I have gone through some articles, I came to know how to display only the opportunities based on the logged user id. So i have started writing the above plug-in that i mentioned earlier. I have added it to the Report by the following steps.


1. By "right-click" on the report, click "Edit" option. It will open up Crystal Report Properties window.
2. In "General" Tab, under "Filtering" options, Main Table - "Opportunity" Table, Master User Field - "AccountManagerID" and Master Date Field - "CreatedDate".
3. Under "Execution" tab, "When Open" event - "Action" - "Action Script" is selected. "Argument" - the above mentioned plug-in is selected.


Plug-in after modification
----------------------


option explicit
sub Main


Dim UserID As String


Set UserID = Application.BasicFunctions.CurrentUserID


With Application.BasicFunctions
.ReportClearConditions
.ReportAddCondition "Opportunity:AccountManagerID", "=", UserID , "string", ""


End With
end sub


But it is not working fine after the above modifications also


Thanks


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 4/29/2024 10:48:07 PM