• App Shark
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
When writing script and navigating it to detailed page I am getting an below error.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://sateeshsfdev-dev-ed.lightning.force.com') does not match the recipient window's origin ('https://sateeshsfdev-dev-ed--c.ap2.visual.force.com').

 Code.
<script src="/soap/ajax/33.0/connection.js" type="text/javascript"></script>
    <script type="text/javascript">
    function navigateToDetailPage() {
        alert('--hi--');
        if( (typeof sforce.one != 'undefined') && (sforce.one != null) ) {
             sforce.one.navigateToSObject('00628000006YM8I');
        }
    }
</script>

Button:

<apex:commandLink value="SUBMIT" onclick="navigateToDetailPage();"/>
 
Hi All,

I want to change my schema from Master detail to look Up relation ship.I have the following question.

1) Do any of the data get affected
2) what would be the owner Id of the child record once it is changed to look up
 
Hi 

What would be the account owner when a salesforce record is created through other system by an api call.
The other system creates a record with one the user profile in salesforce
Below are the class, Pgae, Button I am using .
CLASS:

public class PrintStandardLabel
{
  public list<zkfedex__Shipment__c> Shipmentlist {get;set;}
  public list<Attachment> lstAttachment {get;set;}
  public String currentRecordId ='';
  public string ShipmentID = '';
  public  PrintStandardLabel(){
    currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
    system.debug(':::::currentRecordId'+currentRecordId);
    Shipmentlist = new list<zkfedex__Shipment__c>();
    lstAttachment = new list<Attachment>();
    if(currentRecordId != null && currentRecordId != ''){
     Shipmentlist = [Select zkfedex__RecipientLead__c, Name, Id, CreatedDate From zkfedex__Shipment__c WHERE zkfedex__RecipientLead__c =:currentRecordId ORDER BY CreatedDate DESC];
    }
    system.debug('::::ShipmentID'+ShipmentID);
    if(Shipmentlist != null && Shipmentlist.size()>0){
        lstAttachment = [Select ParentId,OwnerId,Name,Id,Description,CreatedDate,ContentType,BodyLength,Body From Attachment WHERE ParentId =: Shipmentlist[0].Id ORDER BY CreatedDate DESC];
    }
    system.debug(':::::List Attachment'+lstAttachment[0].Id);
    
  }
 
  public PageReference Redirect(){
    PageReference newocp = new PageReference('/servlet/servlet.FileDownload?file='+lstAttachment[0].Id);
    newocp.setRedirect(true);
    return newocp;
  }
}

PAGE:
<apex:page controller="PrintStandardLabel" action="{!Redirect}" renderAs="pdf">
    <apex:form >
        
    </apex:form>
</apex:page>

LIST BUTTON:
var LeadID = '{!Lead.Id}';
var newwindow = window.open('/apex/PrintStandardLabelPg?id='+LeadID,'_blank');
I have a requirement to call  Vf Page by using trigger, is there a way to call a page by using trigger.
Hi guys can some one help me with an example apex class to integrate Salesforce with (Infusion Soft and Hub Spot) wit any rest services etc possibilities.
Below are the class, Pgae, Button I am using .
CLASS:

public class PrintStandardLabel
{
  public list<zkfedex__Shipment__c> Shipmentlist {get;set;}
  public list<Attachment> lstAttachment {get;set;}
  public String currentRecordId ='';
  public string ShipmentID = '';
  public  PrintStandardLabel(){
    currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
    system.debug(':::::currentRecordId'+currentRecordId);
    Shipmentlist = new list<zkfedex__Shipment__c>();
    lstAttachment = new list<Attachment>();
    if(currentRecordId != null && currentRecordId != ''){
     Shipmentlist = [Select zkfedex__RecipientLead__c, Name, Id, CreatedDate From zkfedex__Shipment__c WHERE zkfedex__RecipientLead__c =:currentRecordId ORDER BY CreatedDate DESC];
    }
    system.debug('::::ShipmentID'+ShipmentID);
    if(Shipmentlist != null && Shipmentlist.size()>0){
        lstAttachment = [Select ParentId,OwnerId,Name,Id,Description,CreatedDate,ContentType,BodyLength,Body From Attachment WHERE ParentId =: Shipmentlist[0].Id ORDER BY CreatedDate DESC];
    }
    system.debug(':::::List Attachment'+lstAttachment[0].Id);
    
  }
 
  public PageReference Redirect(){
    PageReference newocp = new PageReference('/servlet/servlet.FileDownload?file='+lstAttachment[0].Id);
    newocp.setRedirect(true);
    return newocp;
  }
}

PAGE:
<apex:page controller="PrintStandardLabel" action="{!Redirect}" renderAs="pdf">
    <apex:form >
        
    </apex:form>
</apex:page>

LIST BUTTON:
var LeadID = '{!Lead.Id}';
var newwindow = window.open('/apex/PrintStandardLabelPg?id='+LeadID,'_blank');