Link to home
Start Free TrialLog in
Avatar of NSCexpert
NSCexpert

asked on

@Username in View

I created a view with a selection process as follows:

FieldA = @Username

I am using this in a frameset and for some reason it doesnt work. It tends to give me back the name of the person that created the view(wierd).

I even tried tweaking it using the following code:

User := @UserName;
SELECT User = FieldA

All users that I am testing it on have full access to the forms in the db.

Is this something to do with the frameset I am displaying the view in or a bug possibly?


Avatar of shuboarder
shuboarder
Flag of United Kingdom of Great Britain and Northern Ireland image

I have experienced a similar problem before, and the way I got around it was to create a new database with a new view.

Created the @username column - made sure it worked, then cut and paste that into the database I was working on
and it worked.

Avatar of CRAK
It's not a bug!
A view is indexed. The index gets built the first time its accessed (often by the creator or signer).
When another person accesses the view, the available index is used....

It's often bypassed by using private views (public, personal on 1st use), but those can't be updated in design refreshes.
Better is using a single category view; categorize by FieldA, use @UserName (mind the format!) to define the category.
Avatar of NSCexpert
NSCexpert

ASKER

CRAK how do I define the category ?
ASKER CERTIFIED SOLUTION
Avatar of CRAK
CRAK
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
CRAk is on target..

@userName is not recommended in View Selection formulae.. Single Category Embedded view is the Solution.
CRAK,
Your Photo in PageEditor section looks good .....
Hope you are doing good.
Grr... Got interrupted. Points to Madheeswar!
Thanks madheeswar. All is well!

Sjef....
> points to.... madheeswar????
For mentioning "CRAK is on target" or confirming that @username should not be used in a selection formula?
Sigh..... and all this time I thought fine experts would recognise a perfect solution when they'd come across one!
;-(
Maybe I am being stupid here but I get the following results.

I am embed the view. OK
Select Single Category. OK
Enter My Name in Speech Marks OK
It returns my docs OK

I do the same and replace my name with @Username and no documents appear.

Help

1st: check the view to see what other names it contains as categories.
2nd: switch to an id matching with one of those names and reopen the database.
If the single category formula is @Username, it should now show display the document for that id. Unless there's still a discrepancy such as common- of canonical names, upper- or lowercase, multi-value errors.

You could add a computed text over or under your embedded view, also showing @Username. That exact phrase (=the single category formula!) should occur as category in the view or it'll show up empty!

You could also create a test scenario to see it work:
A document containing a field "x" with value "a" and another holding value "b". Both with an additional field to identify the two doc's (e.g. "Aa" resp. "Bb")
Single category: hard-coded: "a" or "b"
That'll at least save you the trouble of @Name-variations!
Hi CRAK, aaaaah, excuse me! I didn't completely read your post. Is there anybody who can open the backdoor for me?? Please...   *sneaking out*
You're not sneaking out Sjef: NSCexpert needs help!
And I forgive you.... if you don't mind me having a good laugh on you!
Is there a reason I should stick around then? I think you're all doing a great job here *grovel-grovel* so please would you let me make myself scarse?

One of my lesser qualities (defined as ineffective in the RDA methodology): the clown. You may laugh now. Makes me think of Herr Flick... :D