• aditya prasad
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 14
    Replies
Hello ,
 We are trying to access an external system accolade from salesforce.To access accolade We have aURL given and login can be done through SSO. For now I just have user name to acccess accolade but no password. I have written below code but seems not working and throwing error "Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found""
       AccoladeSetting1__c accolade = AccoladeSetting1__c.getorgDefaults();
        HTTP h = new HTTP();
        HTTPRequest r = new HTTPRequest();
        Blob headerValue = Blob.valueOf(accolade.UserName__c );
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        r.setHeader('Authorization', authorizationHeader);
        r.setMethod('GET');
        r.setTimeout(120000);
        
        String baseEndPoint = accolade.Endpoint__c;
        r.setEndpoint(baseEndPoint);
        HTTPResponse resp = new HTTPResponse();
        resp = h.send(r);

Note:-We have already whitelisted all the salesforce IPs.
Can someone suggest any other way to access SSO link of the external system through Rest API ?

Any help will be appreciated.
Hi, 
I want to read value from following XML tag which is self closed.
if I use gettext() always gets blank value.

XML Tag: <CurrentName i:nil="true"/>

Is there any way to get the exact value?

Thanks for your help
Regards,
Aditya
Hi,

We are getting the error  - "First error: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed" in a webservice callout to fetch data from an external system.

We were/are not having any manmaged SSL certifictes in our Org. What could be the issue?
Hi,
I need to read some data from an external site and once I get respnse, will update records based on the data.
My code:
         Accolade__c accoladeSettings = Accolade__c.getOrgDefaults();
         HTTP h = new HTTP();
         HTTPRequest r = new HTTPRequest();
         Blob headerValue = Blob.valueOf(accoladeSettings.Username__c + ':' + accoladeSettings.Password__c);
         
         String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
         system.debug('Authorization header'+headerValue);
         r.setHeader('Authorization', authorizationHeader);
         r.setMethod('GET');
         r.setTimeout(120000);
         String baseEndPoint = accoladeSettings.Url1__c;
         baseEndPoint +='9726'+accoladeSettings.Url2__c;
        
         r.setEndpoint(baseEndPoint);
         HTTPResponse resp = new HTTPResponse();
         resp = h.send(r);


But I get Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found" for  resp = h.send(r);
I have asked thirdparty to whitelist salesforce Ips. 
But is there any other way we can overcome this error. How to achieve same functionality using SOAP? I am unawarte of SOAP, any help is very much appreciated.

Thanks,
Aditya

Hi,
We have 2 objects:

Order and Order Line
We create an order and have the option of spliting order and corresponding order lines into different orders. Now splited orders become child to the Main order through self look up and the all child orders will have many corresponding oredr lines.
Whenever these child orederlines are updtaed, we need update the parent order as well as the Parent order lines.

Thanks in advance for your suggestions.

Thanks,
Aditya

Hi,

I have a button on case which calls a vf page and this vf will available only when some error occurs. Otherewise it directly create a child case using a controller. from action part of vf page.
But I want it should go to standard new page of a case from controller and parent case field should be populated with the casenumber from which I am trying to create a child case.

 pageRef = new PageReference ('/500/e?CFparent='+caseNumber+'&RecordType=01280000000HnUD');

I am using above code to for this. But I don't get desired result and it is being overidden by new button of case.
Any help on this.

Regards,
Aditya
Hi,

I want to open a dialogbox oncick of a textbox.But I get the error dialog is not a function in jquery.

<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
$(function() {
$('.quantityColumn input[type=text]').click(function() { alert('Hello'); $( "#dialog-form" ).dialog({ autoOpen: false }); $( "#dialog-form" ).dialog({ autoOpen: true }); }); });


But I get an error as typeerror $(...).dialog is not a function. I used jquery files from same version and also initializes dialog(), but still get the error. Where I am doing the mistake. Any help will be appreciated.
Regards, Aditya
I have created a custom link on case (say) which goes to a custom object Visit (say)records's edit page.In link i have used url which carries casenumber.
I have created a field Case Number on Visit Object. I want to save Case Number of the Case on Case Number field of Visit Object while creating Visit Record from Case.But I don't want to put the field on Page layout of Visit Object. 

If I don't put field on layout, after saving the record the field contains blank.
How to achieve this ? I don't want to go for vf for this small change.
I want to create pop up which will open if you click on a text box. On pop if I put any value and once click on save the same value should be populated on parent page according to option selected in pop up.
1)for all record 
2)For selected record.
I don't want to refresh the whole page. Just the text box value should be changed.
I think this can be achieved through javascript dont need to go for apex. once values display I can calculate in apex.
But need some help on this.
Below image can explain it in better way.

User-added image

Thanks for helping on this.
Hi,

