• VT878
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies
I would know when Winter '18 will be available in Developer Edition.
Thanks a lot!
  • September 14, 2017
  • Like
  • 0
Hi, I have a problem with Apex Managed Sharing and I read this guide: https://developer.salesforce.com/page/Using_Apex_Managed_Sharing_to_Create_Custom_Record_Sharing_Logic

So, on my custom sObject ("pse_Idea__c") I created a Apex Sharing Reason named "Apex" and its OWD is Public Read-Only:

User-added image
User-added image

I created an after insert trigger on this object to insert a record in pse_Idea__share to share this record with the owner of father's object:
trigger FirstTrigger on pse_Idea__c (after insert) {

	List<pse_Idea__c> listSolution = new List<pse_Idea__c>();
	List<pse_Idea__Share> listIdeaSharing = new List<pse_Idea__Share>();


	if(Trigger.isInsert && Trigger.isAfter) {
		listSolution = [SELECT ID, pse_Pain_Point__r.OwnerId
							FROM pse_Idea__c 
							WHERE ID IN: Trigger.newMap.KeySet() ];
		System.debug('@@@ listSolution: ' + listSolution);

		for (pse_Idea__c item : listSolution) {	
			listIdeaSharing.add(new pse_Idea__Share(AccessLevel='Edit', ParentID=item.ID, 
														UserOrGroupId=item.pse_Pain_Point__r.OwnerId, RowCause=Schema.pse_Idea__Share.RowCause.Apex__c));
			
		}

		try {	
			System.debug('@@@ TRIGGER on pse_Idea__c INSERT : ' + listIdeaSharing);
			insert listIdeaSharing;
		}
		catch(Exception e) {
			System.debug('@@@ TRIGGER on pse_Idea__c Exception :'+e.getMessage());
		}

	}
}

When I insert a pse_Idea__c record I debug this error:
 
19:09:08.0 (255505853)|EXCEPTION_THROWN|[20]|System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
19:09:08.0 (255909781)|USER_DEBUG|[23]|DEBUG|@@@ TRIGGER on pse_Idea__c Exception :Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
But If I insert a record in pse_Idea__share in Execute Anonymous Windows the record is inserted.

Can you give me a hand?

 
  • June 05, 2017
  • Like
  • 0
Hi guys,

I have a question for you.
I have just find a very strange issue with <apex:selectList> tag and disabled attribute used on it.

So, I post some code snippets:
 
<apex:selectList id="idPicklist" size="1" value="{!parameter1}" disabled="true" >
   <apex:selectOptions value="{!picklistValues}" />
</apex:selectList>

In the Action Method in the Controller I have a String to send back the errorMessage on the page e print it:
 
public String parameter1 {get; set;}
public String postBackMessage {get; set;}

public void actionMethod1(){
   
    postBackMessage = parameter1;
    return null;
}

If I remove attribute disabled from JQuery or directly on the Chrome DevTools, the pickList become editable and I can choose a value but this value is not pass to server because the erroreMessage on page is "null".

Why? 
Thanks a lot and have a nice day.
  • August 31, 2016
  • Like
  • 0
