How to change text on page dynamically depending on value from another page/ product in Kentico CMS 9.0 - kentico

Currently, we are working on Kentico CMS 9.0 version.
We are facing some development issue on below scenario:
There is a static message getting displayed on a Success page after
Registration. This Text is written in WebPart -- > HTML Envelop
section - Content after But we want to change this text dynamically
as per User selects the Band category.
Example If User registers for 1-10 Band category, then text message should be displayed as “ Fees $1, 500 / two years”, or if the range of 2-20, then “Fees: $2,500 / two years” etc.
We tried with Macros on this, but not getting the exact solution. Also tried with relating the pages to get value from this Category pages. But no luck.
If anyone has any pointers on this. Or whether it could be possible to do this in Kentico CMS, please let us know ASAP.

If the data the user is submitting is part of the user's record or attached to a user's ID you could do a lookup using a macro or create your own custom macro to do the work for you.
For instance, if the value the user selected is attached to the user's record and they are logged in after they register, you can use something like:
CurrentUser.GetValue("CustomFieldName")
This all depends on what the value is that you're storing. If you're storing an integer or key of some sort to another table, you'll need to get that key and do another lookup to that other table to get the actual display value. Something like this:
var userRegisteredValue = CurrentUser.GetValue("CustomFieldName");
GlobalObjects.CustomTables["CustomTableNamespace.CustomTableName"].Items.Where("ItemID = " + userRegisteredValue);

Related

How to get view data to copy to field in document?

I'm currently tasked to redesign an application form where several fields will need to auto-fill based on the data from a specific field when it is entered.
Since I'm relatively new to LotusNotes, my boss hinted at me to first create a view which displays the fields to auto-fill. Which I did:
| Visitor Name | Company Name | Contact No | Date Entered |
Visitor Name is the field which will determine the data for Company Name and Contact No when it auto-fills in the form. Date Entered will see which data is the most recent and will use that. Also the field must be set as Editable to allow user to change the data if need be.
However, when trying to modify the form, I can't quite get how to link the view together with my desired field in the form.
I tried #DbLookup and created the formula
#If(VisitorName = "";"";VisitorName != ""; #DbLookup("" : "" ; "Local":"D:\LotusNotes Project\HR002a.nsf"; "Visitor View";#text(ContactName);#Text(CompanyName));"")
But it doesn't seem to work when I place it in Default Value or Input Translation. Even changing the filed to Computed doesn't seem to help as well.
What else am I missing in my formula?
You could simplyfiy your formula
#If(VisitorName != ""; #DbLookup("";#dbname;"Visitor View";#text(ContactName);2;[FailSilent]);"")
I am assuming this is a form used in the Notes clieny, not on the web. If this is a web form, you need a different approach.
You could very well use #DBLookup for that task. To improve performance, concatenate all the values into one column, perform the #DbLookup on the form, retrieving the concatenated values, then split them into separate values and populate the different fields.
You could also use Lotusscript. You want to look at the NotesView class and the NotesViewEntry class (assuming you want to build it for performance). Use the ColumnValues property of the NotesViewEntry class to read the columns in the view. Remember that the first column needs to be sorted.
Or your company could hire someone that already know Notes and Domino, and have that done in an hour. That would probably be financially a better choice than you spending hours or days on this fairly simple task. There are many of us here (me included) who could jump in and fix this for your company.

PerformancePoint analytic grid hyperlink functionality with KPI images