I have a vf page where I am dynamically rendering opportunity Line Items. There is a limit of 250 line items can be visible at a time. For rest one link is there like next. To select all the records at a time I have created a checkbox, onclick it will select all the records. But it works for 250 records. If there are more than 250 records, then I have to press next link , the page refreshes and checkboxes for new records don't get ticked automatically. Again I have to tick select all checkbox. Same proble occurs also when I press previous link.
How is it possible to select all records at a time and retain the same even page refresshes. Any idea.

User-added image

Thanks.
Hi, 
I have created a detailed page link on case layout which will create a custom object record. I need to auto populate  Contact, Account from Case and Case Number from the case I am creating the record.

My url:
/a20/e?retURL={!Case.Id}&CF00N80000004W77Q={!Account.Name}&CF00N80000004W77Q_lkid={!Account.Id} 
&CF00N80000004W77T={!Contact.Name} 
&CF00N80000004W77T_lkid = {!Contact.Id}&RecordType=01280000000Hpwf 
&CF00N18000000dv5u = {!Case.CaseNumber}

I am able to populate contact and Account, but not the case. It always remains blank. But in url I can see the case id and number.
Am I doing any mistake here ?
Thanks
I want to insert attachments in attachment related list of Case whenever I send an outbound message with an attachment. Same attachment should be available in Attachment related list.

I created following trigger fi=or this.
trigger emailTrigger on EmailMessage (after insert)
for(EmailMessage em: Trigger.new)
    {
     emailmsgId = em.Id;
     
    }
    system.debug('setr'+emailmsgId);
    AttList = [select Id, ParentID,Name, body,ContentType,BodyLength from Attachment where ParentID =: emailmsgId];


I am getting correct Id when i check in debug. Bur i don't get any value for AttList. always return row 0. If I hardcode any Outbound message Id, I get the attachments associated with it if any.
Where I am doing the mistake any idea?

Thanks for your help.
Hi,

we have aprofile having view all permission on Case. But we want to restrict theview to users of that  profile for certain Case records.
Case OWD is private. 
How can this be achieved.?

Thanks in advance
Hi,
I have created a related list button. I need when I click the button it will open a page layout where few field will be auto populated.
Mu url for this is:
/a20/e?01I80000000taJd_lkid={!VisitReport__c.Id}
&RecordType=01I80000000taJd
&CF00N80000004W77T={!Contact.Name}
&CF00N80000004W77T_lkid={!Contact.Id}
&CF00N80000004W77Q={!Account.Name}
&CF00N80000004W77Q_lkid={!Account.Id}


I have too a lookup to same object Visit Report and field name is Parent Visit Report.I want this should populate too when I click on the buton.User-added image

I need to populate above three field. Where I am doing the mistake?

Thanks for helping
Hi,
I have developed a vf page which generates a report in word format. It displays all information related to specific object. I am trying to display some <apex:Outputtext> values in spanish, but actual value on object page layout is in englisg.
How this can be achived ?
ex:
<apex:outputText>INTERVENTION</apex:outPutText> should display on the report as INTERVENCIÓN

Thanks for your reply.
Is it possible to create record under Emails related list in a case record whenever send email from custom vf page using apex.User-added image
I need to insert ContactRole record for an opportunity while creating an opprtunity from some custom object.I have written a trigger i.e after insert on opportunity.

if (trigger.isinsert)
    {   
        oppty = trigger.new;

        for(opportunity Opt:oppty)
        {
    system.debug('Dealer'+Opt.Installed_Product__r.Dealer_1__c);
           if(Opt.Installed_Product__c !=null){
                system.debug('Method Entry');         OpportunityContactRole OCR1 = new OpportunityContactRole(ContactId=Opt.Installed_Product__r.Dealer_1__c, OpportunityId=Opt.Id,IsPrimary=TRUE);
                NewOppCRole.add(OCR1);
            }

But every time I get ContactId = null.So insertion failed since it is a mandatory field.
Is there any way to solve this issue?

Thanks in advance.
I want to create Activity History record in Case Related List after sending an email from a custom VF page. How is it possible?
I have created a link in Case which takes to a VF page from where you can send email to a Contact.I want to use all satndard email templates present within org to send email.Basically I need same functionalities to choose email templates as it works in Send Email(Standard Functionality). Is there any way to Achieve it?Plz help.
Hi,
I need to read some data from an external site and once I get respnse, will update records based on the data.
My code:
         Accolade__c accoladeSettings = Accolade__c.getOrgDefaults();
         HTTP h = new HTTP();
         HTTPRequest r = new HTTPRequest();
         Blob headerValue = Blob.valueOf(accoladeSettings.Username__c + ':' + accoladeSettings.Password__c);
         
         String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
         system.debug('Authorization header'+headerValue);
         r.setHeader('Authorization', authorizationHeader);
         r.setMethod('GET');
         r.setTimeout(120000);
         String baseEndPoint = accoladeSettings.Url1__c;
         baseEndPoint +='9726'+accoladeSettings.Url2__c;
        
         r.setEndpoint(baseEndPoint);
         HTTPResponse resp = new HTTPResponse();
         resp = h.send(r);


But I get Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found" for  resp = h.send(r);
I have asked thirdparty to whitelist salesforce Ips. 
But is there any other way we can overcome this error. How to achieve same functionality using SOAP? I am unawarte of SOAP, any help is very much appreciated.

Thanks,
Aditya
Hi,

I want to open a dialogbox oncick of a textbox.But I get the error dialog is not a function in jquery.

<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
$(function() {
$('.quantityColumn input[type=text]').click(function() { alert('Hello'); $( "#dialog-form" ).dialog({ autoOpen: false }); $( "#dialog-form" ).dialog({ autoOpen: true }); }); });


But I get an error as typeerror $(...).dialog is not a function. I used jquery files from same version and also initializes dialog(), but still get the error. Where I am doing the mistake. Any help will be appreciated.
Regards, Aditya
I want to create pop up which will open if you click on a text box. On pop if I put any value and once click on save the same value should be populated on parent page according to option selected in pop up.
1)for all record 
2)For selected record.
I don't want to refresh the whole page. Just the text box value should be changed.
I think this can be achieved through javascript dont need to go for apex. once values display I can calculate in apex.
But need some help on this.
Below image can explain it in better way.