Hi, I have a problem with Remote Object.

 If I use one logical operator is all ok. The problems is present when I use more logical operator (for example: OR[AND(condition1, condition2), AND(condition3, condition4)]
 
 The error message is: "Error: Invalid criteria specified for retrieval. ValidationError [code=11, message=Data does not match any schemas from "oneOf", path=/where, schemaKey=null]" 

My code is here:
var contatti = new SObjectModel.Contact();
var criteria = {};
var results = [];									
var criteria = {};
var firstString = 'test1';
var secondString = 'test2';



criteria.where  = { 
    or: 
        {

            and:
                {
					FirstName: {like: firstString  + '%'},
					LastName: {like: secondString + '%'}
                 },

            and:
                {
                    FirstName: {like: secondString + '%'},
                    LastName: {like: firstString + '%'}
                 }
         }

 

contatti.retrieve(
                    criteria,
                    function(err, records, event) {
                        if(err) console.log('errore:'+err);
                        if(!err) {
                            for (var i = 0; i < records.length; i++) {
                                results.push({
                                    label: records[i].get('LastName') + ' ' + records[i].get('FirstName'),
                                    id: records[i].get('Id')
                                });
                            }
                            callback(results);
                        }
                    }
                );
Thanks!!!
 
  • August 05, 2016
  • Like
  • 0
Hi, I want set value in controller from JavaScript and I have some problem.

I have find that the solutions are two: use <apex:param> or <apex:inputHidden> but the problem is always present.

On the Visualforce Page, I have a JavaScript variable, test, and I want set its value to variable myString in Apex Controller.
 
Apex Controller:
public class myController
{
   public String myString{get; set;}
   }

Visualforce Page:
<script>
   
    var test = 'testVariable';
    //Some code

</script>

<body>

   //Some markup

</body>

Thanks a lot.
  • July 28, 2016
  • Like
  • 0
Hi friend,

I have two asks for you. 

1) Is possible use a Error Message of a Validation Field as label? 
    In other words, I have two validation rules with different error messages and in a Apex class I want use their Error Message as I use Custom Label with 'Label' key word.

2) When a Validation Rule is true and a DML statement fail, is possible take from DML Exception object how is the Validation Rule which is true?

I post these questions because I have differente Validation Rule and each of these has a different Error Message, and in a Contoller I must do different operations for each Validation Rule, and now the only solution that I can use is hard coding, for example:

   if (ex.getMessage == 'Error Message1')
        {...}
   else if (ex.getMessage == 'Error Message2')) 
        ​{...}
  • July 04, 2016
  • Like
  • 0
Hi, this is my first post on board and I ask your help (please sorry for my english).

I am French and I am 26 years old. Last March I took BSc in Computer Engineering in Paris and after few months I started an internship in one of the most important and international Consulting Company.

It took me for Salesforce team and, after a month, in June I took my first Salesforce Certification: Salesforce Platform Developer I.

I didn't know Salesforce before this job but now I love it! I love Apex code. I love to code on Force.com. I love Salesforce World and all it is around and I want improve my skills about Salesforce and I want put my future on this technology.......but there is a problem! 

Now I am not developing new code in Force.com but I am only taking hands on bug fixing, on code that other people in other country have devoloped.

I asked my boss if this situation is normal, if it is only for a period and if in the future I will develop code ex-novo but his answer was: "We are a Consultant Company, so we don't develop nothing but we only do a little change on code that other people in other countries as India and Morocco have develop. The our target is to find the customer requests".

I am very demoralized because this isn't the job that I hope for my future. 
I hoped to develop as I develloped during university so I want reason about code, which solution is best, for example, if the map collection is best than list collection etc.

In my team there are people from different degree, math, economy, computer science etc, but it isn't important if you know Java, Apex, Visualforce and other languages very well, the important is to do the correct change at code and stop!

For example, I didn't study JavaScript but now I change JavaScript code without know what and why I am doing it! 
I want study JavaScript, SOAP, REST etc to will take Salesforce Platform Developer II but I want know why I am doing this change at code and not because the important is that now the code is ok for the customer.


Maybe I don't want to understand that the world of consulting is this and it isn't as at University where the most important thing was to understand and to choose the best solution knowing all possibile ways.

This is my first job and I don't know if this is only a case or the job world is this. 
I want to develope on Force.com and I don't want job in this way. I am ready to study new languages, new Salesforce solutions, to travel in other country but the important is to find a job as developer job to improve my knowledge about this world.

Is it possible? Is possibile to develop in European countries? 

So, thanks a lot for your time and I will wait your replies.
  • June 21, 2016
  • Like
  • 0
page : 