Within PerformancePoint I am trying to merge the functionality of an analytic grid with the imagery of a KPI scorecard. The analytic grid measures contain an action that lets the user jump to a specific edit page for that measure (based on the intersection of 2 dimensions, Line of Business and Month. That edit page is linked to a database, from which an SSIS package pulls information and processes to fill the cube. Is it possible to add a dynamic hyperlink property to the KPI, one that is based on the intersection of the 2 dimensions, or replace the measure value in the analytic grid with images (similar to a KPI indicator)? I was trying to do it using the API, but I haven't been able to see how to access those particular properties (the associated dimension member values).
Well, I had some screen shots that might have helped make things clearer, but don't have enough reputation to add images to a post, so Ill try and explain it in text.
I want to be able to use a hyperlink action expression such as the one below (which is functional in an analytic grid) on a scorecard KPI or baring that, use an image in place of the actual value in an analytic grid (to give it the appearance of a KPI).
/_layouts/GlobalDeliveryReporting/ProjectStatus.aspx?ProjectID=" + CSTR([Dim Project].[LOB].CurrentMember.PROPERTIES('Key1')) + "&Month=" + CSTR([Dim Status Month].[Months].CurrentMember.Member_Value))
In a nutshell:
I am trying to merge the functionality of the analytic grid action with the indicators of a scorecard Kpi.
I hope that made things a littler clearer.
Thank you
I was able to get this working.
With inspiration from :
http://web.archive.org/web/20080305164525/http://blogs.msdn.com/performancepoint/archive/2007/10/05/implementing-a-hyperlink-from-a-kpi-in-a-scorecard.aspx
For those that may need to do something similar, these were the key elements:
Scorecard
I added a hyperlink property, which causes a click event to fire every time you click on a cell.
Web Page Report
The url for the report points to redirect.aspx. It calls redirect.aspx with a query string parameter of EndPoint_URL which contains the dimension information of the clicked cell.
Redirect.aspx
This page is responsible for parsing values out of EndPoint_URL. Once the correct dimension level is achieved, it creates creates a new query string and redirects to the edit page, otherwise it just returns. The EndPointURL ends up looking like this:
[Level1].[Level2].[Level3].&[Level4].&[Level5].&[Level6].&[Microsoft].&[Level7].&[Level8]&[69621]; [Dim Status Month].[Months].[Status Year].&[2015].&[2015-02-01T00:00:00]
In this instance, the values that need to get passed to the edit page are [69621] and [2015-02-01T00:00:00]. The redirect page parses out the EndPoint_URL, if it reaches the correct depth and finds those values, it will send the user to the edit page, otherwise it will just return.
I put the scorecard and the web page report on a dashboard. Then connected them by passing the url and the memberuniquename of the row and column.
The downside is that it starts loading the redirect page everytime a user clicks on the scorecard, although that page is very lightweight, and once I hide the web page report web part clicking through the scorecard only causes a little blip on the screen.
Let me know if you have any questions!

How to populate a site column from a list to another list?

I have defined a couple of lists for capturing registration details of the user. There is a list for holding personal details of the user and there is another list which holds professional details of the user.
The two lists are used over two different pages in which name and ID both are required.
How do I get the name and ID populated automatically into the professional list from personal list so as the user doesn't have to fill the similar information twice?
Is it possible without doing any coding stuff?
This little control may help you
http://cascddlistwithfilter.codeplex.com/
Basically you would link the first Cascading drop down control to your user details list and the field name. The second drop down would then filter the users ID so the user can select that.
I have used this before and it can be a pain in the backside to configure but when it's there it is so very powerful and useful.
It's not fully automated but i'm unsure how you would get any closer with a bespoke event receiver.
Create the custom form there, you have keep some text box with the refresh button, so when ever you fill the user id and press the refresh button. You need to right small logic to bring the user from the the source list.
Or you can use the personal details id as look up column in the prop list so you will get the id and select the id and do refresh. Anyway you have right the logic in your custom form code.

How can I filter a Sharepoint 2007 libarry list based on current user login?

I would like to know how I can filter a SharePoint library list based on current user login.
Suppose I have created the followings:
1) A SharePoint form library containing bunch of uploaded InfoPath form data.
2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.
I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.
I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value to that of "TargetUser".
I tried using other text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepted the parameter without any error but the resulting fitlered list does not display any items at all.
I have googled this subject but I have not found any solution.
It would be greatly appreciated if anyone can help me to create a functional filtered list.
And FYI, my SharePoint 2007 installation is just WSS 3.0 + Form Server. I do not have MOSS 2007 (so no MOSS 2007 web parts or web services).
Thank you.
Jason
Is there any reason your TargetUser field is a text field instead of a People or Group field?
The [Me] identifier can be used to filter list items based on a People or Group column, but not on text fields.
Well. It looks like no one here has the answer.
Nevertheless, another user on Technet forum has a very good solution.
See this link for more information

Sharepoint: Person column in custom list

I have a Person field in my custom list. I want to have a view that will show multiple fields from that Person instead of the one I had to choose when creating the Person column.
So basically I want to have one column for Person and then in the view see Name, title, email, phone. All of those are valid choices but I can only pick one right now.
I really want to avoid typing in the username lookup for each column I choose to display.
This is SP 2007
It sounds like you need to create a custom fieldtype (with a fieldcontrol) that inherits from the userfield but in viewmode renders out the different columns you need. Is that something along the lines you are looking for?
http://www.sharepointblogs.com/nicksevens/archive/2007/08/31/create-custom-field-types-for-sharepoint.aspx
Note: This link is broken
You probably want a Computed Field. Note that this is not a Calculated Column. A Computed Field is what is used to display the same data is different ways. In SharePoint there is a Title field, but there is also a "Title (linked to item with edit menu)" computed field as well as a "Title (linked to item)" computed field.
See midway down this link for more details. I'm not sure if it will have all of the power that you need, but if it does it is almost certainly what you are looking for if you don't mind getting into the Schema XML file a little.
Could you use a DataView web part for this? If it's just a question of viewing the data that might be suitable.
Came across this thread and thought I'd add a tip. This suggestion is clearly not for every use case, but may work well in situations where you're managing a list rather than allowing manual inputs (verified to work with SP 2013):
Create a spreadsheet with columns to match your SharePoint list that contains multiple profile fields. (for example: name, phone number, email address)
In the spreadsheet, enter the same email address in all of the person/group field types in that row. (e.g., boss#company.com, boss#company.com, boss#company.com)
Select and copy the row(s) you wish to transfer to SharePoint.
In SharePoint, change the list view to "Quick Edit" and paste the row(s) into the grid.
SharePoint will process each field and convert the email address to the profile value you selected during the list setup.

Resources