Send (Load) a URL to web browser and run it in background in APEX

安稳与你 提交于 2019-12-12 06:04:22

问题


Does Apex/Visualforce allow a URL which is stored as string in apex and run it in web browser in background.

Actually, that url is returned from a Docusign RestAPI callout for posting the envelope into "correction" status. The Envelope correction Status is not activated until i manually paste the url (link) in to a web browser and run it.

Does anyone know how to run a url programatically in a web browser through Apex/Visualforce in background ?
(or) Is there anyway that i could activate the "correction" status of envelope in Docusign other than running the URL in web browser?


回答1:


As I understand your question(s), the simple answer is NO/YES, but let me break it down:

  1. Run String URL from Apex - Yes - See pagereference

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_system_pagereference.htm

  1. Can you run a URL in Background - Yes you can use HTTP class

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http

  1. Can you run a DocuSign correct URL in Background - NO, the URL you get back requires the Browser for rendering and user UI interaction.

  2. Other Way - YES via the DocuSign REST API you can correct the envelope if it has not been completed or the signer has not completed their signing action. Also I have lab I created to demonstrate this on Amazon if you are interested in a step by step example of DocuSign correct.

    https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http

SAMPLE HTTP PUT via DS REST API below for existing an envelope:

PUT /restapi/v2/accounts/437977/envelopes/ed3be3c1-be06-41c2-c68c-10ddccbd655e/recipients 
Host: demo.docusign.net
X-DocuSign-Authentication: {"Username":"yourdsemailorID","Password":"yourpasswordorDSapipassword","IntegratorKey":"yourDSintegratorkey"}
Content-Type: application/json
Accept: application/json


{ "signers": [ { "recipientId": "1", "name": "David W. Grigsby (corrected)", "email": "youremail@yourdomain.com" } ] } 


来源:https://stackoverflow.com/questions/27709499/send-load-a-url-to-web-browser-and-run-it-in-background-in-apex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!