Rest service class Is it possible to redirect to a record detailed page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}
up vote
1
down vote
favorite
In the rest service class, Is it possible to redirect to a record detail page of a object using an record?(assume that the record will get in class) see below code
@RestResource(urlmapping = '/test/*')
global without sharing class test {
@HttpPost
global static String doPost() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
Blob body = req.requestBody;
contact c = new contact();
c.lastname = 'Test';
insert c;
return null;
}
Is it possible to Redirect contact record detail page, please any one help on this.
rest-api
add a comment |
up vote
1
down vote
favorite
In the rest service class, Is it possible to redirect to a record detail page of a object using an record?(assume that the record will get in class) see below code
@RestResource(urlmapping = '/test/*')
global without sharing class test {
@HttpPost
global static String doPost() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
Blob body = req.requestBody;
contact c = new contact();
c.lastname = 'Test';
insert c;
return null;
}
Is it possible to Redirect contact record detail page, please any one help on this.
rest-api
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
In the rest service class, Is it possible to redirect to a record detail page of a object using an record?(assume that the record will get in class) see below code
@RestResource(urlmapping = '/test/*')
global without sharing class test {
@HttpPost
global static String doPost() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
Blob body = req.requestBody;
contact c = new contact();
c.lastname = 'Test';
insert c;
return null;
}
Is it possible to Redirect contact record detail page, please any one help on this.
rest-api
In the rest service class, Is it possible to redirect to a record detail page of a object using an record?(assume that the record will get in class) see below code
@RestResource(urlmapping = '/test/*')
global without sharing class test {
@HttpPost
global static String doPost() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
Blob body = req.requestBody;
contact c = new contact();
c.lastname = 'Test';
insert c;
return null;
}
Is it possible to Redirect contact record detail page, please any one help on this.
rest-api
rest-api
edited Nov 18 at 9:41
rahul gawale
1459
1459
asked Nov 18 at 9:22
Test userADG23
246
246
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
You can generate the link for your record and can use it for redirection. Try something like this in your code.
String RecordId = c.Id;
String Recordlink = URL.getSalesforceBaseUrl().toExternalForm()+'/'+RecordId;
To answer your question for the redirection to a record detail page little vague. You actually can't use the REST service to redirect to a page. All you can get from a service is a response. Response could be anything. If you are returning a link to a record detail page it will still be a response and the caller will decide if you have to redirect now or not.
So by using above snippet you can generate a link but can't achieve a
redirection directly. Its the caller's job not the service.
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
You can generate the link for your record and can use it for redirection. Try something like this in your code.
String RecordId = c.Id;
String Recordlink = URL.getSalesforceBaseUrl().toExternalForm()+'/'+RecordId;
To answer your question for the redirection to a record detail page little vague. You actually can't use the REST service to redirect to a page. All you can get from a service is a response. Response could be anything. If you are returning a link to a record detail page it will still be a response and the caller will decide if you have to redirect now or not.
So by using above snippet you can generate a link but can't achieve a
redirection directly. Its the caller's job not the service.
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
add a comment |
up vote
6
down vote
accepted
You can generate the link for your record and can use it for redirection. Try something like this in your code.
String RecordId = c.Id;
String Recordlink = URL.getSalesforceBaseUrl().toExternalForm()+'/'+RecordId;
To answer your question for the redirection to a record detail page little vague. You actually can't use the REST service to redirect to a page. All you can get from a service is a response. Response could be anything. If you are returning a link to a record detail page it will still be a response and the caller will decide if you have to redirect now or not.
So by using above snippet you can generate a link but can't achieve a
redirection directly. Its the caller's job not the service.
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
You can generate the link for your record and can use it for redirection. Try something like this in your code.
String RecordId = c.Id;
String Recordlink = URL.getSalesforceBaseUrl().toExternalForm()+'/'+RecordId;
To answer your question for the redirection to a record detail page little vague. You actually can't use the REST service to redirect to a page. All you can get from a service is a response. Response could be anything. If you are returning a link to a record detail page it will still be a response and the caller will decide if you have to redirect now or not.
So by using above snippet you can generate a link but can't achieve a
redirection directly. Its the caller's job not the service.
You can generate the link for your record and can use it for redirection. Try something like this in your code.
String RecordId = c.Id;
String Recordlink = URL.getSalesforceBaseUrl().toExternalForm()+'/'+RecordId;
To answer your question for the redirection to a record detail page little vague. You actually can't use the REST service to redirect to a page. All you can get from a service is a response. Response could be anything. If you are returning a link to a record detail page it will still be a response and the caller will decide if you have to redirect now or not.
So by using above snippet you can generate a link but can't achieve a
redirection directly. Its the caller's job not the service.
edited Nov 18 at 10:15
answered Nov 18 at 9:59
sfdcLynx
1356
1356
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
add a comment |
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
@ sfdcLynx Thanks for your reply
– Test userADG23
Nov 18 at 10:12
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
let me explain clearly. I have implemented rest service and accessing API via force.com site and external system invoking this service with site URL. Whenever external system send the response with service URL we are creating or updating few objects. After execution is completed then it should be redirect to Opportunity or Contact Detail page. Any solution for this requirement? Please let me know on this.
– SFDCLearneR
Nov 18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 at 10:29
1
1
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@SFDCLearneR implementation will remain same. Your service in the force.com platform should generate a URL as I showed you above in the snippet. You can return this generated RecordLink as a response for your external system. And, once you received a response from service. You can redirect to that link. But the service can't do something like this that you update some records and then automatically redirected to some url. This is not possible with service or you can say not the function of any service.
– sfdcLynx
Nov 18 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
@sfdcLynx Thank you for your help. I understand that we can't able to return to salesforce record detail page after DML operation in REST API. We can able to do this in SOAP API? Can you please let me know on this
– Test userADG23
Nov 19 at 10:37
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f239741%2frest-service-class-is-it-possible-to-redirect-to-a-record-detailed-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown