• Mikola Senyk
  • NEWBIE
  • 179 Points
  • Member since 2013

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 56
    Replies
I have a need to get the User object for the user who logged into SFDC so that I can use it in my community. After using "log in to community as user" how can I use Apex to get the original Salesforce user?
Hi folks,
        Can anyone tell me how to use Remote action annotation in Apex controller/?
We can use public variables in RemoteAction method in Visualforce?


Thanks in advnce
Karthick
Hi,

I try to make a calculation of two values. But I didn't get a value.
I want to make a addition of the value Altersstruktur_u18 and Altersstruktur_1822. In the future I need also the same but for division.

 
public class testfor3_c {

private Id accId {get; set;}
public testfor3_c(ApexPages.StandardController stdcontroller) { 
    accId = stdcontroller.getRecord().Id;

    Altersstruktur_u18 = 0;    
    Altersstruktur_1822 = 0;  
    
    getEZRen();   
}

public Integer Altersstruktur_u18 {get; set;} // variable for people < 18
public Integer Altersstruktur_1822 {get; set;} // variable for people >= 18 AND <= 22
public Integer Sum_u18_1822 {get; set;}

public void getEZRen() {

List<Einzelrisiko__c> EZRList = [SELECT Alter__c, Jahresbeitrag__c, Alter_bei_Vertragsbeginn__c FROM Einzelrisiko__c WHERE Abgangsdatum__c = Null AND Unternehmens_Id_Long__c = :accId]; // create List EZRList with the information Alter__c of all people

FOR (Einzelrisiko__c EZR : EZRList) {  // Loop thru all people

    IF(EZR.Alter__c < 18) { Altersstruktur_u18++; } // if Alter__c < 18 variable Altersstruktur_u18 increase
    IF(EZR.Alter__c >= 18 && EZR.Alter__c <= 22) { Altersstruktur_1822++; } // if Alter__c >= 18 AND <= 22 variable Altersstruktur_1822 increase
    
} 

Integer Sum_u18_1822 = (Altersstruktur_u18 + Altersstruktur_1822);

}

}
Thanks in advance,
Sascha
Hi guys I need help to solve this error:
InsertMilestonesDeploymentProject: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.InsertMilestonesDeploymentProject: line 31, column 1

