• Prakash Nawale
  • NEWBIE
  • 207 Points
  • Member since 2014
  • Salesforce Developer


  • Chatter
    Feed
  • 6
    Best Answers
  • 1
    Likes Received
  • 20
    Likes Given
  • 7
    Questions
  • 74
    Replies
Hi All,
Help me on this, i want using validation rule "Dealer user cannot save if the selected picklist value in Status field in "Inquiry" record type in Case is "Uploaded".
A mechanism which will update Hiring manager to a default Hiring manager (a generic contact) in case a position is created without any hiring manager

Hi, I'm not a Salesforce Developer but I'm working in apex code to automatically associate an entitlement to email-to case.

I found this code below, but I'm facing some problems

In line 5: Variable does not exist: contactIds
In line 25: Variable does not exist: accId

trigger DefaultEntitlement on Case (Before Insert) {
    List <EntitlementContact> entlContacts = 
                [Select e.EntitlementId,e.ContactId,e.Entitlement.AssetId 
                From EntitlementContact e
                Where e.ContactId in : contactIds
                And e.Entitlement.EndDate >= Today 
                And e.Entitlement.StartDate <= Today];
        if(entlContacts.isEmpty()==false){
            for(Case c : Trigger.new){
                if(c.EntitlementId == null && c.ContactId != null){
                    for(EntitlementContact ec:entlContacts){
                        if(ec.ContactId==c.ContactId){
                            c.EntitlementId = ec.EntitlementId;
                            if(c.AssetId==null && ec.Entitlement.AssetId!=null)
                                c.AssetId=ec.Entitlement.AssetId;
                            break;
                        }
                    } 
                }
            } 
        } else{
            List <Entitlement> entls = [Select e.StartDate, e.Id, e.EndDate, 
                    e.AccountId, e.AssetId
                    From Entitlement e
                    Where e.AccountId in :accId And e.EndDate >= Today 
                    And e.StartDate <= Today];
            if(entls.isEmpty()==false){
                for(Case c : Trigger.new){
                    if(c.EntitlementId == null && c.AccountId != null){
                        for(Entitlement e:entls){
                            if(e.AccountId==c.AccountId){
                                c.EntitlementId = e.Id;
                                if(c.AssetId==null && e.AssetId!=null)
                                    c.AssetId=e.AssetId;
                                break;
                            }
                        } 
                    }
                } 
            }
        }
    }
Greetings. I was hoping to gain some assistance with my Trigger. In the current stated the Trigger works; however, I want to account for the various formats of a website, i.e. www. or http:// or https://.  

Right now I am able to strip off the www. but I cannot figure out how to incorporate code to handle the other options. Can anybody provide assistance?
trigger FindDomain on Lead (before insert, before update) {

    // Populate list with of substring of company removing http(s):// or www.
    List<String> leadStr = new List<String>();
    
    for (Lead newLead : Trigger.new) {
        if(newLead.Website != NULL) {
            String s = newLead.Website.removeStartIgnoreCase('www.');
            leadStr.add(s);
            System.debug(leadStr);
        }
  	}
    
    List<Domain__c> domains = [SELECT Id,Name FROM Domain__c WHERE Name IN :leadStr];
    System.debug(domains);
	
    Map<String, Id> domainToLead = new Map<String, Id>();
    
    for (Domain__c dom : domains) {
		domainToLead.put(dom.Name, dom.Id);
        System.debug(domainToLead);
    }
    
    for (Lead l : Trigger.new) {
        
        if (l.Website != NULL) {
            
            l.Domain__c = domainToLead.get(l.Website.removeStartIgnoreCase('www.'));
            
        } else {
            
            l.Domain__c = NULL;
        }     
    }
}





 
I have a custom button created in the object called CM and this button execute javascript, content source is onclick javascript: Name of the button is Print and "Print_CM" here is a VF page. See below

CM_Status__c ,'Cancelled')} && !{!ISPICKVAL( Credit_Memo__c.SFCM_Status__c ,'Reversed')} && !{!ISPICKVAL( Credit_Memo__c.SFCM_Status__c ,'Disapproved')}) 

window.location.href = "https://" + window.location.host + "/apex/Print_CM?id=" + "{!Credit_Memo__c.Id}";
} else {
alert("Error: This Credit Memo cannot be printed.") 
}

Now I'm trying to add this button in my existing VF page and let's call it "CM View".

I'm trying to add it as  <apex:commandbutton but not sure how to do it. I know that I need to add something from the existing controller to call it in the CM View VF page, but I'm not sure how to do it well.

Any help will be much appreciated.

Thanks in advance guys :)
I have VF page with two pageBlockSections. I need to display it in Object page. But when Object type ->  'Single', only first pageBlockSections from VF page should be displayed in Object page. How can I do this?
Thanks!
  • September 19, 2017
  • Like
  • 1
We are doing Integration with external systems and unable to calcualte ds:DigestValue and ds:SignatureValue values
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1=".........." xmlns:v11="........">
  <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <wsu:Timestamp wsu:Id="TS-128F375C5B3256FAE8151780686184254">
        <wsu:Created>2018-02-05T15:07:42Z</wsu:Created>
        <wsu:Expires>2018-02-05T15:12:42Z</wsu:Expires>
      </wsu:Timestamp>
      <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-128F375C5B3256FAE8151780686183551"> ----
 --Certificate-</wsse:BinarySecurityToken>
      <ds:Signature Id="SIG-128F375C5B3256FAE8151780686183653" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
          <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
            <ec:InclusiveNamespaces PrefixList="wsa soap v1 v11" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
          </ds:CanonicalizationMethod>
          <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
          <ds:Reference URI="#id-128F375C5B3256FAE8151780686183652">
            <ds:Transforms>
              <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                <ec:InclusiveNamespaces PrefixList="soap v1 v11" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
              </ds:Transform>
            </ds:Transforms>
            <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
            <ds:DigestValue>--How to calcualte this?--</ds:DigestValue>
          </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue> --How to calcualte this?--</ds:SignatureValue>
        <ds:KeyInfo Id="KI-128F375C5B3256FAE8151780686183550">
          <wsse:SecurityTokenReference wsu:Id="STR-128F375C5B3256FAE8151780686183551">
            <wsse:Reference URI="#X509-128F375C5B3256FAE8151780686183549" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
          </wsse:SecurityTokenReference>
        </ds:KeyInfo>
      </ds:Signature>
    </wsse:Security>
    
  </soap:Header>



Please let me know how to get ds:DigestValue, ds:SignatureValue values and in which order we have to calculate.
We are doing integration system.

Genetated apex class from WSDL but the Salesforce not generated headers in apex class.
We would like to genrate apex class from below xml


