• Elizabeth Bryant
  • NEWBIE
  • 34 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 8
    Replies
Is there a way to do this?

Here's a breakdown of what has been requested of my batch code:

We are working on a large integration with our Salesforce and various other divisions/mainframes. The goal is to completely eliminate the mainframes as they are acting as "middle men" between the other divisions and us not to mention they were built 25+ years ago and are outdated at this point. One division will be pushing us data to our Mule in the form of a .txt file and then Mule will insert the lines in that file as a text field into a Staging object. My batch then picks new records up from Staging and parses the record details into fields in a Master object. I use Database.Upsert() with an external ID to move those details into Master. 

With the current example we have gotten from the division we are integrating into our SF org, there are some lines of data that have the same external ID (these would be concidered updates to the record). The below image shows an example (there are 3 external IDs here).

Record line example

As expected when I pass my list of Master data to be upserted, I get the dreaded "Duplicate external id specified: 59XXXXXXXX01" error when the batch gets to these records and they do not upsert at all. I've been told that this scenerio should not exist outside of my test data I was sent, and that when we go live I will not receive multiple external ids in a day; but of course, we want to code to handle this situation just in case. 

Is there a work around for this scenario where I can force the first record to upsert and then come back and process the second record? We will have change history tracking set up for the Master object and it is required that we have history of every update for each Master record. Inserting or updating all records that we are sent is mandatory.

I was thinking that I could change my Upsert to accept a single record and process the records in the batch individually, but would that defeat the purpose of a batch class and cause DML governor limits to be hit for large transactions like I suspect? Should I use Database.Insert() and Database.Update() separately instead of Database.Upsert()? I'm trying my hardest to keep my DML operations to bare minimum (with Database.Upsert() I am performing 4 DML operations.)

Any advice on how to create a workaround would be extremely helpful and greatly appreciated. 





 
I am parsing an application into XML format and the expected return value for dates is DD-MMM-YY. The fields in question are parsed inside of a for loop. The first iteration returns the correct format for DOB, but the second iteration returns wrong. I'm hoping that someone can help me pinpoint what the issue is here.

Thanks in advance! 

Apex Code: 
for(Integer i=0; i< memToXML.size();i++){
      w.writeStartElement(null,'DOB','');
      String dt =   DateTime.newInstance(memToXML[i].DOB__c.year(),memToXML[i].DOB__c.month(),memToXML[i].DOB__c.day()).format('DD-MMM-YY');
      system.debug('>>> Converted DOB: ' + dt);
      w.writeCharacters(dt);
      w.writeEndElement();

XML output:
Member One:  <soapenv:DOB>02-Jan-80</soapenv:DOB> ***Original 1/2/1980***
Member Two:  <soapenv:DOB>196-Jul-99</soapenv:DOB> ***Original 7/15/1999***

 
Hi everyone.

I have a Visualforce page and custom controller that will update a record. I have run into an issue when I click my commandButton. The value I enter into my inputText field is not being grabbed by the controller. 

Controller: 
//inputText values
    public String changedFName {get;set;}
    public String changedLName {get;set;}

​
public void updateFields(){
      	system.debug('>>> Input FN: ' +changedFName);
        if ((changedFName == '' || changedFName == NULL) && (changedLName == '' || changedLName == NULL)){
             ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'You must enter data to update.'));
        } 
        else if (changedFName !='' || changedFName != NULL){
            srcResult.FirstName__c = changedFName;
            update srcResult;
        } 
        else if (changedLName !='' || changedLName != NULL){
            srcResult.LastName__c = changedLName;
            update srcResult;
        }
        
        
      /*  if (changedFName != '' || changedFName != NULL) {
            try{
                system.debug('>>> Input FN: ' + changedFName);
                
                //rec.Id = caseId;
                srcResult.FirstName__c = changedFName;
                update srcResult;
                
            } catch(exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Can\'t update First Name.'));
                system.debug('>>> ' + e);
            } 
        } else if (changedLName !='' || changedLName != NULL){
            try{
                system.debug('>>> Input LN: ' + changedLName);
                srcResult.LastName__c = changedLName;
                update srcResult;
            } catch (exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Can\'t update Last Name.'));
                system.debug('>>> ' + e);
            }
            
        }
        else {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'You must enter data to update.'));
            
        } */
        
    } 

