salesforce - Send with DocuSign custom button with validation -
Here's some God's help (sorry still is new to code) though I know that this is possible because I have some such work clues.
Essentially, I want to create a custom button to send with the document button at an opportunity which first ensures that all the minimum criteria are met. For this I know that I will need a VisualForce page which displays an error message, an Apex square and or custom button.
Can anyone help?
Apex Class
Public class ReadyforDocuSignValidation {Public ID Opportunities {Get; Set;} public string error {get; Set;} public string raffle {get; Set;} Public Boolean Ster [Received; Set;} public string strorm [get; Set;} Public Ready ForDocuSignValidation (ApexPages.StandardController Controller) {sterr = false; Sterrmsg = 'You must play a contact role to send through Doku sign'; Error = 'Complete the following fields before conversion: & lt; Br / & gt; '; Theft = ''; Opportunitybozid = ((Opportunity Controller) Gaterekar ()). Id; Opportunity opportobj = [Select TOB_Billing_Entity__c, Split_Date_1__c, Split_1__c, is_This_Include_recurring__c from opportunity where id =: Opportunities]; If (opportunityobj.TOB_Billing_Entity__c == null || opportunityobj.Split_Date_1__c == null || opportunityobj.Split_1__c == null || opportunityobj.Does_This_Include_Recurring__c == NULL) {reft = '1'; If (opportunityobj.TOB_Billing_Entity__c == NULL) {error = error + '- TOB billing unit / & gt;';} if (opportunityobj.Split_Date_1__c == NULL) {error = error + '- different dates / & gt;'; } if (Opportobj.Split_1__c == nULL) {error = error + '- Split% / & gt;';} if (Avsrbojkdops_in_snt_rekyuring__ C null ==) {error = error + '- recurring product? / & Gt; ';}} If (opportunityobj.Stage! =' Ready for doctor ') {// sterr = true; If (empty == '1') {sterr = true; } Else {error = ''; Blank = '1'; Sterr = true; }}}}
Visualforce page
& lt; Supreme: Page standardController = "Opportunities" showheader = "false" extension = "ReadyforDocuSignValidation" & gt; & Lt; Style & gt; H2 {width: 300%! Important; } & Lt; / Style & gt; & Lt; Script & gt; Window.onload = function () {window.onblur = function () {window.close (); } If (document.getElementById ('sd'). InnerHTML == "") {var ids = document.getElementById ('id'). InnerHTML; Window.opener.location.href = "/ apex / docusign_editenvelope? Dsid =" + id + "& rc = & sourceID =" + id; Window.top.close (); } And {settimeout (function () {winndow.close ();}, 10000); }}; & Lt; / Script & gt; & Lt; Div id = "sd" style = "display": "& gt; {! Reft} gt; id =" id "style =" display: none; "& Gt; {! Avsrbojid} & lt; / div & gt; & lt; sc: pageBlock title =" ReadyforDocuSign "& gt; & lt; sc: pageBlockButtons location =" down "& gt; & lt; button onclick = "window.close ();" & gt; off & lt; / button and gt; & lt; / Supreme: pageBlockButtons & gt; & lt; sc: pageMessage severity = "error" force = "1" & gt; & Lt; Supreme: outputText value = "{! Error} "escape =" false "/>
Button
Derequisition "id" for ur url = "/ apex / read"; Occupancy Id} "var width =" 350 "; var height =" 350 "; window.open (url, '', 'scrollbars = no, resizable = no, status = no, toolbar = no, menubar = no, width =' + Width + ', height =' + height + ', left =' + ((window winner width - / width) + ', up =' + ((height height - / height) / 2));
Comments
Post a Comment