trigger InsertMilestonesDeploymentProject on Projeto_Implantacao__c (after insert, after update) {
	List<Etapas_Projeto_de_implantacao__c> mList = new List<Etapas_Projeto_de_implantacao__c>();	
	Etapas_Projeto_de_implantacao__c milestone1;
	Etapas_Projeto_de_implantacao__c milestone2;
	Etapas_Projeto_de_implantacao__c milestone3;
	Etapas_Projeto_de_implantacao__c milestone4;
	Etapas_Projeto_de_implantacao__c milestone5;
	Etapas_Projeto_de_implantacao__c milestone6;
	Etapas_Projeto_de_implantacao__c milestone7;
	Etapas_Projeto_de_implantacao__c milestone8;
	
	//Set of accounts
	Set<Id> accountIds =  new Set<Id>();
	
	for(Projeto_Implantacao__c p:Trigger.new){
		accountIds.add(p.Implantacao__c);//Implantacao__c is a lookup field
	}
	//Map of accounts
	Map<Id, Account> accountMap = new Map<Id, Account>([SELECT Id,Name,Unidade_de_atendimento__c FROM Account WHERE Id IN :accountIds]);
	
	
	
	if(Trigger.isAfter) {
    if(Trigger.isUpdate) {
       for(Projeto_Implantacao__c p: Trigger.new) {
       	for(Projeto_Implantacao__c old: Trigger.old) {
           
             milestone1 = new Etapas_Projeto_de_implantacao__c();
             milestone1.Name = '01 - Contato inicial';
             //restore info account master-detail Account>>Projeto_Implantacao__c>>Implantacao
             if(accountMap.get(p.Implantacao__r.Id).Unidade_de_atendimento__c == 'Campo Grande')//The problem It´s here
             	milestone1.Responsavel__c = '005G0000003oWY2';
             milestone1.Data_inicial_prevista__c = Date.today();
             milestone1.Data_final_prevista__c = Date.today().addDays(3);
             milestone1.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone1);
             
             milestone2 = new Etapas_Projeto_de_implantacao__c();
             milestone2.Name = '02 - Levantamento/Coleta de dados';
             milestone2.Data_inicial_prevista__c = Date.today().addDays(4);
             milestone2.Data_final_prevista__c = Date.today().addDays(10);
             milestone2.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone2);
             
             milestone3 = new Etapas_Projeto_de_implantacao__c();
             milestone3.Name = '03 - Conversão de dados';
             milestone3.Data_inicial_prevista__c = Date.today().addDays(11);
             milestone3.Data_final_prevista__c = Date.today().addDays(20);
             milestone3.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone3);
             
             milestone4 = new Etapas_Projeto_de_implantacao__c();
             milestone4.Name = '04 - Capacitação';
             milestone4.Data_inicial_prevista__c = Date.today().addDays(21);
             milestone4.Data_final_prevista__c = Date.today().addDays(30);
             milestone4.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone4);
             
             milestone5 = new Etapas_Projeto_de_implantacao__c();
             milestone5.Name = '05 - Instalação/Acompanhamento';
             milestone5.Data_inicial_prevista__c = Date.today().addDays(31);
             milestone5.Data_final_prevista__c = Date.today().addDays(44);
             milestone5.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone5);
             
             milestone6 = new Etapas_Projeto_de_implantacao__c();
             milestone6.Name = '06 - Ativação financeira';
             milestone6.Data_inicial_prevista__c = Date.today().addDays(45);
             milestone6.Data_final_prevista__c = Date.today().addDays(45);
             milestone6.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone6);
             
             milestone7 = new Etapas_Projeto_de_implantacao__c();
             milestone7.Name = '07 - Ativação do Service Desk';
             milestone7.Data_inicial_prevista__c = Date.today().addDays(49);
             milestone7.Data_final_prevista__c = Date.today().addDays(50);
             milestone7.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone7);                
             
             milestone8 = new Etapas_Projeto_de_implantacao__c();
             milestone8.Name = '08 - Encerramento da implantação';
             milestone8.Data_inicial_prevista__c = Date.today().addDays(46);
             milestone8.Data_final_prevista__c = Date.today().addDays(50);
             milestone8.Projeto_de_Implantacao__c = p.Id;
             mList.add(milestone8);                 
                        
           
       	}   
       }       
    }
    if(!mList.IsEmpty())
    { 
		insert milestone1;
		insert milestone2;
		insert milestone3;
		insert milestone4;
		insert milestone5;
		insert milestone6;
		insert milestone7;
		insert milestone8;
    }
      
  }
}


I have this JSON parser class:

public class GoogleAPIParser {

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

    public List<Results> results;
    public String status;

    public class Location {
        public Double lat;
        public Double lng;
    }

    public class Geometry {
        public Location location;
        public String location_type;
        public Viewport viewport;
    }

    public class Results {
        public List<Address_components> address_components;
        public String formatted_address;
        public Geometry geometry;
        public List<String> types;
    }

    public class Viewport {
        public Location northeast;
        public Location southwest;
    }

   
    public static GoogleAPIParser parse(String json) {
        return (GoogleAPIParser) System.JSON.deserialize(json, GoogleAPIParser.class);
    }

}

Which I invoke using:

GoogleAPIParser parser = GoogleAPIParser.parse(jsonResponse);

 

How do I go through and access those attributes within the class that is returned now?

Hi Buddies,

I need help on small trigger, that was like i have two objects i.e, Inventory and Order.
Both Order,Inventory having Quantity(Integer),Product(Lookup) fields.
Now whenver order is created i need to compare Order Quantity,product  with inventory Quantity,product.
If Order quantity is available i.e, it is smaller than Inventory quantity -->Ok, but
If Order quantity is greater than Inventory quantity, than i need to show a error like " Given quantity is not available for selected Product".

For this how can i compare the fields based on selected product. Plz suggest me. is it by Map?.If yes, plz suggest how to achieve.
Working with inline Visualforce page we have faced with security issue. Apex class "with sharing" keyword updates Opportunity with Read-Only access.
We have OWD for Opportunity Public Read/Write. User profile has Read Only access to Opportunity. In standard Salesforce UI user can't edit Opportunity.
It is correct because we have object level security (OLS) RW and record level security (RLS) Read-Only and more strict (OLS) wins.