public PageReference saveRecord(){
        system.debug('>>>Button Clicked<<<');
		
       try{
           //update srcResult;
           updateFields();
           system.debug('>>> New FN: ' + srcResult.FirstName__c);
           system.debug('>>> New LN: ' + srcResult.LastName__c);
           return null;
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Your update did not save.'));
            system.debug(e);
        }
        return null;
    }
VF Page:


<apex:form id="theForm">
            <apex:pageBlockSection >
               
                <table class="caseDetailTbl" align="center">
                    <apex:outputPanel id="detailPanel">
                        <apex:repeat value="{!srcResult}" var="details">
                            <div align="center">
                                <tr>
                                    <th align="left">Original Information</th>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td></td>
                                    <th align="right">New Information</th>
                                </tr>
                            </div>
                            <table id="updateTbl" align="center">
                                <tr><td colspan="4" style="height:25px"/></tr>
                                <tr>
                                    <td>First Name:</td>
                                    <td><apex:outputLabel id="FirstName" value="{!details.FirstName__c}"  /></td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td><apex:inputText id="OverRide_FirstName" styleClass="trackChanges" value="{!changedFName}"/></td>
                                </tr>
                                <tr>
                                    <td>Last Name:</td>
                                    <td><apex:outputLabel id="LastName" value="{!details.LastName__c}"  /></td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td><apex:inputText id="OverRide_LastName" styleClass="trackChanges" value="{!changedLName}"/></td>
                                </tr>
                                
                            </table>
                        </apex:repeat>
                       
                        <tr></tr>
                            <tr>
                                <td/>
                            </tr>
                                <tr width="75%">
                                    <td/>
                                    <td style="align:right;">
                                        <apex:commandButton id="cmdSave" style="font-weight: bold;align:left;" styleClass="btn btn-primary horizontalButtons" value="Save" action="{!saveRecord}" reRender="updateTbl, err">
                                           
                                        </apex:commandButton>
                                        <apex:pageMessages id="err"/>
                                    </td>
                                </tr>
                    </apex:outputPanel>
                    
                </table>
            </apex:pageBlockSection>
        </apex:form>


These are the results that I am getting for the uncommented code in updateFields() (This is WITH data entered into the fields):
 1. Errors: You must enter data to update. Your update did not save.
2. DEBUG [33] >>> Input FN: null
3. Attempt to de-reference a null object error. 

These are the results that I am getting for the commented code in updateFields() (This is WITH data entered into the fields):
 1. Errors: Can't update First Name. Your update did not save.
2. DEBUG [48] >>> Input FN: null
3. Attempt to de-reference a null object error. 


Does anyone have any idea of why my inputText value is not being passed into the controller? 
Hi all,

I have been working on this for quite some time and I think that I may have to take a different approach. I am trying to convert a "guest user" (Contact) into a Registered (Customer Community) User based on the current Application that is pulled up in a community for company admins. I am doing this by building an extension on the existing controller for the page where agents can pull the application up.

I added a inputText and button to the page where the agent can enter in an email. This code updates the Contact record fine, as well as creates the associated Account. I want the code to update the Account, not create an entirely different one. This is supposed to be handled by passing methods from the original controller, but I'm running into snags here and there where the User is not being created at all and the Account that is created/updated is not being reflected in the Application record. For instance, where a guest user has filled an application they are assigned to "Guest Account" which is a placeholder of sorts for that person's application. This is also visible on the Application record in the Related_object__c field. When I enter an email in the field on my page, it updates the contact information and adds the Contact to "Firstname Middlename Last Name Account" but doesn't not update the Application's Related_Account__c field. 

I'm also unfamiliar with Page References so I may be going about using them incorrectly. 

I currently get an error "Variable does not exist: updatedCon" when I attempt to pass an SObject variable as parameter (declared and returned from changeGuestUser) method. I think I just need another pair of eyes to get this working as I have it thusfar. 

Thanks! 
 
