• Davidvzla
  • NEWBIE
  • 50 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
Hello friends,

probably you are used to looking a bunch of dumb questions or newbie questions, and here goes another one, 
What does the highlighted line means ? I mean I don't understand the structure, why does {get; set;} do in these context ?.

Thanks for your help, David.

User-added image
Hello friends,

I,ve been trying to deploy some metadata in the DE org thru Ant, I am pretty sure I've enter the correct username, password+security token and the url, but it keeps saying:

BUILD FAILED
D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml:60: Invalid username, password, security token; or user locked out.

I don't know what else to try, if someone can help me I would appreciate it, thanks a lot.
 
Hello friends,

I need to modify some label fields in a Custom Object in my org and also to change those field to mandatorys, does anybody can recomend a plan on how to approach this test ? Thanks again.
Hello friends,

I've been trying to check this challenge but without luck,it is giving me 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.QueryException: unexpected token: Status
.

I don't know what I am doing wrong. Here is my  Visualforce page code

<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageblock Title="New Case List" id="cases_list">
        <apex:repeat var="case" value="{!newCases}">
            <apex:outputLink value="/{!case.Id}">
            ID: {!case.Id}
           
            </apex:outputLink><br/>
            <apex:outputLink value="/{!case.Id}">
            
            Case Number: {!case.CaseNumber}
            
            
            </apex:outputLink><br/>
                          
                    
           </apex:repeat>
        </apex:pageblock>
    </apex:form>
    
</apex:page>

and here is my Controller class code:

public class NewCaseListController {
    public List<Case> getNewCases() {
        List<Case> results = Database.query('Select Id,CaseNumber,Status' +
                                            'From Case' +
                                            'Where Status =\'New\'');
        
 
        return results;
}
}



Hope someone can help me with this, Thanks a lot.
Hello guys,

I am trying to do one of the examples in the Apex triggers where a SOQL query is used and I dont understand one of the parameters that is in line 6 which is:

06        [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New]);

I dont understand the parameter "IN : Trigger.New])" ??, 

Complete Example:
01trigger AddRelatedRecord on Account(after insert, after update) {
02    List<Opportunity> oppList = new List<Opportunity>();
03     
04    // Get the related opportunities for the accounts in this trigger
05    Map<Id,Account> acctsWithOpps = new Map<Id,Account>(
06        [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New]);
07     
08    // Add an opportunity for each account if it doesn't already have one.
09    // Iterate through each account.
10    for(Account a : Trigger.New) {
11        System.debug('acctsWithOpps.get(a.Id).Opportunities.size()=' + acctsWithOpps.get(a.Id).Opportunities.size());
12        // Check if the account already has a related opportunity.
13        if (acctsWithOpps.get(a.Id).Opportunities.size() == 0) {
14            // If it doesn't, add a default opportunity
15            oppList.add(new Opportunity(Name=a.Name + ' Opportunity',
16                                       StageName='Prospecting',
17                                       CloseDate=System.today().addMonths(1),
18                                       AccountId=a.Id));
19        }          
20    }
21 
22    if (oppList.size() > 0) {
23        insert oppList;
24    }
25}



I would really appreciate if anybody can help me. Thanks.
I don't know what is the number inside the square brackets in SOQL used for?   for instance, number 0 (zero) inside square brackets. Thanks for your help.

1Account[] acctsWithContacts = [SELECT Name, (SELECT FirstName,LastName FROM Contacts)
2                               FROM Account
3                               WHERE Name = 'SFDC Computing'];
4// Get child records
5Contact[] cts = acctsWithContacts[0].Contacts;
6System.debug('Name of first associated contact: '
7             + cts[0].FirstName + ', ' + cts[0].LastName)

 
Hello friends,

I,ve been trying to deploy some metadata in the DE org thru Ant, I am pretty sure I've enter the correct username, password+security token and the url, but it keeps saying:

BUILD FAILED
D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml:60: Invalid username, password, security token; or user locked out.

I don't know what else to try, if someone can help me I would appreciate it, thanks a lot.
 
Hello friends,

probably you are used to looking a bunch of dumb questions or newbie questions, and here goes another one, 
What does the highlighted line means ? I mean I don't understand the structure, why does {get; set;} do in these context ?.

Thanks for your help, David.

User-added image
Hello friends,

I,ve been trying to deploy some metadata in the DE org thru Ant, I am pretty sure I've enter the correct username, password+security token and the url, but it keeps saying:

BUILD FAILED
D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml:60: Invalid username, password, security token; or user locked out.

I don't know what else to try, if someone can help me I would appreciate it, thanks a lot.
 
Hello friends,

I need to modify some label fields in a Custom Object in my org and also to change those field to mandatorys, does anybody can recomend a plan on how to approach this test ? Thanks again.
Hello friends,

I've been trying to check this challenge but without luck,it is giving me 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.QueryException: unexpected token: Status
.

I don't know what I am doing wrong. Here is my  Visualforce page code

<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageblock Title="New Case List" id="cases_list">
        <apex:repeat var="case" value="{!newCases}">
            <apex:outputLink value="/{!case.Id}">
            ID: {!case.Id}
           
            </apex:outputLink><br/>
            <apex:outputLink value="/{!case.Id}">
            
            Case Number: {!case.CaseNumber}
            
            
            </apex:outputLink><br/>
                          
                    
           </apex:repeat>
        </apex:pageblock>
    </apex:form>
    
</apex:page>

and here is my Controller class code:

public class NewCaseListController {
    public List<Case> getNewCases() {
        List<Case> results = Database.query('Select Id,CaseNumber,Status' +
                                            'From Case' +
                                            'Where Status =\'New\'');
        
 
        return results;
}
}



Hope someone can help me with this, Thanks a lot.
Hello guys,

I am trying to do one of the examples in the Apex triggers where a SOQL query is used and I dont understand one of the parameters that is in line 6 which is:

06        [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New]);

I dont understand the parameter "IN : Trigger.New])" ??, 

Complete Example:
01trigger AddRelatedRecord on Account(after insert, after update) {
02    List<Opportunity> oppList = new List<Opportunity>();
03     
04    // Get the related opportunities for the accounts in this trigger
05    Map<Id,Account> acctsWithOpps = new Map<Id,Account>(
06        [SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE Id IN :Trigger.New]);
07     
08    // Add an opportunity for each account if it doesn't already have one.
09    // Iterate through each account.
10    for(Account a : Trigger.New) {
11        System.debug('acctsWithOpps.get(a.Id).Opportunities.size()=' + acctsWithOpps.get(a.Id).Opportunities.size());
12        // Check if the account already has a related opportunity.
13        if (acctsWithOpps.get(a.Id).Opportunities.size() == 0) {
14            // If it doesn't, add a default opportunity
15            oppList.add(new Opportunity(Name=a.Name + ' Opportunity',
16                                       StageName='Prospecting',
17                                       CloseDate=System.today().addMonths(1),
18                                       AccountId=a.Id));
19        }          
20    }
21 
22    if (oppList.size() > 0) {
23        insert oppList;
24    }
25}



I would really appreciate if anybody can help me. Thanks.
I don't know what is the number inside the square brackets in SOQL used for?   for instance, number 0 (zero) inside square brackets. Thanks for your help.

1Account[] acctsWithContacts = [SELECT Name, (SELECT FirstName,LastName FROM Contacts)
2                               FROM Account
3                               WHERE Name = 'SFDC Computing'];
4// Get child records
5Contact[] cts = acctsWithContacts[0].Contacts;
6System.debug('Name of first associated contact: '
7             + cts[0].FirstName + ', ' + cts[0].LastName)