I'm trying to have our created field flhsmvCounty field to auto populate with the county attached to the user's account when they open the find a request page in the self service page.
I was able to get the user's information to autofill on the ess.sd.open page by toying with the Format Control, but the Ess.Sd.search didn't have a Format Control out of box and when I made one for it nothing seemed to happen.
I opened a ticket with HP, Angie T. sent me this fix that resolved my issue:
I would like to provide you an update regarding your Service Manager Case: 5317645510 (How to get a field to auto populate as the person opens self service),
We would like if you could follow the below steps, first in your test system:
-Login as Admin in the windows client
-Type "fc" in the command line
-Go to calculations and add a new one as follows:
*Calculation: $lo.county=flhsmvCounty in $file1
-Save the changes
-Type "ds" in the command line
-Modify the first line adding ;flhsmvCounty in $L.file=$lo.county at the end. The line will look like:
if ($G.ess=true) then ($L.format=nullsub(ess.search.format in $G.sm.environment, "ess.SD.search");flhsmvCounty in $L.file=$lo.county)
-Save the changes
-Login to ess and test it
I think this is using the "cc.search.incidents.display" Display Screen. So, you can probably add code to the Initializations, Initial Expressions field to do that.
Are you speaking of the Display Option? I don't see a Initializations, Initial Expressions field, and no Format Control of that name. Should I create a new DO? What should I add there?
Oh yes yes. I think you are correct on the area. Any idea what a should put in to get this to display the user's county record?
flhsmvcounty is the field I created for the county.
Here's what i'm trying: flhsmvcounty in $file=nullsub(flhsmvcounty in $lo.user.name)...but no cigar yet
What table did you create flhsmvcounty in? If that was the operator table, you probably could do:
flhsmvcounty in $L.filed=nullsub(flhsmvcounty in $lo.operator)
Where is the relation for the logged in operator and the associated location record? Is it at the operator record or the contact record? For example, does the operator record have a location field, which links to the location table? Or does the operator have a contact record and on that contact record is a location field?
I made some assumptions. Try this:
if ($L.search.format="cc.search.incidents.display") then ($L.void=rtecall("rinit", $L.rc, $L.contact, "contacts");$L.void=rtecall("select", $L.rc, $L.contact, "operator.id=$lo.user.name");if ($L.rc=1) then ($L.void=rtecall("rinit", $L.rc, $L.location, "location");$L.void=rtecall("select", $L.rc, $L.location, "location=location in $L.contact");if ($L.rc=1) then (flhsmvcounty in $L.filed=flhsmvcounty in $L.location)))