To reproduce issue we have created inline Visualforce page and controller extension for Opportunity object.
Controller extension:
public with sharing class oppExt{
    
	public Opportunity opp;
	
	public oppExt(ApexPages.StandardController stdController){
        opp = (Opportunity)stdController.getRecord();
        status = 'start';
        can_upd = Schema.sObjectType.Opportunity.fields.Name.isUpdateable();
        ura = [SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess, HasAllAccess FROM UserRecordAccess WHERE RecordId = :opp.Id AND UserId = :UserInfo.getUserId() LIMIT 1];
    }
    
    public String status {get;set;}
    public Boolean can_upd {get;set;}
    public UserRecordAccess ura {get;set;}
	
    public void updOpportunity(){
        opp.Name += '0';
        try{
            update opp;
            status = 'success';
        } catch(Exception e){
            status = 'failed | ' + e.getMessage();
        }
    }   

}
Visualforce page:
<apex:page standardController="Opportunity" extensions="oppExt">
    <apex:form >
		<apex:commandButton action="{!updOpportunity}" value="update opportunity"/>
		<br/>name updateable: {!can_upd}
		<br/>result: {!status}
		<br/>opp name: {!Opportunity.Name}
		<br/>vf UsrRecAcc (r/e/d/all): {!Opportunity.userRecordAccess.HasReadAccess}/{!Opportunity.userRecordAccess.HasEditAccess}/{!Opportunity.userRecordAccess.HasDeleteAccess}/{!Opportunity.userRecordAccess.HasAllAccess}
		<br/>apex UsrRecAcc (r/e/d/all): {!ura.HasReadAccess}/{!ura.HasEditAccess}/{!ura.HasDeleteAccess}/{!ura.HasAllAccess}
    </apex:form>
</apex:page>

As you see it is simple command button to update Opportunity. And it works, but should not.

It is interesting direct query to UserRecordAccess object return false for HasEditAccess:
SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess, HasAllAccess FROM UserRecordAccess WHERE RecordId = :opp.Id AND UserId = :UserInfo.getUserId() LIMIT 1
However query the same field with Opportunity return true:
{!Opportunity.userRecordAccess.HasEditAccess}
I have a need to get the User object for the user who logged into SFDC so that I can use it in my community. After using "log in to community as user" how can I use Apex to get the original Salesforce user?

Hey All,

I am hoping someone might be able to help me diagnose a code issue.  The following are a trigger and class used to reassign leads using the assignment rules if a lead checkbox field called "Reassign__c" is checked off.  To cover the most common issues...both trigger, class, (and also test class) are active in prod and sandbox.  The other two caveats that are confusing is that previously this trigger did work, and also I have a similar trigger/class for contacts (does not use DMLOptions, but does use Database.Update(contacts)) that works fine in both prod and sandbox.  I have recently been experimenting with new sharing settings & permission set stuff, could this affect it?  Any thoughts or suggestions would be greatly appreciated.

Trigger:

trigger reassignLeads on Lead (after update){
    if (ReassignLeads.futureMethodAlreadyCalled == FALSE){
        Set<Id> leadIds=new Set<Id>();
        for(Lead l:trigger.new){
           leadIds.add(l.id);    
        }//for
        ReassignLeads.reassignLeads(leadIds);
    }//if
}//trigger

Class:
public class ReassignLeads {

    public static Boolean futureMethodAlreadyCalled = FALSE;//prevent infinite loops 
   
    @future
    public static void reassignLeads(Set<Id> ids){
        futureMethodAlreadyCalled = TRUE; //prevent infinite loops
        List<Lead> leads = [SELECT id, Reassign__c FROM Lead WHERE Id IN: ids];
        Database.DMLOptions dmo=new Database.DMLOptions();
        dmo.assignmentRuleHeader.UseDefaultRule=True;

        for (Lead l: leads){
            if(l.Reassign__c == TRUE){
              l.Reassign__c = False; //set it to false to avoid continually reassigning this lead
              l.setOptions(dmo);
            }
        }//for
       try {
           Database.Update(leads);
       }catch (DMLException e){
           system.debug('Something went wrong with the reassignLeads method: ' + e);
       }//try
    }//reassignLeads
}//class

 
 After sending mail Body(Ckeditor) are coming with HTML tag. How to Remove??? 
Visual force page
<apex:pageBlock >

<apex:commandButton value="Send" action="{!send}" />

</apex:pageblockSection>
<apex:outputLabel value="AddRecep" for="AddRecep"/>:<br/>