public Contact changeGuestContact(String searchEmail){
        
       // LoginServices.generateAccountName(fname, mname, lname); *Might Still Use This*
        
       //Query for Head_of_Household information on current app
       //Can not move this out of list. 
       //Error! - SObject constructor must use name=value pairs
       List<FC_Member__c> hohContact = new List<FC_Member__c>([Select Contact__r.ID, Contact__r.FirstName, 
                        Contact__r.MiddleName, 
                        Contact__r.LastName, 
                        Contact__r.Email, 
                        ID, 
                        FC_Application__r.Related_Account__c,                                       
                        FC_Application__r.Confirmation_Number__c, 
                        FC_Application__r.Head_of_Household_Name__c
                                                              
                        
                        FROM FC_Member__C 
                        WHERE FC_Application__r.Confirmation_Number__c = :fcord.confnum LIMIT 1]);

        //Create Contact 
        Contact updatedCon = New Contact();
        updatedCon.ID = hohContact[0].Contact__r.ID;
        updatedCon.FirstName = hohContact[0].Contact__r.FirstName;
        updatedCon.MiddleName = hohContact[0].Contact__r.MiddleName;
        updatedCon.LastName = hohContact[0].Contact__r.LastName;
        updatedCon.email = searchEmail;
        
        //
        String newAcctName = LoginServices.generateAccountName(updatedCon.FirstName, updatedCon.MiddleName, updatedCon.LastName);
         Account updatedAccount = new Account(Name=newAcctName);
        
        update updatedAccount;
        
        updatedCon.AccountId = updatedAccount.ID;
        
        
        system.debug('Contact updated: ' +updatedCon);
        update updatedCon;    
        return updatedCon;

        
    }
    
    public FC_Application__c changeApp(Contact updatedCon) { //Line 171 Variable does not exist: updatedCon --> changeApp(updatedCon); 
        
        //query for the current application by confirmation number *The app that is pulled up in AdminTool*
        List <FC_Application__c>  currentApp = new List<FC_Application__c>([SELECT ID,
                                                                    Related_Account__c,
                                                                    Confirmation_Number__c
                                                                    
                                                                    FROM FC_Application__c
                                                                    WHERE Confirmation_Number__c =:fcord.confnum LIMIT 1]); 
     
        FC_Application__c updateApp = new FC_Application__c();
        updateApp.ID = currentApp[0].ID;
        updateApp.Related_Account__c = updatedCon.AccountId;

        
        update updateApp;
        system.debug('Account: ' +updateApp.Related_Account__c);
        
        //Need to set the AccountID/Name from the updatedCon variable to the Related_Account__c variable on the current
        //Application.
         //updatedAccount.Application__c = currentApp[0].ID;
         
         
        
        return updateApp;
    }   
    
    
        public Account changeGuestAccount(Contact updatedCon){
        
        //String newAcctName = LoginServices.generateAccountName(updatedCon.FirstName, updatedCon.MiddleName, updatedCon.LastName);
         //Account updatedAccount = new Account(Name=newAcctName);
        
        //upsert updatedAccount;    
        return null;
        
    }
    
    //Calls LoginServices.createNewApplicant to 'self-register' the Guest into a Customer User
    public Boolean createSuccessful(Contact updatedCon){
        try{
        changeGuestContact(searchEmail);
        LoginServices.createNewApplicant(updatedCon.email, updatedCon.firstname, updatedCon.middlename, updatedCon.lastname);
        system.debug('User created?: ');
        }
        catch (exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Contact not updated'));
            return false;
        }
        return true;
    }
    
    
    
    
    

    
    public PageReference checkEmail(){
        try{
            //setSearchEmail('jdough@test.com');
            //changeGuestContact(searchEmail);
            //changeGuestAccount();
            createSuccessful(updatedCon); //Variable does not exist: updatedCon
            //changeApp(updatedCon); //variable does not exist: updatedCon
            return null;
        } 
        catch (exception e){
           ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Contact not updated'));
         
        }
        return null;
    }





 
Is there a way to do this?

Here's a breakdown of what has been requested of my batch code:

We are working on a large integration with our Salesforce and various other divisions/mainframes. The goal is to completely eliminate the mainframes as they are acting as "middle men" between the other divisions and us not to mention they were built 25+ years ago and are outdated at this point. One division will be pushing us data to our Mule in the form of a .txt file and then Mule will insert the lines in that file as a text field into a Staging object. My batch then picks new records up from Staging and parses the record details into fields in a Master object. I use Database.Upsert() with an external ID to move those details into Master. 