<apex:page controller="accountlist">
    <apex:stylesheet value="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"/>
    <apex:includeScript value="//code.jquery.com/jquery-1.10.2.js"/>
    <apex:includeScript value="//code.jquery.com/ui/1.11.2/jquery-ui.js"/>
    <apex:includeScript value="{!URLFOR($Resource.Jquery, '/js/jquery-1.7.2.min.js')}"  />
    
    <script>
        j$ = jQuery.noConflict();
           j$(document).ready(function (){
            j$("#select1").click(function() {
              val xyz = document.getElementById("{!$Component.theForm.thePageBlock.thePageBlocksection.theTable}").val(); 
            alert(xyz);
               });
            });
     
    </script>

<body>

<apex:form id="theForm" > 
<apex:pageblock  id="thePageBlock" >
    <apex:pageblocksection  id="thePageBlocksection" >
 
        <apex:pageblocktable value ="{!listAccount}" var="acc" id="theTable" >
            <apex:column headerValue="Account Name"
               value="{!acc.Name}" id="select1">
             </apex:column> 
        </apex:pageblocktable>
        
   <apex:dataList value="{!accountDetail}" var="acc" id="accountdetails1" rendered="(!listaccount.size!=0)" >
       <apex:outputText value="{!acc.name}" />
       <apex:outputText value="{!acc.phone}"/> 
         </apex:dataList>
       
    </apex:pageblocksection>
    </apex:pageblock>
    </apex:form>
    
</body>    
</apex:page>

apex class 

public class accountList{

    public String getA() {
        return null;
    }


    public accountList() {
                 listAccount = [select id,name,phone from account limit 10];
          listContact = [select name from contact limit 10];
    }

    public list<account> listAccount{get;set;}
    public list<contact> listContact{get; set;}
    public list<account> accountDetail{get;set;}

    public pagereference list1()
    {
        listAccount = [select name,phone from account limit 10];
        listContact = [select name from contact limit 10];
    return null;
    } 
    @RemoteAction
      public static void fetchAccount(string id1)
    {
          system.debug('id1' + id1); 
       
        list<account> accountDetail = [select name,phone from account where name=:id1];
    
    }
    
}
Hi, this is my first post on board and I ask your help (please sorry for my english).

I am French and I am 26 years old. Last March I took BSc in Computer Engineering in Paris and after few months I started an internship in one of the most important and international Consulting Company.

It took me for Salesforce team and, after a month, in June I took my first Salesforce Certification: Salesforce Platform Developer I.

I didn't know Salesforce before this job but now I love it! I love Apex code. I love to code on Force.com. I love Salesforce World and all it is around and I want improve my skills about Salesforce and I want put my future on this technology.......but there is a problem! 

Now I am not developing new code in Force.com but I am only taking hands on bug fixing, on code that other people in other country have devoloped.

I asked my boss if this situation is normal, if it is only for a period and if in the future I will develop code ex-novo but his answer was: "We are a Consultant Company, so we don't develop nothing but we only do a little change on code that other people in other countries as India and Morocco have develop. The our target is to find the customer requests".

I am very demoralized because this isn't the job that I hope for my future. 
I hoped to develop as I develloped during university so I want reason about code, which solution is best, for example, if the map collection is best than list collection etc.

In my team there are people from different degree, math, economy, computer science etc, but it isn't important if you know Java, Apex, Visualforce and other languages very well, the important is to do the correct change at code and stop!

For example, I didn't study JavaScript but now I change JavaScript code without know what and why I am doing it! 
I want study JavaScript, SOAP, REST etc to will take Salesforce Platform Developer II but I want know why I am doing this change at code and not because the important is that now the code is ok for the customer.


Maybe I don't want to understand that the world of consulting is this and it isn't as at University where the most important thing was to understand and to choose the best solution knowing all possibile ways.

This is my first job and I don't know if this is only a case or the job world is this. 
I want to develope on Force.com and I don't want job in this way. I am ready to study new languages, new Salesforce solutions, to travel in other country but the important is to find a job as developer job to improve my knowledge about this world.

Is it possible? Is possibile to develop in European countries? 

So, thanks a lot for your time and I will wait your replies.
  • June 21, 2016
  • Like
  • 0