<soap:Envelope>
<soap:Header>
<wsse:Security>
<wsu:Timestamp wsu:Id="TS-514E3D3C68172B39AB15136939170306">
 <wsu:Created>2017-12-19T14:31:57.030Z</wsu:Created>
 <wsu:Expires>2017-12-19T14:36:57.030Z</wsu:Expires>
 </wsu:Timestamp>
 <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-514E3D3C68172B39AB15136939169741">MIIFQjCCBCqgAwIBAgIQKxpfG5hlB/EAAAAAUNn04TANBgkqhkiG9w0BAQsFADCBujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSzAeFw0xNjEwMTExODM0MjZaFw0yMDAxMTAxOTA0MjVaMG0xCzAJBgNVBAYTAlVTMRQwEgYDVQQIEwtDb25uZWN0aWN1dDERMA8GA1UEBxMIU2ltc2J1cnkxEzARBgNVBAoTCldleCBIZWFsdGgxIDAeBgNVBAMTF0VWMVRlc3QubGgxb25kZW1hbmQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiBT+q3AnSDCuG+i9QzwTshWijjNtcbL8wCMhQcAg4cK/PxNq+QGpivDyMfvHOw18tbt4OCUqPPha1SJw1d1CWboSnnWaTFt31PzjQd0HgwUFgo+CdDGmcuweE8g83DtoCNNGE/i+VIWpca4OtdG/NPbeGkPX40MSrjCrpEKoiE8xevLiJ8G7WmvSGkTJKrvGn7NYwtHgTLS6El9r4atEm/oE3DwYRjhRAxUZ1661+jq8xGR5vQYnPHFr5w805E1EbCegmVAcZjZ1XqyR3Rky84U0sD0Q2CyZaNu60Y267/DuE+zQkAeO9PkqZWAIs/U1Prq2oky1R4656TYjJvasQIDAQABo4IBjjCCAYowDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3JsLmVudHJ1c3QubmV0L2xldmVsMWsuY3JsMEsGA1UdIAREMEIwNgYKYIZIAYb6bAoBBTAoMCYGCCsGAQUFBwIBFhpodHRwOi8vd3d3LmVudHJ1c3QubmV0L3JwYTAIBgZngQwBAgIwaAYIKwYBBQUHAQEEXDBaMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAzBggrBgEFBQcwAoYnaHR0cDovL2FpYS5lbnRydXN0Lm5ldC9sMWstY2hhaW4yNTYuY2VyMCIGA1UdEQQbMBmCF0VWMVRlc3QubGgxb25kZW1hbmQuY29tMB8GA1UdIwQYMBaAFIKicHTdvFM/z3vU981/p2DGCky/MB0GA1UdDgQWBBRbvjQ8/HY1vxLxXmN04FuJOA1wVjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCADauRcYorGJB2y0t6BBudIEm606fCEr1edyrh1+QhI72FKVslkdzl0p3ywHuUJGGgkOQJ068eiLmqnx+9Vl+dd+61nLd/CCEz5BFy6/aLMKIIw1mYQV+i+q1HX/a1BTV8AzNT7Af4H/5s0ZGqrQuEr9fsXNExb1F4bzb6tl7pfUtGFdx2S1/R3tF+6/IWAI3De6h8BKX4nuguwkX6PRpQ9w+hynWM6CqeCFimuc6itPlnfKvOGOjhgkGjjrUApA25Ot7EbhbDYtZ13mw2RGs2xDiUDHdrcGyt9hBOIuH4IoBQylwZrkTQ6IZa+NpwCH393AoKtL1+3KOAwN0WIfU6</wsse:BinarySecurityToken>
<ds:Signature Id="SIG-514E3D3C68172B39AB15136939170095">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
 <ec:InclusiveNamespaces PrefixList="wsa soap v1 v11"/>
 </ds:CanonicalizationMethod>
 <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#id-514E3D3C68172B39AB15136939170054">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
 <ec:InclusiveNamespaces PrefixList="soap v1 v11"/>
 </ds:Transform>
 </ds:Transforms>
 <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
 <ds:DigestValue>w+JlA7bnEuuCr8O3+vPmL6WAhmE=</ds:DigestValue>
 </ds:Reference>
 </ds:SignedInfo>
 <ds:SignatureValue>Hs2qwTEjcdHpUBfIKu41VTDJtK40R8D2stg4JUHrlon+sd9SUagOXIyws/6ZTKWQhG5UdgrnKXFv U03P3EgafUACjCcmohw6BT5hMQHkwxi3uG7veVBZscVA4O5cnlo/0WPx/vJMzusoPsNOAyUk0H9A /WcBK3goHpcJ77n/3YYWmlRW56wcw19ZDV+6vgnQ3sDrA1einQ9XqUeRiuN8pgAjpcT7S/Ckmvid RTzgP0CBPz0I1Gx596NsYrrz8yT59CPikeDQHfUDjg7gRjCpR5pLnWE584sipSLykghlzssqc9yF Xl75nu9MVwNsqFVJJSOVRQEcY2j/pQS3pZ0zZA==</ds:SignatureValue>
<ds:KeyInfo Id="KI-514E3D3C68172B39AB15136939170002">
<wsse:SecurityTokenReference wsu:Id="STR-514E3D3C68172B39AB15136939170023">
 <wsse:Reference URI="#X509-514E3D3C68172B39AB15136939169741" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
 </wsse:SecurityTokenReference>
 </ds:KeyInfo>
 </ds:Signature>
 </wsse:Security>
 <wsa:Action>http://services.lh1ondemand.com/hix/servicecontract/v1.0/DemographicService/AddConsumer</wsa:Action>
 <wsa:MessageID>uuid:67bb796f-36ee-494c-b620-de264428b55d</wsa:MessageID>
 <wsa:To wsu:Id="id-514E3D3C68172B39AB15136939170054">https://staginghixservice.lh1ondemand.com/v2_0/Demographic_V2_1.svc</wsa:To>
 </soap:Header>
 </soap:Envelope>
Hi Community,

We invites people from Chtter with email address and user accepts invitation salesforce sets "Chatter External User" Stanards profile to chatter user.
We would like to set custom chatter profile to invited chatter users instead of Stanard profile.

thanks in advance for your help
Hi Community,

We are building integration between Salesfoce and other system.

The other system has SOAP API to expose data and they implemented authication using certificates.

We genarateed class from WSDL. In the generated class system created three propeties clientCertName_x,clientCert_x and clientCertPasswd_x.

Steps we followed for Integration.

1. Created Self signed certificate in Salesforce Sandbox environment.
2. Downloaded Self signed certifation with .csr extension.
3. Sent that to third party and imported that in there system.

 We are sending certificate name in  clientCertName_x = 'abccertificate';

Then system throws error ""common.apex.runtime.impl.ExecutionException: Web service callout failed: WebService returned a SOAP Fault: An error occurred when verifying security for the message. faultcode=a:InvalidSecurity faultactor="|0x40aaa292"


Whenever we send clientCert_x from csr field then system throws error "System.CalloutException: Web service callout failed: clientCertPasswd_x can not be null"

