Rest service class Is it possible to redirect to a record detailed page
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 |
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 |
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 '18 at 9:41
rahul gawale
825317
825317
asked Nov 18 '18 at 9:22
Test userADG23Test userADG23
266
266
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '18 at 10:37
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "459"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '18 at 10:37
add a comment |
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.
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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '18 at 10:37
add a comment |
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 '18 at 10:15
answered Nov 18 '18 at 9:59
sfdcLynxsfdcLynx
1356
1356
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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '18 at 10:37
add a comment |
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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '18 at 10:37
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 '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 '18 at 10:28
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '18 at 10:29
@ sfdcLynx please see above comment and reply me
– Test userADG23
Nov 18 '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 '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 '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 '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 '18 at 10:37
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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