Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Go to record based on Get AccountName


Chris_J

Recommended Posts

I ma having some trouble scripting this one.

 

I have a layout called Lecturers, and a privilege set called Lecturers.

 

What I would like to happen is, when one of the lecturers logs in to the database, I'd like them to go to the record related to them, as it has their course schedule.

 

Problem is, I did a set field to Get (AccountName) and it works, but if someone else is logged in too, it takes me to that person rather than myself or it does something strange to that effect.

 

I now have this at login

 

IF Get (privilegesetname) = "Lecturers"
Perform Script (Go to Lecturers)
What would I put here to go to Joe Bloggs if he is logging in, even if John Smith is logged in
Else
Perform Script (which goes to contacts)
End if

 

I hope this kind of makes sense smiley-tongue-out

Link to comment
Share on other sites

I am assuming two things here:

 

1. every lecturer has their own account name and password (attached to the Lecturers privilege set)

2. there is some way (field value) to identify the record you want to display for any user

 

Given the above is true, you would have a script along the lines of:

 

If [ Get ( PrivilegeSetName ) = "Lecturers" ]
 Go to Layout ["Lecturers" (Lecturer)]
 Enter Find Mode [ ] 
 Set Field [Lecturer::lecturername; Get ( AccountName )]
 Perform Find [ ]
Else
 Whatever...
End If

Note that you would probably also want to trap for what happens if there is no lecturer record found.

Link to comment
Share on other sites

No 1 is certainly true. I'm unsure what you mean by an identifier in No 2.

 

I've done the set field, but it's overwriting a record with my login account name, or creating a new record.

Link to comment
Share on other sites

Doesn't work very well on IWP though.

For any solution, IWP has some specific requirements. In this case, the problem was not with the solution provided but with other script steps.

 

Big tip for all posters - if you are using IWP, state that in your original question. From an unpaid support point of view it is very frustrating to find out about that requirement later. From your point of view, you may get answers that just don't work and that wastes everyone's time.

Link to comment
Share on other sites

I'll consider my hands slapped :) but what you posted worked on IWP too, it was my own mistake putting adjust window script step.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use