<apex:inputText value="{!AddRecep}"  id="table2"/>

 <apex:commandlink onclick="openPopup();return false;" value="Add Recipients" />  
<br/><br/>
<br><apex:outputLabel value="From" for="From"/>:
           {!$User.FirstName} {!$User.LastName}
</br>
<br/><br/>
<apex:outputLabel value="Subject" for="Subject"/>:<br/>
<apex:inputText value="{!subject}" id="Subject" maxlength="80"/>
<br/><br/>
<apex:outputLabel value="Choose Video "/>
<apex:outputLink onclick="showpopup(); return false;" > <br/>

Click here to choose session </apex:outputLink>
<br/><br/>

<apex:outputLabel value="Body" for="Body"/>:<br/>
<!--<apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" />-->

<apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" style="width: 500px; height: 150px;">
</apex:inputtextarea>
<br/><br/><br/>   
         
<apex:includescript value="{!URLFOR($Resource.CkEditor,'ckeditor/ckeditor.js')}"/>
</apex:pageblock>
 
Controller

  public pageReference send(){
   
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
  
    List<String> toAddress =new List<String>();
    
   
  if (AddRecep != '' && AddRecep != null) {
     toAddress = AddRecep.split(';');   
    email.setToAddresses(toAddress);
    email.setSubject(subject);
    email.setPlainTextBody(body);   
  Messaging.SendEmailResult [] res = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email});  
  for ( Messaging.sendEmailResult result : res ) {
           if ( !res[0].isSuccess () ) {
               System.debug ( result  );
           }
           else{
               ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' );
               ApexPages.addMessage(msg);
           }
       }
 }  