With the current example we have gotten from the division we are integrating into our SF org, there are some lines of data that have the same external ID (these would be concidered updates to the record). The below image shows an example (there are 3 external IDs here).

Record line example

As expected when I pass my list of Master data to be upserted, I get the dreaded "Duplicate external id specified: 59XXXXXXXX01" error when the batch gets to these records and they do not upsert at all. I've been told that this scenerio should not exist outside of my test data I was sent, and that when we go live I will not receive multiple external ids in a day; but of course, we want to code to handle this situation just in case. 

Is there a work around for this scenario where I can force the first record to upsert and then come back and process the second record? We will have change history tracking set up for the Master object and it is required that we have history of every update for each Master record. Inserting or updating all records that we are sent is mandatory.

I was thinking that I could change my Upsert to accept a single record and process the records in the batch individually, but would that defeat the purpose of a batch class and cause DML governor limits to be hit for large transactions like I suspect? Should I use Database.Insert() and Database.Update() separately instead of Database.Upsert()? I'm trying my hardest to keep my DML operations to bare minimum (with Database.Upsert() I am performing 4 DML operations.)

Any advice on how to create a workaround would be extremely helpful and greatly appreciated. 





 
I am parsing an application into XML format and the expected return value for dates is DD-MMM-YY. The fields in question are parsed inside of a for loop. The first iteration returns the correct format for DOB, but the second iteration returns wrong. I'm hoping that someone can help me pinpoint what the issue is here.

Thanks in advance! 

Apex Code: 
for(Integer i=0; i< memToXML.size();i++){
      w.writeStartElement(null,'DOB','');
      String dt =   DateTime.newInstance(memToXML[i].DOB__c.year(),memToXML[i].DOB__c.month(),memToXML[i].DOB__c.day()).format('DD-MMM-YY');
      system.debug('>>> Converted DOB: ' + dt);
      w.writeCharacters(dt);
      w.writeEndElement();

XML output:
Member One:  <soapenv:DOB>02-Jan-80</soapenv:DOB> ***Original 1/2/1980***
Member Two:  <soapenv:DOB>196-Jul-99</soapenv:DOB> ***Original 7/15/1999***

 
Hi All,

As per my requirement i want to display accounts with dublicate records.
for ex: am displaying 2 account records in vf page need to display 3 dublicate records for every record with expandable/collapsable like excel rows.

Account1strec              email   phone
Account1strecdub1   email   phone
Account1strecdub2   email   phone
Account1strecdub3   email   phone

Account2ndrec             email   phone
Account2ndrecdub1   email   phone
Account2
ndrecdub2   email   phone
Account2
ndrecdub3   email   phone

Dublicare records need to Expandable/collapsable like excel sheet

Is there any way to achive this can you plz help...Thanks in advance
Hi everyone.

I have a Visualforce page and custom controller that will update a record. I have run into an issue when I click my commandButton. The value I enter into my inputText field is not being grabbed by the controller. 

Controller: 
//inputText values
    public String changedFName {get;set;}
    public String changedLName {get;set;}

​
public void updateFields(){
      	system.debug('>>> Input FN: ' +changedFName);
        if ((changedFName == '' || changedFName == NULL) && (changedLName == '' || changedLName == NULL)){
             ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'You must enter data to update.'));
        } 
        else if (changedFName !='' || changedFName != NULL){
            srcResult.FirstName__c = changedFName;
            update srcResult;
        } 
        else if (changedLName !='' || changedLName != NULL){
            srcResult.LastName__c = changedLName;
            update srcResult;
        }
        
        
      /*  if (changedFName != '' || changedFName != NULL) {
            try{
                system.debug('>>> Input FN: ' + changedFName);
                
                //rec.Id = caseId;
                srcResult.FirstName__c = changedFName;
                update srcResult;
                
            } catch(exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Can\'t update First Name.'));
                system.debug('>>> ' + e);
            } 
        } else if (changedLName !='' || changedLName != NULL){
            try{
                system.debug('>>> Input LN: ' + changedLName);
                srcResult.LastName__c = changedLName;
                update srcResult;
            } catch (exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Can\'t update Last Name.'));
                system.debug('>>> ' + e);
            }
            
        }
        else {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'You must enter data to update.'));
            
        } */
        
    } 