User-added image

Thanks for helping on this.
Hi,

I have a vf page where I am dynamically rendering opportunity Line Items. There is a limit of 250 line items can be visible at a time. For rest one link is there like next. To select all the records at a time I have created a checkbox, onclick it will select all the records. But it works for 250 records. If there are more than 250 records, then I have to press next link , the page refreshes and checkboxes for new records don't get ticked automatically. Again I have to tick select all checkbox. Same proble occurs also when I press previous link.
How is it possible to select all records at a time and retain the same even page refresshes. Any idea.

User-added image

Thanks.
Hi,
I have developed a vf page which generates a report in word format. It displays all information related to specific object. I am trying to display some <apex:Outputtext> values in spanish, but actual value on object page layout is in englisg.
How this can be achived ?
ex:
<apex:outputText>INTERVENTION</apex:outPutText> should display on the report as INTERVENCIÓN

Thanks for your reply.
I need to insert ContactRole record for an opportunity while creating an opprtunity from some custom object.I have written a trigger i.e after insert on opportunity.

if (trigger.isinsert)
    {   
        oppty = trigger.new;

        for(opportunity Opt:oppty)
        {
    system.debug('Dealer'+Opt.Installed_Product__r.Dealer_1__c);
           if(Opt.Installed_Product__c !=null){
                system.debug('Method Entry');         OpportunityContactRole OCR1 = new OpportunityContactRole(ContactId=Opt.Installed_Product__r.Dealer_1__c, OpportunityId=Opt.Id,IsPrimary=TRUE);
                NewOppCRole.add(OCR1);
            }

But every time I get ContactId = null.So insertion failed since it is a mandatory field.
Is there any way to solve this issue?

Thanks in advance.
I have created a link in Case which takes to a VF page from where you can send email to a Contact.I want to use all satndard email templates present within org to send email.Basically I need same functionalities to choose email templates as it works in Send Email(Standard Functionality). Is there any way to Achieve it?Plz help.
Hi All,

When i click on any row using onrowclick function in apex:pageBlockTable. I am able to select the row using javascript functionality but i am not able to get the selected row data to from vf page to controller/avascript to populate selected row data in alert box.

Can any one help me How to get selected row data in controller? 

Please find the vfpage and controller

Visualforce Page
 
<apex:includeScript value="{!URLFOR($Resource.jquery,'/js/jquery-1.4.2.min.js')}" /> 
<script> $j = jQuery.noConflict(); 
var lastRow; 
var sample = document.getElementById('Name').value; 
var firstname1 = document .getElementById('{!$Component.form.pageBlockContact.Name}').value; 
function highlight(elem)
{ if(lastRow != undefined)
lastRow.style.backgroundColor = 'white';
elem.style.backgroundColor = 'yellow'; lastRow = elem;
alert('DDDD'+firstname1 );
alert('DDDDDDD'+sample); 
} 
</script>
<apex:form id="form"> 
<apex:pageBlock id="pageBlockContact"> 
<apex:pageBlockSection columns="1"> 
<apex:pageBlockTable value="{!list1}" var="item" rules="rows" id="example" onRowClick="clickElem(this);"> 
<apex:column value="{!item.Name}" id="Name" styleclass="name" /> 
</apex:pageBlockTable> 
</apex:pageBlockSection>
<apex:commandButton action="{!ok}" value="ok" /> 
</apex:pageBlock>
</apex:form>
</apex:page>

Controller
 
public class SampleController {

    public PageReference ok() {
        return null;
    
    }
    
    public List<Claims__c> list1 { get; set; }

   
    public SampleController ()
{
   list1 = [select id,name from claims__c];
}

}

Output: Based on above vf page and controller
User-added image
  • January 02, 2015
  • Like
  • 1