If user create request from service portal so contact type field should be autofill as "self-service

lucky24
Tera Contributor

Hi Team,

My requirement is when a user creates a request from the ESC portal then in the requested item, the contact type field should be auto-fill as self-service, If they create a request from the native view or the agent workspace then the contact type should be "none"

How can we achieve this one, How can we determine the request created from the portal or native view?
I am trying with the below condition but I didn't get success

var url = top.location.href;
if(url.indexOf('now/workspace/agent') >= 0)){
current.contact_type = 'self-service';
}

 

3 REPLIES 3

Mark Manders
Mega Patron

There isn't an OOB way to do this. There is no 'comes from' functionality.

There is a difference when it comes to the OOB logic, but it depends on how you are using it. When a requested items comes from the portal, there is a request attached to it. If it is created in the backend through 'new requested item' (like sc_req_item.do or a module in the nav.pane), it doesn't have a 'request' attached. What you could do is to make the 'self-service' the default and set it to none when it's created in the back end without a request added.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

AndersBGS
Tera Patron
Tera Patron

Hi @lucky24 ,

 

I guess that you have a flow attached to the request coming from the service portal. Based on this you could set the contact type within the flow. In relation to when created from workspace, you could set the default value to none and read only when new. 

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/