public PageReference saveRecord(){
        system.debug('>>>Button Clicked<<<');
		
       try{
           //update srcResult;
           updateFields();
           system.debug('>>> New FN: ' + srcResult.FirstName__c);
           system.debug('>>> New LN: ' + srcResult.LastName__c);
           return null;
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Your update did not save.'));
            system.debug(e);
        }
        return null;
    }
VF Page:


<apex:form id="theForm">
            <apex:pageBlockSection >
               
                <table class="caseDetailTbl" align="center">
                    <apex:outputPanel id="detailPanel">
                        <apex:repeat value="{!srcResult}" var="details">
                            <div align="center">
                                <tr>
                                    <th align="left">Original Information</th>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td></td>
                                    <th align="right">New Information</th>
                                </tr>
                            </div>
                            <table id="updateTbl" align="center">
                                <tr><td colspan="4" style="height:25px"/></tr>
                                <tr>
                                    <td>First Name:</td>
                                    <td><apex:outputLabel id="FirstName" value="{!details.FirstName__c}"  /></td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td><apex:inputText id="OverRide_FirstName" styleClass="trackChanges" value="{!changedFName}"/></td>
                                </tr>
                                <tr>
                                    <td>Last Name:</td>
                                    <td><apex:outputLabel id="LastName" value="{!details.LastName__c}"  /></td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td>      </td>
                                    <td><apex:inputText id="OverRide_LastName" styleClass="trackChanges" value="{!changedLName}"/></td>
                                </tr>
                                
                            </table>
                        </apex:repeat>
                       
                        <tr></tr>
                            <tr>
                                <td/>
                            </tr>
                                <tr width="75%">
                                    <td/>
                                    <td style="align:right;">
                                        <apex:commandButton id="cmdSave" style="font-weight: bold;align:left;" styleClass="btn btn-primary horizontalButtons" value="Save" action="{!saveRecord}" reRender="updateTbl, err">
                                           
                                        </apex:commandButton>
                                        <apex:pageMessages id="err"/>
                                    </td>
                                </tr>
                    </apex:outputPanel>
                    
                </table>
            </apex:pageBlockSection>
        </apex:form>


These are the results that I am getting for the uncommented code in updateFields() (This is WITH data entered into the fields):
 1. Errors: You must enter data to update. Your update did not save.
2. DEBUG [33] >>> Input FN: null
3. Attempt to de-reference a null object error. 

These are the results that I am getting for the commented code in updateFields() (This is WITH data entered into the fields):
 1. Errors: Can't update First Name. Your update did not save.
2. DEBUG [48] >>> Input FN: null
3. Attempt to de-reference a null object error. 


Does anyone have any idea of why my inputText value is not being passed into the controller? 
Hi all,

I have been working on this for quite some time and I think that I may have to take a different approach. I am trying to convert a "guest user" (Contact) into a Registered (Customer Community) User based on the current Application that is pulled up in a community for company admins. I am doing this by building an extension on the existing controller for the page where agents can pull the application up.

I added a inputText and button to the page where the agent can enter in an email. This code updates the Contact record fine, as well as creates the associated Account. I want the code to update the Account, not create an entirely different one. This is supposed to be handled by passing methods from the original controller, but I'm running into snags here and there where the User is not being created at all and the Account that is created/updated is not being reflected in the Application record. For instance, where a guest user has filled an application they are assigned to "Guest Account" which is a placeholder of sorts for that person's application. This is also visible on the Application record in the Related_object__c field. When I enter an email in the field on my page, it updates the contact information and adds the Contact to "Firstname Middlename Last Name Account" but doesn't not update the Application's Related_Account__c field. 

I'm also unfamiliar with Page References so I may be going about using them incorrectly. 

I currently get an error "Variable does not exist: updatedCon" when I attempt to pass an SObject variable as parameter (declared and returned from changeGuestUser) method. I think I just need another pair of eyes to get this working as I have it thusfar. 

Thanks! 
 