I am not sure about the clientCertPasswd_x property. Can you please help me to resolve this issue.
We are building integration between Salesforce and Microsoft Office 365 to read email using javascript graph API.
It's working fine in standalone VF page but it fails when added as inline VF page in details pagelayout

We are getting below error message

Refused to display 'https://..............
response_mode=fragment' in a frame because it set 'X-Frame-Options' to 'deny'.

Any one could you please helps us to resovle this issue.

Thanks in advance
 
We building integration between Salesforce and PHP.
Build REST service in PHP to fetch data from MySQL database and return data in JSON format. It is working fine for first 2-3 Callouts then Salesforce shows us Gateway timeout Error in debug logs. We tested web-service with ARC,Postman,https://www.hurl.it/ many mores and it's working fine.
Below are the HTTP Request code.
Request
string searchText = 'buzz';
HttpRequest req = new HttpRequest();
req.setEndpoint('http://domainname.com/api/getQueryData.php?cachebuster=' + system.now().millisecond());
req.setMethod('POST');
req.setTimeout(30000);
req.setHeader('Accept', '*/*');
req.setHeader('Cache-Control', 'no-store');
req.setHeader('Content-Type','application/json');
string bodyReqeust = 'SELECT * FROM  tableName where '; 
bodyReqeust = bodyReqeust +' Name LIKE \'%'+searchText+'%\'';
bodyReqeust = bodyReqeust +' OR Description LIKE \'%'+searchText+'%\'';
bodyReqeust = bodyReqeust +' LIMIT 10';

map<string,object> mapRequest = new map<String,object>();
req.setBody(JSON.serialize(mapRequest));

Http http = new Http();
HTTPResponse res = http.send(req);
system.debug('res.getBody()::'+res.getBody());

Response :

System.HttpResponse[Status=Gateway Time-out, StatusCode=504] System.HttpResponse[Status=Gateway Time-out, StatusCode=504]"|0x207ad0fb


ERROR: The requested URL could not be retrieved http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License

body :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; } -->
"CacheHost: proxy-ord.net.salesforce.com
ErrPage: ERR_CONNECT_FAIL
Err: (110) Connection timed out
TimeStamp: Mon, 11 Sep 2017 12:13:02 GMT

ClientIP: 
ServerIP: 

HTTP Request:
POST /api/getQueryData.php?cachebuster=841 HTTP/1.1
Accept: */*
Cache-Control: no-store
User-Agent: SFDC-Callout/41.0
SFDC_STACK_DEPTH: 1
Content-Type: application/json
Pragma: no-cache
Host: domainname.com
Proxy-Connection: keep-alive
Content-Length: 138
X-Forwarded-For: 10.223.198.130
">support@salesforce.com</a>"

System.HttpResponse[Status=Gateway Time-out, StatusCode=504]

Can someone help Us?
We have created www.abc.com force.com site and we want to bind ssl certificate to force.com site, Please let me know how can I do this.
Thanks,
We building integration between Salesforce and PHP.
Build REST service in PHP to fetch data from MySQL database and return data in JSON format. It is working fine for first 2-3 Callouts then Salesforce shows us Gateway timeout Error in debug logs. We tested web-service with ARC,Postman,https://www.hurl.it/ many mores and it's working fine.
Below are the HTTP Request code.
Request
string searchText = 'buzz';
HttpRequest req = new HttpRequest();
req.setEndpoint('http://domainname.com/api/getQueryData.php?cachebuster=' + system.now().millisecond());
req.setMethod('POST');
req.setTimeout(30000);
req.setHeader('Accept', '*/*');
req.setHeader('Cache-Control', 'no-store');
req.setHeader('Content-Type','application/json');
string bodyReqeust = 'SELECT * FROM  tableName where '; 
bodyReqeust = bodyReqeust +' Name LIKE \'%'+searchText+'%\'';
bodyReqeust = bodyReqeust +' OR Description LIKE \'%'+searchText+'%\'';
bodyReqeust = bodyReqeust +' LIMIT 10';

map<string,object> mapRequest = new map<String,object>();
req.setBody(JSON.serialize(mapRequest));

Http http = new Http();
HTTPResponse res = http.send(req);
system.debug('res.getBody()::'+res.getBody());

Response :

System.HttpResponse[Status=Gateway Time-out, StatusCode=504] System.HttpResponse[Status=Gateway Time-out, StatusCode=504]"|0x207ad0fb


ERROR: The requested URL could not be retrieved http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License

body :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; } -->
"CacheHost: proxy-ord.net.salesforce.com
ErrPage: ERR_CONNECT_FAIL
Err: (110) Connection timed out
TimeStamp: Mon, 11 Sep 2017 12:13:02 GMT

ClientIP: 
ServerIP: 