return null;        
}
public List<video> ConsoleWrapperList1{get;set;}
public String consolewrap{get;set;}
public void callapi2(){
     String  SessionId = '';
     for( consolewrap cwt : ConsoleWrapperList){
         if(cwt.selected){
              if(SessionId == ''){
               SessionId += cwt.sid;
              }else{
               SessionId += ','+ cwt.sid;
              }
         }
     } 
 
     List<video> ConsoleWrapperList1 = new List<video>();
    HttpRequest req = new HttpRequest(); 
    HttpResponse res = new HttpResponse();
    Http http = new Http(); 
    req.setEndpoint('http://webapi.demomail.net/test/SendVideoBody.js?id='+SessionId); 
    req.setMethod('GET');
    res = http.send(req);
    if(res.getstatusCode() == 200 && res.getbody() != null){ 
        String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','').replace('','');
        ConsoleWrapperList1=(List<video>)System.JSON.deserialize(replaceIllegal,List<video>.class);   
        body = ConsoleWrapperList1.get(0).bodyT;
  
}
Working with inline Visualforce page we have faced with security issue. Apex class "with sharing" keyword updates Opportunity with Read-Only access.
We have OWD for Opportunity Public Read/Write. User profile has Read Only access to Opportunity. In standard Salesforce UI user can't edit Opportunity.
It is correct because we have object level security (OLS) RW and record level security (RLS) Read-Only and more strict (OLS) wins.

To reproduce issue we have created inline Visualforce page and controller extension for Opportunity object.
Controller extension:
public with sharing class oppExt{
    
	public Opportunity opp;
	
	public oppExt(ApexPages.StandardController stdController){
        opp = (Opportunity)stdController.getRecord();
        status = 'start';
        can_upd = Schema.sObjectType.Opportunity.fields.Name.isUpdateable();
        ura = [SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess, HasAllAccess FROM UserRecordAccess WHERE RecordId = :opp.Id AND UserId = :UserInfo.getUserId() LIMIT 1];
    }
    
    public String status {get;set;}
    public Boolean can_upd {get;set;}
    public UserRecordAccess ura {get;set;}
	
    public void updOpportunity(){
        opp.Name += '0';
        try{
            update opp;
            status = 'success';
        } catch(Exception e){
            status = 'failed | ' + e.getMessage();
        }
    }   

}
Visualforce page:
<apex:page standardController="Opportunity" extensions="oppExt">
    <apex:form >
		<apex:commandButton action="{!updOpportunity}" value="update opportunity"/>
		<br/>name updateable: {!can_upd}
		<br/>result: {!status}
		<br/>opp name: {!Opportunity.Name}
		<br/>vf UsrRecAcc (r/e/d/all): {!Opportunity.userRecordAccess.HasReadAccess}/{!Opportunity.userRecordAccess.HasEditAccess}/{!Opportunity.userRecordAccess.HasDeleteAccess}/{!Opportunity.userRecordAccess.HasAllAccess}
		<br/>apex UsrRecAcc (r/e/d/all): {!ura.HasReadAccess}/{!ura.HasEditAccess}/{!ura.HasDeleteAccess}/{!ura.HasAllAccess}
    </apex:form>
</apex:page>

As you see it is simple command button to update Opportunity. And it works, but should not.

It is interesting direct query to UserRecordAccess object return false for HasEditAccess:
SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess, HasAllAccess FROM UserRecordAccess WHERE RecordId = :opp.Id AND UserId = :UserInfo.getUserId() LIMIT 1
However query the same field with Opportunity return true:
{!Opportunity.userRecordAccess.HasEditAccess}
Hi, I some text displaying in a Visualforce page like this;

User-added image
I want to align the paragraph and the title like this;

User-added image
How do I do this?

Thanks
Hi,

We have an object called Discussions, When I'm trying to edit a record and save it, I'm again taken back to Edit mode but the data is getting saved.

Actually We have a VF page which use Standard Controller and Extension, this page has Edit button when we click on Edit button it takes to a Edit Page where we edit and save that reflects back on Discussion record in the backend. But when we edit the same record in salesforce standard page and click save it is again taken back to edit mode.


<apex:page showHeader="false" standardStylesheets="true" sidebar="false" docType="html" standardController="Discussion__c" extensions="WSEWDiscussionEditController" action="{!IF(LEN($Site.Domain)>0,'',URLFOR($Action.Discussion__c.Edit, Id, null,true))}"> <apex:composition template="MyWSETemplate"> <apex:define name="header">Discussions</apex:define> <apex:define name="breadcrumb"> Create / Edit Discussion </apex:define> <apex:define name="body"> <link href="{!URLFOR($Resource.MyWSEAssets, 'css/chatterCustomFollowers.css')}" rel="stylesheet"/> <apex:form id="createDiscussion"> <div class="row"> <div class="col-md-4"> <img class="center-block img-responsive" src="{!URLFOR($Resource.MyWSEAssets, 'images/feature_1.jpg')}" alt="discussion" /> <div class="row padding10"> <div class="col-xs-12"> <apex:outputPanel rendered="{!theDiscussion.ownerid == $User.Id}"> <apex:commandButton styleclass="btn btn-primary btn-sm" value="SAVE" action="{!save}"/>&nbsp; </apex:outputPanel> <apex:outputPanel rendered="{!theDiscussion.ownerid == $User.Id}"> <apex:commandButton styleclass="btn btn-primary btn-sm" value="CANCEL" action="{!$Page.MyWSEGroupDiscussion}?id={!theDiscussion.id}"/>&nbsp; </apex:outputPanel> </div> </div> </div>


Save method in Controller

 public PageReference save() {
        try {
          theDiscussion.Related_Interest__c = selectedInterest ;
          update theDiscussion;
          PageReference viewDiscussionPage = Page.MyWSEGroupDiscussion;
          viewDiscussionPage.getParameters().put('Id', theDiscussion.id);
          return viewDiscussionPage;
        } catch (Exception e) {
            ApexPages.Message exceptionMessage = new ApexPages.Message(ApexPages.Severity.FATAL, e.getMessage());
            ApexPages.addMessage(exceptionMessage);
            return null;
        }

Please help on how to fix it. Thank You.
Hi All,
I have created a webservice class
global class PublishBBProvisioningEvents{
	webService static String sendIPAddress(String extId, 
                                                           String serviceName,
                                                           Boolean isDynamic, 
                                                           String IPRouteString ) {
	
		Provisioning_Updates__c orderUpdaterecord = new Provisioning_Updates__c();
	       
	        if(extId!=null) orderUpdaterecord.extId__c = extId;
		if(serviceName!=null) orderUpdaterecord.Service_name__c = name;
		if(isDynamic!=null) orderUpdaterecord. isDynamic__c = isDynamic;
		if(IPRouteString!=null) orderUpdaterecord. IP_iprecord__c=IPRouteString;
	       insert orderUpdaterecord;
	       return 'SUCCESS';
	}
}
When client application sends all values in same sequence, it works well. But if client application do not send values in sequence or don’t send second parameter, it throws illegal assignment  from Boolean to string error

if they send below , it works well
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://soap.sforce.com/schemas/class/PublishBBProvisioningEvents">
   <soapenv:Header>
      <pub:SessionHeader>
         <pub:sessionId>00D110000006EVE!ARMAQA8XOw62xM17pgWzDOq9fJMbPkHeKB7PvcbNFiCClV4onxTzVRl2EH7FyCyZTNhFOrxIIpJY2cw4w0md9dkXpuAO2lyu</pub:sessionId>
      </pub:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <pub:sendIPAddress>
         <pub:extId>954899952</pub:extId>
         <pub:serviceName>1234</pub:serviceName>
         <pub:isDynamic>true</pub:isDynamic>
         <pub:IPRouteString>10.12.23.34/28</pub:IPRouteString>
      </pub:sendIPAddress>
   </soapenv:Body>
</soapenv:Envelope>

but if they send below, it throws error
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://soap.sforce.com/schemas/class/PublishBBProvisioningEvents">
   <soapenv:Header>
      
      <pub:SessionHeader>
         <pub:sessionId>00D110000006EVE!ARMAQA8XOw62xM17pgWzDOq9fJMbPkHeKB7PvcbNFiCClV4onxTzVRl2EH7FyCyZTNhFOrxIIpJY2cw4w0md9dkXpuAO2lyu</pub:sessionId>
      </pub:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <pub:sendIPAddress>
         <pub:extId>954899952</pub:extId>
         <pub:isDynamic>true</pub:isDynamic>
         <pub:IPRouteString>10.12.23.34/28</pub:IPRouteString>
      </pub:sendIPAddress>
   </soapenv:Body>
</soapenv:Envelope>

Or the below
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://soap.sforce.com/schemas/class/PublishBBProvisioningEvents">
   <soapenv:Header>
      
      <pub:SessionHeader>
         <pub:sessionId>00D110000006EVE!ARMAQA8XOw62xM17pgWzDOq9fJMbPkHeKB7PvcbNFiCClV4onxTzVRl2EH7FyCyZTNhFOrxIIpJY2cw4w0md9dkXpuAO2lyu</pub:sessionId>
      </pub:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <pub:sendIPAddress>
         <pub:extId>954899952</pub:extId>
         <pub:isDynamic>true</pub:isDynamic>
	 <pub:serviceName>1234</pub:serviceName>
         <pub:IPRouteString>10.12.23.34/28</pub:IPRouteString>
      </pub:sendIPAddress>
   </soapenv:Body>
</soapenv:Envelope>

Can anyone suggest what the problem is?

Thanks
Dinesh
 
Hello I deleted the parent of an Attachment, now I can't change the parentId from the attachment and can't delete the attachment even using Apex Data Loader
The error id: INVALID_CROSS_REFERENCE_KEY
I can't even open the attachment on "Overall Top Files by Storage Utilization"
I tried to delete this via an Apex class, and it's normally selected but on delete, it returns the same error.
In Data Loader I can export normally.
Hi folks,
        Can anyone tell me how to use Remote action annotation in Apex controller/?
We can use public variables in RemoteAction method in Visualforce?


Thanks in advnce
Karthick
I'm very new to SF development and am working on a small integration project using a VBA macro in Outlook.  I want to fill an array with 3 items from a custom object (Vehicle__c) which has a lookup relationship with another custom object (Device__c), I want the Vehicle__c.Id, Device__c.ID and Device__c.Name__c.   I'm using the following SOQL which when I test in the Force.com Explorer returns the 3 fields queried but the Name of the related object is resturned as a hyperlink that I have to click on to see the name.

SOQL: SELECT Id, Device__c, Device__r.Name__c FROM Vehicle__c where IsDeleted = false

My VBA code below never finds the device__r.Name__c from the query result.  In fact when I watch the variables in the debugger I can see every field name in every object in the Query Result (actually the Fields[] array of the SObject4), why don't I just get back the 3 fields I asked for in the query?  Any help regarding retrieving the Name of the related record would be greatly appreciated.

    Dim qr As QueryResultSet4
    Dim v, r As Variant
    Dim f As Field4
    Dim s As SObject4

    If loggedIn Then
        Set qr = g_sfApi.Query("SELECT Id, Device__c, Device__r.Name__c FROM Vehicle__c where IsDeleted = false", False)
        i = 0
        ReDim vehDeviceMap(qr.Size - 1, 2)
        For Each v In qr
            Set s = v
            For Each r In s.Fields
                Set f = r
                If f.Name = "Id" Then
                    vehDeviceMap(x, 0) = CStr(f.value)
                ElseIf f.Name = "ttdevtest__Device__c" Then
                    vehDeviceMap(x, 1) = CStr(f.value)
                ElseIf f.Name Like "ttdevtest__Device__r.ttdevtest__Name__c" Then 'This ElseIF Statement is never true
                    vehDeviceMap(x, 2) = CStr(f.value)
                End If
            Next r
            i = i + 1
        Next v
    End If
 
Hi All,

Excel document downloaded from following code, I want to see the document with vf page. How to display the document to vf page 

Code
-----------------------------
<apex:page contentType="(displayXLSX,'application/vnd.ms-excel#StageMgr.xls','')"> 
<apex:iframe src="https://c.ap1.content.force.com/servlet/servlet.FileDownload?file=01590000005zttO" scrolling="true" height="500px" id="theIframe" />
</apex:page>

Thanks........
Hi,
Could you help me with the problem below. I got the error "No access to entity: Calendar in row 1, column 8", but I didn't know exactly the error.
Is the following syntax ok?
 
IF(Calendar.Year(EZR.Beginn_der_HV__c) = This.Year) { 
  Bestandsentwicklung_CY++; 
}
The field Beginn_der_HV__c includes dates. I want to count the Beginn_der_HV__c if the calendar year from this field is like current year, also I need to count the field if the calendar year from this field is like current year - 2.

Thanks for your help, Sascha
 
public class testfor6_c {

private Id accId {get; set;}
public testfor6_c(ApexPages.StandardController stdcontroller) { 
    accId = stdcontroller.getRecord().Id;

    Bestandsentwicklung_CY = 0;
    Bestandsentwicklung_CY_2 = 0;

    getEZRen();   
}

public Integer Bestandsentwicklung_CY {get; set;}
public Integer Bestandsentwicklung_CY_2 {get; set;}

public void getEZRen() {

List<Einzelrisiko__c> EZRList = [SELECT Beginn_der_HV__c FROM Einzelrisiko__c WHERE Abgangsdatum__c = Null AND Unternehmens_Id_Long__c = :accId]; 

FOR (Einzelrisiko__c EZR : EZRList) { 

    IF(Calendar.Year(EZR.Beginn_der_HV__c) = This.Year) { Bestandsentwicklung_CY++; }
    IF(Calendar.Year(EZR.Beginn_der_HV__c) = This.Year-2) { Bestandsentwicklung_CY_2++; }    

} } }



 
I have a requirment like in a pageblock table, in a sinlge column i want to take input value(lookup filed),
Based on that 'lookup' inputfiled, i want to display related record in the remaing columns of Table.(In a sinlge Row)
Example:
in first column, i must take inputvalue(lookup to accout),
in the remaining column, same row i want to display(outputfiled/outputtext) of name, phone, rating...etc fileds.
Can any help me,
User-added image
But this is not working, i am able to display single row, unable to hold previous values
I am trying to pull an email address from the standard "Description" field on Cases object. The below formula is correctly pulling everything AFTER the "@" symbol in the email address, (for example "@sample.com").I cannot get it to pull the first part of the email address.

Here is the formula I am using
SUBSTITUTE( Description ,RIGHT(Description, FIND("@",Description))+ LEFT(Description, FIND("@",Description)), NULL)

All help much appreciated.
How can set fixed width for all columns in a apex:panelGrid in salesforce visualforce page that render as PDF.
Style section not worked properly when i am using renderAs="PDF" :(
Any help?
Thanks in advance.
  • October 23, 2014
  • Like
  • 0
There are two products we have in our system (Customer Supplied Tires) and (Michelin Tire Upgrade).  They are different products but should not be chosen on the same quote. I need a trigger (or something) that will allow our users to pick 1 or the other, but not both.  If someone can help, please let me know and I will be happy to provide more detailed information.

Thank you - 
MGrundman
Hi All !

Can anyone tell me how to get reports based on objects type in SOQL?
I'm trying to fetch from Report Object. But some how I want to fetch only those who belongs to a specific standard/custom object.

for example : 
My current query is ->
SELECT Id, Name FROM Report WHERE Format='Tabular' Order by Name limit 10000

All I want is to apply a report type kind of filter so that I can get reports for a specific object (contact, account or custom object etc).