public Contact changeGuestContact(String searchEmail){
        
       // LoginServices.generateAccountName(fname, mname, lname); *Might Still Use This*
        
       //Query for Head_of_Household information on current app
       //Can not move this out of list. 
       //Error! - SObject constructor must use name=value pairs
       List<FC_Member__c> hohContact = new List<FC_Member__c>([Select Contact__r.ID, Contact__r.FirstName, 
                        Contact__r.MiddleName, 
                        Contact__r.LastName, 
                        Contact__r.Email, 
                        ID, 
                        FC_Application__r.Related_Account__c,                                       
                        FC_Application__r.Confirmation_Number__c, 
                        FC_Application__r.Head_of_Household_Name__c
                                                              
                        
                        FROM FC_Member__C 
                        WHERE FC_Application__r.Confirmation_Number__c = :fcord.confnum LIMIT 1]);

        //Create Contact 
        Contact updatedCon = New Contact();
        updatedCon.ID = hohContact[0].Contact__r.ID;
        updatedCon.FirstName = hohContact[0].Contact__r.FirstName;
        updatedCon.MiddleName = hohContact[0].Contact__r.MiddleName;
        updatedCon.LastName = hohContact[0].Contact__r.LastName;
        updatedCon.email = searchEmail;
        
        //
        String newAcctName = LoginServices.generateAccountName(updatedCon.FirstName, updatedCon.MiddleName, updatedCon.LastName);
         Account updatedAccount = new Account(Name=newAcctName);
        
        update updatedAccount;
        
        updatedCon.AccountId = updatedAccount.ID;
        
        
        system.debug('Contact updated: ' +updatedCon);
        update updatedCon;    
        return updatedCon;

        
    }
    
    public FC_Application__c changeApp(Contact updatedCon) { //Line 171 Variable does not exist: updatedCon --> changeApp(updatedCon); 
        
        //query for the current application by confirmation number *The app that is pulled up in AdminTool*
        List <FC_Application__c>  currentApp = new List<FC_Application__c>([SELECT ID,
                                                                    Related_Account__c,
                                                                    Confirmation_Number__c
                                                                    
                                                                    FROM FC_Application__c
                                                                    WHERE Confirmation_Number__c =:fcord.confnum LIMIT 1]); 
     
        FC_Application__c updateApp = new FC_Application__c();
        updateApp.ID = currentApp[0].ID;
        updateApp.Related_Account__c = updatedCon.AccountId;

        
        update updateApp;
        system.debug('Account: ' +updateApp.Related_Account__c);
        
        //Need to set the AccountID/Name from the updatedCon variable to the Related_Account__c variable on the current
        //Application.
         //updatedAccount.Application__c = currentApp[0].ID;
         
         
        
        return updateApp;
    }   
    
    
        public Account changeGuestAccount(Contact updatedCon){
        
        //String newAcctName = LoginServices.generateAccountName(updatedCon.FirstName, updatedCon.MiddleName, updatedCon.LastName);
         //Account updatedAccount = new Account(Name=newAcctName);
        
        //upsert updatedAccount;    
        return null;
        
    }
    
    //Calls LoginServices.createNewApplicant to 'self-register' the Guest into a Customer User
    public Boolean createSuccessful(Contact updatedCon){
        try{
        changeGuestContact(searchEmail);
        LoginServices.createNewApplicant(updatedCon.email, updatedCon.firstname, updatedCon.middlename, updatedCon.lastname);
        system.debug('User created?: ');
        }
        catch (exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Contact not updated'));
            return false;
        }
        return true;
    }
    
    
    
    
    

    
    public PageReference checkEmail(){
        try{
            //setSearchEmail('jdough@test.com');
            //changeGuestContact(searchEmail);
            //changeGuestAccount();
            createSuccessful(updatedCon); //Variable does not exist: updatedCon
            //changeApp(updatedCon); //variable does not exist: updatedCon
            return null;
        } 
        catch (exception e){
           ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Contact not updated'));
         
        }
        return null;
    }





 
We are trying to expedite our project processes. Each project has a couple different tasks associated with it so we thought having a barcode associated with each task so all we have to do is scan the barcode to log time spent, instead of our employees having to login and manually put in all their hours. Any thoughts?