HTTP Request:
POST /api/getQueryData.php?cachebuster=841 HTTP/1.1
Accept: */*
Cache-Control: no-store
User-Agent: SFDC-Callout/41.0
SFDC_STACK_DEPTH: 1
Content-Type: application/json
Pragma: no-cache
Host: domainname.com
Proxy-Connection: keep-alive
Content-Length: 138
X-Forwarded-For: 10.223.198.130
">support@salesforce.com</a>"

System.HttpResponse[Status=Gateway Time-out, StatusCode=504]

Can someone help Us?
We are doing Integration with external systems and unable to calcualte ds:DigestValue and ds:SignatureValue values
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1=".........." xmlns:v11="........">
  <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <wsu:Timestamp wsu:Id="TS-128F375C5B3256FAE8151780686184254">
        <wsu:Created>2018-02-05T15:07:42Z</wsu:Created>
        <wsu:Expires>2018-02-05T15:12:42Z</wsu:Expires>
      </wsu:Timestamp>
      <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-128F375C5B3256FAE8151780686183551"> ----
 --Certificate-</wsse:BinarySecurityToken>
      <ds:Signature Id="SIG-128F375C5B3256FAE8151780686183653" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
          <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
            <ec:InclusiveNamespaces PrefixList="wsa soap v1 v11" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
          </ds:CanonicalizationMethod>
          <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
          <ds:Reference URI="#id-128F375C5B3256FAE8151780686183652">
            <ds:Transforms>
              <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                <ec:InclusiveNamespaces PrefixList="soap v1 v11" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
              </ds:Transform>
            </ds:Transforms>
            <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
            <ds:DigestValue>--How to calcualte this?--</ds:DigestValue>
          </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue> --How to calcualte this?--</ds:SignatureValue>
        <ds:KeyInfo Id="KI-128F375C5B3256FAE8151780686183550">
          <wsse:SecurityTokenReference wsu:Id="STR-128F375C5B3256FAE8151780686183551">
            <wsse:Reference URI="#X509-128F375C5B3256FAE8151780686183549" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
          </wsse:SecurityTokenReference>
        </ds:KeyInfo>
      </ds:Signature>
    </wsse:Security>
    
  </soap:Header>



Please let me know how to get ds:DigestValue, ds:SignatureValue values and in which order we have to calculate.
is it possible to combine below two queries as one, where I need to display Case emails and comments in a page pertaining to a case order by createddate desc​
 
List <EmailMessage> sortedEmails = new List<EmailMessage>();
   
    sortedEmails = [SELECT Id, FromAddress, ToAddress, BCCAddress, MessageDate, Subject, HasAttachment, Incoming, TextBody, CreatedBy.Name 
            from EmailMessage where ParentId =: currentCase.Id 
            order by MessageDate DESC ];

List<CaseComment> Casecomments = new List<CaseComment>();
    Casecomments = [SELECT Id, CommentBody, CreatedDate, ParentId FROM CaseComment where ParentId =: currentCase.Id
            order by CreatedDate DESC];

 

Hi Team,

I am create the apex class for tracking the Quote.....
My Apex Class is
global with sharing class InvoicePdfWsSample {
    webService static String generateInvoicePdf(List<Id> oppsIdList) {
        try {
            final Set<Id> oppsId = new Set<Id>(oppsIdList);
            final String quoteTemplateDataViewerUrl = '/quote/quoteTemplateDataViewer.apexp?id={!QuoteId}&headerHeight=100&footerHeight=100&summlid=0EH0K0000034xt6';
            if (String.isBlank(quoteTemplateDataViewerUrl)) {
                String errorMsg = 'Invoice Template Id or Quote Template Data Viewer URL are blank, please review their values in Application Properties custom setting.'; 
                return errorMsg;
            }
            
            final List<QuoteDocument> attList = new List<QuoteDocument>();
            
            for (Opportunity opp : 
                [
                SELECT Id, 
                    (
                        SELECT Id, QuoteNumber, IsSyncing,Quote_Track__c,CreatedDate 
                        FROM Quotes 
                        ORDER BY CreatedDate 
                        DESC
                    ) 
                FROM Opportunity 
                WHERE Id IN :oppsId
                ]) 
            {
                if (opp.Quotes.isEmpty()) continue;
                Quote theQuote = null;
                for (Quote quoteAux : opp.Quotes) {
                    if (quoteAux.IsSyncing) {
                        theQuote = quoteAux;
                        break;
                    }
                }
                if (theQuote == null) theQuote = opp.Quotes.get(0);
                PageReference pageRef = new PageReference(
                    quoteTemplateDataViewerUrl.replace('{!QuoteId}', theQuote.Id)
                );
 
                attList.add(
                    new QuoteDocument(
                        Document = pageRef.getContent(),
                        QuoteId = theQuote.Id
                    )
                );
                 theQuote.Quote_Track__c= theQuote.Quote_Track__c+ 1;
                 update theQuote;
            }
 
            system.debug(attList);
            if (!attList.isEmpty()){
                 insert attList;
            }             
            return '';
        } catch (Exception e) { System.debug(LoggingLevel.ERROR, e.getMessage());  final String errorMsg = 'An error has occured while generating the invoice. Details:\n\n' + e.getMessage() + '\n\n' + e.getStackTraceString(); return errorMsg; }
    }
}


My Test Class
@isTest (SeeAllData=true)                    
public class InvoicePdfWsSampleTest
{
    static testMethod void TestMe()
    {
        List<Id> oidl = new List<Id>();
        List<Opportunity> ol = new List<Opportunity>([SELECT Id FROM Opportunity ORDER BY CreatedDate DESC LIMIT 10]);
        for (Opportunity o : ol){
            oidl.add(o.Id);
        }
        InvoicePdfWsSample.generateInvoicePdf(oidl);
        
    }

    }

I getting 69% Code coverage of the test class. How can i increase the code coverage?
 
Hello Developers,
I've a sandbox org where I cannot able to write triggers and apex classes. As they say, it is nt possible n production org but mine is sandbox. Can you please let me know the reason and steps to overcome that.

Thanks in advance
Sastri

Hi,

I do have a Test Class, which is failing. Can anyone help regarding the same. The error as below

Error : System.LimitException: Too many SOQL queries: 101

@isTest
public class RevenueWaterFallExt_Test {
    static testmethod void method1(){
        Account a = new Account();
        a.Name = 'ABC Test';
        a.BillingStreet = '1709 Long Prairie Rd';
        a.BillingCity = 'Allen';
        a.BillingState = 'TX';
        a.BillingCountry = 'USA';
        a.Website = 'http://www.yahoo.com';
        a.Industry = 'Cable';
        a.Vertical__c = 'Cable';
        insert a;
        List<Opportunity> oList = new List<Opportunity> {
            new Opportunity(Name ='00New mAWS Deal',
                            AccountID =a.id,
                            StageName = '7 - Won',
                            Amount = 3000,
                            Reason__c = 'Hehehe',
                            CloseDate = System.today(),
                            What_did_we_learn__c = 'What_did_we_learnnnnnnnn',
                            Contract_Term__c  = 5,
                            CYR__c = 11111,
                            TOB__c='Renewal'),
                new Opportunity( Name = '01mAWS Usage', 
                                AccountId = a.id,
                                StageName = '7 - Won',
                                CloseDate = System.today(),
                                TOB__c='Renewal',
                                Reason__c = 'Hahaha',
                                Contract_Term__c  = 5,
                                CYR__c = 11111,
                                What_did_we_learn__c = 'What_did_we_learnnnnnnnn',
                                Amount = 555888555)
                };
        insert oList;
                    
        Account_Plan__c ap = new Account_Plan__c(Name ='ABC Account Plan', Account__c = a.Id);
        insert ap;
        Revenue_Waterfall__c r = new Revenue_Waterfall__c();
        r.account_plan__c = ap.Id;
        insert r;
        
        Test.setCurrentPageReference(new PageReference('Page.RevenueWaterfallInput')); 
        System.currentPageReference().getParameters().put('apId', ap.Id);
        System.currentPageReference().getParameters().put('aId', a.Id);
        ApexPages.StandardController c = new ApexPages.StandardController(r);
        RevenueWaterFallExt h = new RevenueWaterFallExt(c);
        h.customSave();
        h.customCancel();
        
        h.revWater = new List<Revenue_Waterfall__c>();
        h.revWater.add(new Revenue_Waterfall__c());
        h.customSave();
    }
    
    static testmethod void soldBusinessMethod(){
        //insert Account
            Account a = new Account();
            a.Name = 'Test';
            a.BillingStreet = '1709 Long Prairie Rd';
            a.BillingCity = 'Allen';
            a.BillingState = 'TX';
            a.BillingCountry = 'USA';
            a.Website = 'http://www.yahoo.com';
            a.Industry = 'Cable';
            a.Vertical__c = 'Cable';
            insert a;
            
            // insert Vertical
            zVertical__c v = new zVertical__c();
            v.Name ='EMEA';
            insert v;
            
            //insert product
            Product2 prod = new Product2(Name = 'Laptop X200', Family = 'Hardware');
            insert prod;
            
            //insert PriceboolEntry
            Id pricebookId = Test.getStandardPricebookId();
            PricebookEntry standardPrice = new PricebookEntry(Pricebook2Id = pricebookId, Product2Id = prod.Id,
                                           UnitPrice = 10000, IsActive = true);
            insert standardPrice;
            
            Opportunity opp = new Opportunity();  
            opp.Name = 'Test';
            opp.StageName = '1 - Prospect';
            opp.CloseDate = System.Today();
            opp.Projected_Revenue_Start_Date__c = System.today();
            opp.Training_Start_Date__c = System.today();
            opp.contract_term__c = 1;
            opp.tob__c = 'New'; 
            opp.vertical__c = v.Id;
            opp.AccountId = a.Id;
            opp.Product_1__c = prod.id;
            opp.AACV__c = 1.0;
            opp.ETCV__c = 1.0;
            opp.x2017__c = 1.0;
            opp.Product_1_Allocation__c = 100;
            insert opp;
            
            Account_Plan__c ap = new Account_Plan__c(Name ='ABC Account Plan', Account__c = a.Id);
            insert ap;
            
            Revenue_Waterfall__c r = new Revenue_Waterfall__c(account_plan__c = ap.Id,name='Sold Business');
            insert r;
            
            opp.StageName = '3 - Discovery';
            update opp;
            
            opp.StageName ='6 - Close/Verbal Award';
            update Opp;
            
            opp.StageName ='7 - Won';
            opp.Reason__c = 'test';
            opp.What_did_we_learn__c = 'not sure';
            opp.Won_by__c = 'ABC Corp';
            update Opp;
    }
}
 

 

Hi all,

I'm using VisualForce for an intake survey. The first part of it is relatively easy. This is the code for First Name.

<apex:inputfield value="{!Contact.FirstName}" />

However, I can't find any guidance on how to ask a yes or no question in the intake. I would want to limit it to yes or no. Not allow anything else like "working on it" or "almost."

Anyone know of a possible answer?
If there is a post out there that covers this specifically, feel free to point me in that direction. I've researched the tar out of this one.

I need to update a picklist with a trigger using a value that is already a global value, not inserting a new value. The picklist gives me dates in this format:

2018 - 2019
2016 - 2017
etc.

I want the trigger to update a picklist value that is '2016 - 2017' to '2018 - 2019' after the record is saved. Originally, I was thinking that Apex might treat these values as an array and I could iterate from [0] to [1] etc. I don't see this capability baked into any code out there. I'm aware of the getPickListValue(), but this method seems to be used for value insertion or detection, not update.

Is this type of updating possible in Apex? If so, how? If not, are there Salesforce tools I can use to essentially tell the system ' on selection of this boolean field, after a save, update the picklist value to the next in the sequence' - as we're never going to skip years on this update. This picklist exists to place opportunities into a consecutive fiscal year.

Thanks All.
Although it had been working and accepting registrations off our website, now the VF page renders a validation error message when user attempts to register.  I cheked to ensure all fields in the relevant objects were set to Read/Write for Guest user - yet no chnage in the outcome.
I am trying to change the text color on a visualforce page to one of four colors based on data contained in a field.  The code is below.  I have looked at similar posts but have not been successful. I would appreciate any help you could provide.

<apex:repeat value="{!wrappedSystems}" var="s">
                                <tr class="linkable">
                                    <input type="hidden" class="id" data-type="system" data-id="{!s.sys.Id}" />
                                    <td><c:RC_Donut theName="{!s.sys.Id}" percent="{!s.batRemaining}" /></td>
                                    <td>{!s.sys.System_Name__c}</td>
                                    <td><center><font color = "{if({!s.sys.Operational_Status_Color__c}='Red',#FF0000, if({!s.sys.Operational_Status_Color__c}='Yellow',#FFF000, if({!s.sys.Operational_Status_Color__c}='Green',#01DF01,#808080)))}">{!s.sys.Operational_Status__c}</font></center></td>
                                    <td>{!s.sys.Status__c}</td>
                                    <td>{!s.sys.System_City__c}, {!s.sys.System_State__c}</td>
                                </tr>
                            </apex:repeat>


  • December 27, 2017
  • Like
  • 1
Hi All,

As i`ve been new to salesforce , i`ve been learning on my own 
i encountered a problem trying to make own serach bar using visualforce . the code was accepted error free , but it`s not working 
The idea is to search a name and you`ll get his address as a return

Visualforce Page:
<apex:page controller="Ctrl_ContactSearch">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Search" action="{!searchContacts}" reRender="contact-table" />
            </apex:pageBlockButtons>

            <apex:pageBlockSection id="contact-table" columns="1">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Name" />
                    <apex:inputText value="{!name}" />
                </apex:pageBlockSectionItem>

             

                <apex:pageBlockTable value="{!contacts}" var="c">
                    <apex:column >
                        <apex:facet name="header">Name</apex:facet>
                        {!c.Name}
                    </apex:column>

                    <apex:column >
                        <apex:facet name="header">Mailing State</apex:facet>
                        {!c.MailingState}
                    </apex:column>
                    
                     <apex:column >
                        <apex:facet name="header">Mailing Street</apex:facet>
                        {!c.MailingStreet  }
                    </apex:column>
                    
                    <apex:column >
                        <apex:facet name="header">Mailing City</apex:facet>
                        {!c.MailingCity}
                    </apex:column>
                    
                    <apex:column >
                        <apex:facet name="header">Mailing Country</apex:facet>
                        {!c.MailingCountry}
                    </apex:column>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


Apex Contoller :

public with sharing class Ctrl_ContactSearch
{
    public List<Contact> contacts { get; set; }
    public String name { get; set; }
    public String mailingState { get; set; }
     public String mailingStreet { get; set; }
      public String mailingCity { get; set; }
       public String mailingCountry { get; set; }

    public Ctrl_ContactSearch()
    {
        contacts = new List<Contact>();
    }

    public PageReference searchContacts()
    {
        contacts = [select Id
                          ,Name
                          ,MailingState ,
                          MailingStreet,
                          MailingCity,
                          MailingCountry
                     from Contact 
                    where Name = :name and
                    MailingState = :mailingState and
                   MailingStreet = :mailingStreet and
                   MailingCity = :mailingCity and
                   MailingCountry = :mailingCountry];
        return null;
    }
}
Hi , 

I have overriden the new page for a custom object using vf page and populating the parent id in one of the fields, which is working as expected.
However, when the user clicks Save & New button from edit page, the parent id is not getting populated. Any idea on how to populate this?

This is how my controller looks like:

       res = (childobject__c)controller.getRecord();
        res.Status_TVNA__c='text';
        m_sc=controller;
        if(ApexPages.currentPage().getParameters().get('parentObject__c')!= null)
        res.parentObject__c=ApexPages.currentPage().getParameters().get('parentObject__c');
        
Hi All,

I am working on a project and in the data model i can see "Created By and Last modified By" for some objects and "Created By, Last modified By and Owner name" for some objects(all are standard fields). May i ask you that on what basis are the owner fields added?(In general context)

Thanks and Regards,
Bharath Kumar M
Hello. I need your help.
I have 2 standard objects (Accounts and Users) and the Territory object. Accounts and Users have a lookup to the Territory. I need to display the user only accounts from his territory. How correctly to setup sharing rules?
Thank you
Hi folks,

i want write php due to apex with @RemoteAction ..getting error .
code is below --2 code for refernce 
please help me out asap
1st--
public function setExShowroomPrice ()
    {
        $manufacturer = $this->input->post('old_car_manufacturer');
        $model = $this->input->post('old_car_model');
        $variant = explode('@@', $this->input->post('old_car_modeltype'));
           $model_type = $variant[0];
           $fuel_type = $variant[1];
        $result = $this->cardata_model->get_used_car_det($manufacturer,$model,$model_type,$fuel_type,$_SESSION['dlrid']);
        
        if (is_array($result))
        {
            $_SESSION['old_ex_showroom_price'] = $result['ex_showroom_price'];
            $var_price = array("ex_showroom_price"=>$result['ex_showroom_price'],"fuel_type"=>$result['fuel_type']);
            echo json_encode($var_price);
        }
    }
    
    ---------------------
2nd---
function get_used_car_det($manufacturer,$model,$model_type,$fuel_type,$dealer_id)
    {
        $conditions = array(
            'manufacturer' => $manufacturer,
            'model' => $model,        
            'model_type' => $model_type,
            'fuel_type'=>$fuel_type,
            'city'=>$_SESSION['dlr_city']
        );
        $this->db->select('*');
        $this->db->where($conditions);
        $query = $this->db->get('old_cars');
        //echo $this->db->last_query();
        if ($query->num_rows() > 0) return $query->row_array();
        else return false; 
       
    }

===================
this is mine code 
global with sharing class ExchangeRemoter {

    public static string manufacturer {get; set;}
   //public static jud_old_car {get;set;}
   public static list<jud_old_cars__c> oldCar {get; set;}
   public Map<String, String> showrooms {get; set;}
    
    
    public ExchangeRemoter() {
        
    }
    
    @RemoteAction
    global static list<Map<string, string>> get_car_manufacturer(){
        list<Map<string, string>> oldCarList = new list<Map<String, String>>();
        AggregateResult[] groupedResults = [Select manufacturer__c from jud_old_cars__c group by manufacturer__c];
        system.debug(groupedResults);
        
        for(AggregateResult ar : groupedResults){
                
           oldCarList.add(new Map<String, String> { 
                                                     'value'=>String.valueof(ar.get('manufacturer__c')),
                                                     'label'=>String.valueof(ar.get('manufacturer__c'))
                                                 });  
     
        }   
      
        return oldCarList;
    }
    
    @RemoteAction
    global  static list<Map<string, string>> get_model(String manufac){
        list<Map<string, string>> carmodels = new list<Map<String, String>>();    
        AggregateResult[] groupedResult = [Select model__c from jud_old_cars__c where manufacturer__c =: manufac group by model__c];
        for(AggregateResult cm : groupedResult){
            carmodels.add(new Map<String, String> { 
                                                     'value'=>String.valueof(cm.get('model__c')),
                                                     'label'=>String.valueof(cm.get('model__c'))
                                                 });   
        }
        return carmodels;
    }
    
    @RemoteAction
    global static list<Map<string, string>> get_variant(string model){
      
        list<Map<string, string>> oldVariantList = new list<Map<String, String>>();
        AggregateResult[] groupedResults = [Select model_type__c, fuel_type__c
                                            from jud_old_cars__c
                                            where model__c=: model
                                            group by model_type__c, fuel_type__c];
        
        for(AggregateResult ar : groupedResults){
                
           oldVariantList.add(new Map<String, String> { 
                                                     'value'=>String.valueof(ar.get('model_type__c'))+ '@@'+ String.valueof(ar.get('fuel_type__c')),
                                                     'label'=>String.valueof(ar.get('model_type__c'))+ ' ' + String.valueof(ar.get('fuel_type__c'))
                                                 });  
     
        }   
      
        return oldVariantList;
    }
  
    @RemoteAction
     global static list<Map<string, string>> setExShowroomPrice(Map<String, String> showrooms){
       list<Map<string, string>> carmodelsprice = new list<Map<String, String>>(); 
       List<String> models = new List<String>(); 
        
        String Exshoroom;
        Integer showroompri = Integer.valueOf(showrooms.get('showroompri'));
        String manufacturer = showrooms.get('manufacturer');
        String mode = showrooms.get('model');
        String  variant = showrooms.get('variant');
         
         AggregateResult[] groupedResults = [Select manufacturer__c,model__c,fuel_type__c from jud_old_cars__c]
        list<Map<string, string>> oldVariantList = new list<Map<String, String>>();
                 
        for(AggregateResult sesp : groupedResults){
        
                carmodelsprice.add(new Map<String, String>{
            
                }
    }
        ExShowroomPriceList.add(new Map<String, String> {  
                                                    'manufacturer'=>oldCarList.manufacturer__c,
                                                    'model'=>carmodelsprice.model__c,                                                                   
                                                    'variant'=>carmodelsprice.variant__c,
                                                    'model_type'=>carmodelsprice.model_type__C,
                                                    'fuel_type'=>carmodelsprice.fuel_type__c,
                                                                                                                                                           
                                                  });
              }
    
    return carmodelsprice;
}
}
.help me out friend
Greetings. I was hoping to gain some assistance with my Trigger. In the current stated the Trigger works; however, I want to account for the various formats of a website, i.e. www. or http:// or https://.  

Right now I am able to strip off the www. but I cannot figure out how to incorporate code to handle the other options. Can anybody provide assistance?
trigger FindDomain on Lead (before insert, before update) {

    // Populate list with of substring of company removing http(s):// or www.
    List<String> leadStr = new List<String>();
    
    for (Lead newLead : Trigger.new) {
        if(newLead.Website != NULL) {
            String s = newLead.Website.removeStartIgnoreCase('www.');
            leadStr.add(s);
            System.debug(leadStr);
        }
  	}
    
    List<Domain__c> domains = [SELECT Id,Name FROM Domain__c WHERE Name IN :leadStr];
    System.debug(domains);
	
    Map<String, Id> domainToLead = new Map<String, Id>();
    
    for (Domain__c dom : domains) {
		domainToLead.put(dom.Name, dom.Id);
        System.debug(domainToLead);
    }
    
    for (Lead l : Trigger.new) {
        
        if (l.Website != NULL) {
            
            l.Domain__c = domainToLead.get(l.Website.removeStartIgnoreCase('www.'));
            
        } else {
            
            l.Domain__c = NULL;
        }     
    }
}





 

Hi,

I have followed several different solutions to this step, but still, I am recieving this error: 

"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, error: [Name]"

Has anyone got any ideas on how to solve this? 

Please let me know what you need of information from this. I have the following validation rules on opportunity object :
"Approved field validation": 
AND( 
ISCHANGED(Approved__c), 
OR( 
$Profile.Name <> 'System Administrator', 
$Profile.Name <> 'Custom: Sales Profile' 

)

High Value Opportunity Validation:

AND( 
IsClosed = TRUE, 
Amount > 100000, 
Approved__c <> TRUE 
)


As part of an SOAP integration I'm doing. I've requirement where I need to pass the BinarySecurityToken in the header of the SOAP request. Unfortunately the WSDL will not contain the header information, so wsdl2apex convertor will not generate the associated Header classes.I've included the below snippet which is not working and erroring out as 'System.CalloutException: IO Exception: input contained no data'

I've added below two classes in the Webservice stub class that's generated-

    public class Security_element{ 
        public Security_element(String securityToken){
            this.securityToken = new BinarySecurityToken_element(securityToken);
            this.wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
        }
        
        public BinarySecurityToken_element securityToken;
        public String wsse;
        private String[] wsse_att_info = new String[] {'xmlns:wsse'};
        private String[] securityToken_type_info = new String[]  {'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};
    }
    
    public class BinarySecurityToken_element {
    
        public BinarySecurityToken_element(String securityToken) { 
             this.securityToken=securityToken;
             this.myValueType='wsse:X509v3';
             this.myEncodingType='wsse:Base64Binary'; 
             this.myID='X509Token';
        }
        public String securityToken;
        public String myValueType;
        public String myEncodingType;
        public String myID;
        
        private String[] securityToken_type_info = new String[]{'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};   
        private String[] myValueType_type_info=new String[]{'ValueType'};
        private String[] myEncodingType_type_info=new String[]{'EncodingType'};
        private String[] myID_type_info=new String[]{'Id'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};              
    }

******************This will go to class that makes the callout*************************

List docList = [select id, name,Body from document where name = 'secToken.txt']; //Docuement contains the security token I need to pass in the header
public wsSampleProjectV1.Security_element sec = new wsSampleProjectV2.Security_element(EncodingUtil.base64Encode(docList[0].body));
private String sec_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; 

*********SOAP Request Header that I need to pass is -

  <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:BinarySecurityToken ValueType="wsse:X509v3" EncodingType="wsse:Base64Binary" Id="X509Token">
                ---Encoded BinarySecurityToken goes here------
 
         </wsse:BinarySecurityToken>
      </wsse:Security>
      
   </soapenv:Header>

Any help on what's going wrong is much appreciated.
Although it had been working and accepting registrations off our website, now the VF page renders a validation error message when user attempts to register.  I cheked to ensure all fields in the relevant objects were set to Read/Write for Guest user - yet no chnage in the outcome.
I am trying to change the text color on a visualforce page to one of four colors based on data contained in a field.  The code is below.  I have looked at similar posts but have not been successful. I would appreciate any help you could provide.

<apex:repeat value="{!wrappedSystems}" var="s">
                                <tr class="linkable">
                                    <input type="hidden" class="id" data-type="system" data-id="{!s.sys.Id}" />
                                    <td><c:RC_Donut theName="{!s.sys.Id}" percent="{!s.batRemaining}" /></td>
                                    <td>{!s.sys.System_Name__c}</td>
                                    <td><center><font color = "{if({!s.sys.Operational_Status_Color__c}='Red',#FF0000, if({!s.sys.Operational_Status_Color__c}='Yellow',#FFF000, if({!s.sys.Operational_Status_Color__c}='Green',#01DF01,#808080)))}">{!s.sys.Operational_Status__c}</font></center></td>
                                    <td>{!s.sys.Status__c}</td>
                                    <td>{!s.sys.System_City__c}, {!s.sys.System_State__c}</td>
                                </tr>
                            </apex:repeat>


  • December 27, 2017
  • Like
  • 1
Hi All,

I am working on a project and in the data model i can see "Created By and Last modified By" for some objects and "Created By, Last modified By and Owner name" for some objects(all are standard fields). May i ask you that on what basis are the owner fields added?(In general context)

Thanks and Regards,
Bharath Kumar M
where u seen test classes code coverage
Hi All,
Help me on this, i want using validation rule "Dealer user cannot save if the selected picklist value in Status field in "Inquiry" record type in Case is "Uploaded".
Static variable is not retaining its value

public class trial {
        Integer x=0;
        static Integer y=0;
    public void setX(Integer i){
        x=i;
    }
    
    public Integer getX(){
        return x;
    }
    
    public pageReference ChangeValue(){
        //action
        System.debug('action x - '+x+' to '+(++x)+' and y - '+y);
        return null;
    }
    
    public void getChangeValue(){
        //oclick
        if(y==0){System.debug(this+' onclick y - '+y+' to '+(++y)+' & x - '+x+' to '+(++x));return;}
        System.debug(this+' onclick x - '+x+' to '+(++x)+' and y - '+y);
        
    }
   
}
------------------------------------------------------------------------------------------------------------------------------------------------------

When page loads, onClick is run automatically, why?? but anyways it should set the value for static y=1, i.e. next time after "if" statements should run
it debugs as "y=0 to y=1"
then when i click the button it again debugs as "y=0 to y=1" i.e. the class isn't retaining Static variable's value, but would work/retain-its-value if i remove STATIC KEYWORD from defination. i.e. make it an instance variable instance
but, with static, it debugs as "y=0 to y=1" every time i click the button, though it should have been set as right after the first debug
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
VF:-
<apex:page controller="trial">
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"/>
    <apex:form >
              <apex:commandButton value="Change and Set Value" onClick="{!changeValue}" action="{!changeValue}"/>
    </apex:form>
    <script>
    var x;
    function setValue(){
    var op=$("label[id$='oplbl']"); 
        x ='{!X}';
        alert('x - '+x);
        op.text(x+'');
        return x;
    }
    </script>
</apex:page>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

X IS INSTANCE VAR AND  Y IS STATIC Var
AFTER PAGE LOADS, ON CLICK METHOD RUNS BY ITSELF:-
13:08:52:009 USER_DEBUG [20]|DEBUG|trial:[x=0, y=0] onclick y - 0 to 1 & x - 0 to 1

WHEN I CLICK:-
13:10:13:009 USER_DEBUG [14]|DEBUG|action x - 1 to 2 and y - 0
13:10:13:013 USER_DEBUG [20]|DEBUG|trial:[x=2, y=0] onclick y - 0 to 1 & x - 2 to 3   //second execution for onclick method must have the y's value=1, but it rather preserves x's value

WHEN I CLICK AGAIN:-
13:14:17:009 USER_DEBUG [14]|DEBUG|action x - 3 to 4 and y - 0
13:14:17:013 USER_DEBUG [20]|DEBUG|trial:[x=4, y=0] onclick y - 0 to 1 & x - 4 to 5
product table
hello 
i need to display this table on vf page on a button click which is inside of an opportunity record.
plz help me with code.
We have exceeded our API Requests Limit

Which Program is causing the API Request to exceed the limit?
Hello. I need your help.
I have 2 standard objects (Accounts and Users) and the Territory object. Accounts and Users have a lookup to the Territory. I need to display the user only accounts from his territory. How correctly to setup sharing rules?
Thank you

Hi All,

Following is my data model :

Event (Custom) ---> Child--->Grandchild

My requirement is to send an email alert to a user in a lookup of grandchild WHEN either a "Parent,Child or Grandchild is updated".
Any help on achieving this with a single trigger/workflow is greatly appreciated.(I believe we need to use more than one trigger /workflow for this)
 

hi
Update the Shipment Status field to “Delayed” if a shipment has exceeded the expected delivery date and not reached the customer.

I want to restrict all users, except admins, to our "Line of Sight - 10%" opportunity stage. Stated differently, "Line of Sight - 10%%" is the only opportunity stage a user should be able to set their opportunity to unless they're an admin. I've written the following rule. It allows admins to set to any stage like it should. However, it prevents everyone else from setting any opportunity stage. Meaning, users can't set the opportunity stage to "Line of Sight - 10%" like they should be able to. They also can't set it to any other stage but that is correct. Any idea what I'm missing?
 

AND(
	OR(
	ISNEW()
	ISCHANGED(StageName)),
	NOT(ISPICKVAL(StageName, "Line of Sight - 10%")),
	$Profile.Name <> "Admin")
Thank you,
Nick
How do i access Api (public rest api , no need acsess token ) form postmen or runscope. but i woks in workbench 
It showing an error  invalid session id . It works in production not in sanbox 
  • November 07, 2017
  • Like
  • 1
Greetings. I was hoping to gain some assistance with my Trigger. In the current stated the Trigger works; however, I want to account for the various formats of a website, i.e. www. or http:// or https://.  

Right now I am able to strip off the www. but I cannot figure out how to incorporate code to handle the other options. Can anybody provide assistance?
trigger FindDomain on Lead (before insert, before update) {

    // Populate list with of substring of company removing http(s):// or www.
    List<String> leadStr = new List<String>();
    
    for (Lead newLead : Trigger.new) {
        if(newLead.Website != NULL) {
            String s = newLead.Website.removeStartIgnoreCase('www.');
            leadStr.add(s);
            System.debug(leadStr);
        }
  	}
    
    List<Domain__c> domains = [SELECT Id,Name FROM Domain__c WHERE Name IN :leadStr];
    System.debug(domains);
	
    Map<String, Id> domainToLead = new Map<String, Id>();
    
    for (Domain__c dom : domains) {
		domainToLead.put(dom.Name, dom.Id);
        System.debug(domainToLead);
    }
    
    for (Lead l : Trigger.new) {
        
        if (l.Website != NULL) {
            
            l.Domain__c = domainToLead.get(l.Website.removeStartIgnoreCase('www.'));
            
        } else {
            
            l.Domain__c = NULL;
        }     
    }
}





 

Hey there im creating a webform with visual workflow
There is this field where i need the attentant to fill in a number between 1 and 999999 there should be no spaces allowed. so input 12 435 should not be allowed

Does anyone know the correct Regex for this in visual workflow ?

Hello, I am receiving the Error "system.limitexception too many future calls 51" when I Inserted 300+ records in our Org. I would like an assistance to get around this Error. I hope someone can help here.. I am new to Apex Code for Callouts.. Here's my code.


TRIGGER:

trigger SG_ContactTriggers on Contact (after insert) {

    //TriggerHandler
    TriggerHandlerREST handler = new TriggerHandlerREST();
    
    if(trigger.isAfter){
        handler.UPDATE_CONTACT_ADDRESS(trigger.new);
    }
}


And Here's my CLASS​

public class TriggerHandlerREST {
    //GET GEOCODE METHOD
    public void UPDATE_CONTACT_ADDRESS(List<contact> newContacts){
        
        List<contact> contactsToUpdate = new List<contact>();
        for(contact contacts : [select id, MailingPostalCode from contact where id in: newContacts]){
            
        	GET_GEOCODE(contacts.MailingPostalCode,contacts.id);
        
        }
    }
    
    @future(callout=true)
    public static void GET_GEOCODE(String POSTAL_CODE,string contactID){
        
        contact con = [select id,MailingCity,MailingState,MailingCountry from contact where id =:contactId];
        
        
        String ENDPOINT = 'https://maps.google.com/maps/api/geocode/json?key=AIzaSyAGXR9Ybwo_YxMQvyb-XRP_36fT5_wkeFU&components=country:AU|postal_code:'+POSTAL_CODE+'&sensor=false';
            try{
                HTTPRequest request = new HTTPRequest();
                request.setEndpoint(ENDPOINT);
                request.setHeader('Content-Type', 'application/json');
                request.setMethod('GET');
                
                HTTP http = new HTTP();
                HTTPResponse  response =  http.send(request);
                
                GeoCodeResult geo =(GeoCodeResult)JSON.deserialize(response.getBody(),GeoCodeResult.class);
                
                if(geo.status == 'OK'){
                for(Results results : geo.results){
                    for( Address_components address : results.address_Components){
                        if(address.types.get(0)=='locality'){con.MailingCity=address.long_name;}else if(address.types.get(0)=='administrative_area_level_1'){con.MailingState=address.long_name;}else if(address.types.get(0)=='country'){ con.MailingCountry=address.long_name; }
                    }
                }
                    update con; //UPDATE THE CONTACT
                    
                } else { system.debug('@NUR results === '+geo.status);}
   				
            }catch(Exception e){
               String errorMessage='';
               errorMessage=e.getMessage();
               errorMessage+= ' ::: inside updateAddressByGeocode.getUserByEmail(string email)  ....';
            }
    }
    
    /////HELPER CLASS
    public class GeoCodeResult {
        public List<Results> results;
        public String status;

    }
    
    public class Address_components {
        public String long_name;
        public String short_name;
        public List<String> types;
    }
    
    public class Results {
        public List<Address_components> address_components;
    }
}


Thank you so much in Advance!

I have a validation rule that prevents a community user from creating a case if he has yet to qualify 2 or more previous cases (this is a way to measure the quality of the service). However, the validation rule marks the error until the user tries to save, and that is not the operation I want .... I would like that whenever a user has 2 or more cases without qualifying, it prevents the creation of cases , that is to say, that it does not have the possibility to fill any field until it responds the cases that it has pending to qualify.

P.S. sorry if my English is not very good, it is not my native language and I use an automatic translator to ask this question.

Thank you!

Can somebody please tell me that what is SingleEmailMessage in "Messaging.SingleEmailMessage".
I have uderstood that Messaging is a class but I haven't understood what is SingleEmailMessage. Is it a static method or innerclass or what?
I have VF page with two pageBlockSections. I need to display it in Object page. But when Object type ->  'Single', only first pageBlockSections from VF page should be displayed in Object page. How can I do this?
Thanks!
  • September 19, 2017
  • Like
  • 1