Hi Friends,
Any time you have used @username or @urlopenquarystring in view on web application???
Actually what i want is that in view i want to display documents in a different color as per the users.
Documents of current user in one colour and rest other documents in other colour. I tried to use @username but it does not work then I tried using @URLOpenquarystring but that also is not working.
So is there any other sollution for this??
If anybody has done the RND then please do reply to this mail.
Waiting only and only for the reply…
Regards,
Gracia Fernandes
Subject: Problem with @username, @URLOpensquary inview on web
You put a formula in the view’s column that compares a field in the document then modifies which DIV to use. One DIV ID for each username.
You then create a subform for each username and that subform contains the STYLE settings for each DIV… different settings for each user… likely all the DIVs will be the same but one… and a different one in each subform.
Then when UserA opens the view with your $$ViewTemplate the subform for THAT user loads that users DIV settings. To make things easier, you might consider naming the subforms after the user’s names
I hope you don’t have a hundred users!
Subject: A better solution:
-
On your $$ViewTemplate form, use passthru HTML and set all the DIV
properties so you have the default colors.
-
place a computedforDisplay field that computes each user’s name to a
specific DIV ID#… so the formula would be like: @If(@name([CN];@UserName) =
“John Smith”;“DIV1”;@name([CN];@UserName) = “Mary Wilson”;“DIV2”;… etc)
The result will be a field accessible by javascript that knows which DIV to
modify.
- Then on postopen of the form run a javascript routine that get’s this
fields value then modifies the style of THAT DIV so the color is different.
for example, this snippet changes the display based upon a field value:
if ( result == “true” ) {
document.getElementById(‘div1’).style.display = ‘none’;
document.getElementById(‘div2’).style.display = ‘block’;
}
Display is just one of many properties… background color, font color,
padding, borders - ‘google’ “DIV” and “STYLE” to learn more about it. I use
TopStylePro, but there are many tools for web development that can assist you
with all the properties available and the proper syntax for setting each.
- lastly, a computed column formula that tells each row in the view which DIV
to use based upon the contents within the document… for example:
temp := @If(@name([CN];SalesContact) = “John
Smith”;“DIV1”;@name([CN];SalesContact) = “Mary Wilson”;“DIV2”;… etc);
“div id="” + temp + “">” + @name([CN];SalesContact) + “]”
Now you have a dynamic method to change the properties of view items based upon
@username.
