• Andreas Wissmeyer
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 17
    Replies

Hello all,
I work in a 10-people company, I did a small Lightining app in order to make our everyday Salesforce life better. I developed it in the sandbox, an it works just fine. Now I would like to load it in the production environment (Salesforce).
Components:

Lightning app ==> BASED ON ==> Visualforce Page ==> CALLING A ==> Custom controller (Apex Class) ==> UPDATING A ==> New account field

No problem creating the new account field in PROD environment, but apparently I "Can not create Apex Class on an active organization." Is it possible to overcome this? I would like to avoid long procedures..

Thanks in advance for sharing your knowledge on this one.

Cheers,

Andreas

Hello all,
context is a Lightning app based on a customized VF page over Salesforce1 on a IOS device.

I was able to create a link in order to send an email to a contact just clicking on it (see code extract below). I would like to do the same with a phone, like it happens in the built-in contact page in Salesforce1. Anyone knows how to do it? At the moment I have just a text field which I cannot modify, and using method apex:inlineEditSupport is not really a valid solution in my case.

Below my code:

<apex:repeat value="{!contacts}" var="cont_acc">
      <tr>
          <td>{!cont_acc.Name}</td>
          <td>
                  <apex:outputField value="{!cont_acc.Phone}">                           
                      <apex:inlineEditSupport event="onclick" rendered="true"/>
                 </apex:outputField>
          </td>
          <td>
                  <apex:outputLink value="mailto:{!cont_acc.Email}">{!cont_acc.Email}</apex:outputLink>
           </td>
      </tr>
</apex:repeat>


Thanks in advance for your help on this.

Cheers, A.

Hello all,
this problem is bugging me since days. Below code works as long as the SOQL query is successful (an account is found), else I get the following standard Salesforce error screen:

List has no rows for assignment to SObject 
An unexpected error has occurred. Your development organization has been notified.

Instead of that, I would like to implement a behavior that, both at the beginning or after pressing the NotOK butto, should be able to handle the case: "no accounts found" instead, showing a brief customized error message and then redirectng me to salesforce homepage.

Below my code. I think I lack some basic knowledge, probably some of you is able to provide me with a solution..

public class Account_Controller_2 
{
    public Account account;

    public Account_Controller_2()  {}
    
	public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c      FROM Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c < LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
		return account;
    }
    
    public PageReference NotOK() 
    {        
        account.Ongoing_Problem__c = true;
        account.Last_Update__c = Date.today();
        try 
        {
            upsert(account);
        }	
        catch (Exception e)
        {
            System.debug('NotOk Exception1 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top     of the page to save header information.'));
        }
        update account;
        try
        {
           account = getAccount(); 
        }
        catch (Exception e)
        {
            System.debug('NotOk Exception2 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top of the page to save header information.'));
        }
        return null;
    }
Thanks in advance for your help on this. Cheers, Andi

Hello all,

I have a list of accounts for which I am the product owner. I modified them all today for testing purposes, in order to have my custom field Last_Update__c = today.

In my VF page, I call my custom constructor which does something very simple (please note that I removed the code handling the exceptions for brevity reasons
 

public Account getAccount() 
{
    account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c FROM      Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c = LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
     return account;
 }

The idea should be to retrieve an account only when three conditions are all met. Third one is 
Last_Update__c = LAST_N_DAYS:150. In my understanding, this should mean: "select an account if Last Update was done more than 150 days ago". However, I get every account in the list as a result, even if they all have today as last_update__c field. What am I doing wrong?

Thanks in advance for your help on this.

Cheers, A.

Hello all,

could someone be so kind to explain me the following?

CONTEXT:

CUSTOM CONSTRUCTOR --> CUSTOM VISUALFORCE PAGE --> LIGHTNING APP

In the custom constructor I use the following SOQL query:

public class Account_Controller 
{
    public Account account;
    
    public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Update__c FROM Account 
                       WHERE (OwnerId = :UserInfo.getUserID()) AND (Last_Update__c = LAST_N_DAYS:150) 
                       ORDER BY Last_Update__c DESC LIMIT 1];
    }
  //BUTTON ACTIONS
   public PageReference OK() 
   {
       account.Last_Update__c = Date.today();
       upsert(account);
    }
}

Code is not complete, but just enough to make you get what I'm doing. In the custom page, when clicking an "OK" button upsert(account) is called, I stay on my custom page and the field Last_Update__c is modified to today's date. Everything works fine, but then I would expect that next time I open my Lightning up I get a different account as a result, seen that condition 
Last_Update__c = LAST_N_DAYS:150      shouldn't be met anymore.

So, why I always get the account I just modified and not a new one wit no updates for more than 150 days? What I am missing/doing wrong?

20000 points to the best answer :)

Seriously, thanks in advance for your help on this. Cheers, A
 

Hello all and thanks in advance for your replies on this. I checked similar question but I didn't find something matching my usecase.

My code is really straightforward (it works without GROUP BY): I want to take a series of fields from account when some conditions are met (the last update on an account should be higher than 150 days).

Below the working code (without GROUP BY):

    public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c FROM Account 
                       WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c = LAST_N_DAYS:150) 
                       ORDER BY Last_Update__c DESC LIMIT 1];
        return account;
    }

Adding GROUP BY Last_Update__c system says I should aggregate also Id, if I do it it asks for Name and so on until I aggregate with every possible field in the SELECT. This is already not what I want, but even doing this in the end a get a type incompability.

Is there a simple way to have this grouping having still an account at the end of the process?

And btw, is "Last_Update__c = LAST_N_DAYS:150" correct to get only accounts that have NOT been updated in the last 150 days? Using logic, it should be "Last_Update__c > LAST_N_DAYS:150" but I never get any result if I use this expression, even if many accounts in Salesforce should respect this condition.

A.

Hello all, using the below HTML-Visualforce code...
                    <td>
                        <apex:outputField value="{!account.Last_Status__c}">
                               <apex:inlineEditSupport event="onclick" rendered="true"/>
                        </apex:outputField>
                    </td>

... my outputField is formatted exactly how I want, but I don't have any control on the positioning of the related Edit window once I click on the field I want to modify: result in Salesforce1 Lightning app is a disaster!

Does anyone know how to get control on this window in order to place it in the middle of the screen?

Thanks in advance for your help on this. Cheers from Germany

Hello, I am quite new in Visualfroce so my question could be considered quite stupid by some of you. I apologize for that.

I created a custom VisualForce page listing one account and its related list of contacts. Display was done via a pageBlockTable (see code below), it worked fine but was not optimal to be displayed on a mobile device..            

<apex:pageBlockTable value="{!contacts}" var="cont_acc" columns="3">
                <apex:column value="{!cont_acc.Name}"/>
                <apex:column value="{!cont_acc.Phone}"/>
                <apex:column value="{!cont_acc.Email}"/>
</apex:pageBlockTable>

So I changed strategy, and I am using html formatting+apex:outputField function in order to enhance the layout of the page. It works, but only for the insertion of one single contact. See code extract below (part of a <table> element):

                <tr>
                    <td><apex:outputField value="{!contacts[0].Name}" /></td>                  
                    <td><apex:outputField value="{!contacts[0].Phone}" /></td>
                    <td><apex:outputField value="{!contacts[0].EMail}" /></td>   
                </tr>

Is there something which would allow me to have at the same time all data of pageBlockTable (so the whole list of contacts related to a particular account) but keeping the nice tabular HTML formatting? In other words, something like a C/C++ "for" cycle?

Thanks a lot in advance for your help on this! Cheers from Germany

Hello,
I cannot find a way to add a scrolling bar to my Salesforce1 app, changing the height (in pixels) in the Lighting Force editor is not giving any result. Page is truncated at some point on my phone even if it is not in the Lightning preview.

Any tips?

Hello all,
I work in a 10-people company, I did a small Lightining app in order to make our everyday Salesforce life better. I developed it in the sandbox, an it works just fine. Now I would like to load it in the production environment (Salesforce).
Components:

Lightning app ==> BASED ON ==> Visualforce Page ==> CALLING A ==> Custom controller (Apex Class) ==> UPDATING A ==> New account field

No problem creating the new account field in PROD environment, but apparently I "Can not create Apex Class on an active organization." Is it possible to overcome this? I would like to avoid long procedures..

Thanks in advance for sharing your knowledge on this one.

Cheers,

Andreas

Hello all,
context is a Lightning app based on a customized VF page over Salesforce1 on a IOS device.

I was able to create a link in order to send an email to a contact just clicking on it (see code extract below). I would like to do the same with a phone, like it happens in the built-in contact page in Salesforce1. Anyone knows how to do it? At the moment I have just a text field which I cannot modify, and using method apex:inlineEditSupport is not really a valid solution in my case.

Below my code:

<apex:repeat value="{!contacts}" var="cont_acc">
      <tr>
          <td>{!cont_acc.Name}</td>
          <td>
                  <apex:outputField value="{!cont_acc.Phone}">                           
                      <apex:inlineEditSupport event="onclick" rendered="true"/>
                 </apex:outputField>
          </td>
          <td>
                  <apex:outputLink value="mailto:{!cont_acc.Email}">{!cont_acc.Email}</apex:outputLink>
           </td>
      </tr>
</apex:repeat>


Thanks in advance for your help on this.

Cheers, A.

Hello all,
this problem is bugging me since days. Below code works as long as the SOQL query is successful (an account is found), else I get the following standard Salesforce error screen:

List has no rows for assignment to SObject 
An unexpected error has occurred. Your development organization has been notified.

Instead of that, I would like to implement a behavior that, both at the beginning or after pressing the NotOK butto, should be able to handle the case: "no accounts found" instead, showing a brief customized error message and then redirectng me to salesforce homepage.

Below my code. I think I lack some basic knowledge, probably some of you is able to provide me with a solution..

public class Account_Controller_2 
{
    public Account account;

    public Account_Controller_2()  {}
    
	public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c      FROM Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c < LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
		return account;
    }
    
    public PageReference NotOK() 
    {        
        account.Ongoing_Problem__c = true;
        account.Last_Update__c = Date.today();
        try 
        {
            upsert(account);
        }	
        catch (Exception e)
        {
            System.debug('NotOk Exception1 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top     of the page to save header information.'));
        }
        update account;
        try
        {
           account = getAccount(); 
        }
        catch (Exception e)
        {
            System.debug('NotOk Exception2 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top of the page to save header information.'));
        }
        return null;
    }
Thanks in advance for your help on this. Cheers, Andi

Hello all,

I have a list of accounts for which I am the product owner. I modified them all today for testing purposes, in order to have my custom field Last_Update__c = today.

In my VF page, I call my custom constructor which does something very simple (please note that I removed the code handling the exceptions for brevity reasons
 

public Account getAccount() 
{
    account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c FROM      Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c = LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
     return account;
 }

The idea should be to retrieve an account only when three conditions are all met. Third one is 
Last_Update__c = LAST_N_DAYS:150. In my understanding, this should mean: "select an account if Last Update was done more than 150 days ago". However, I get every account in the list as a result, even if they all have today as last_update__c field. What am I doing wrong?

Thanks in advance for your help on this.

Cheers, A.

Hello all,

could someone be so kind to explain me the following?

CONTEXT:

CUSTOM CONSTRUCTOR --> CUSTOM VISUALFORCE PAGE --> LIGHTNING APP

In the custom constructor I use the following SOQL query:

public class Account_Controller 
{
    public Account account;
    
    public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Update__c FROM Account 
                       WHERE (OwnerId = :UserInfo.getUserID()) AND (Last_Update__c = LAST_N_DAYS:150) 
                       ORDER BY Last_Update__c DESC LIMIT 1];
    }
  //BUTTON ACTIONS
   public PageReference OK() 
   {
       account.Last_Update__c = Date.today();
       upsert(account);
    }
}

Code is not complete, but just enough to make you get what I'm doing. In the custom page, when clicking an "OK" button upsert(account) is called, I stay on my custom page and the field Last_Update__c is modified to today's date. Everything works fine, but then I would expect that next time I open my Lightning up I get a different account as a result, seen that condition 
Last_Update__c = LAST_N_DAYS:150      shouldn't be met anymore.

So, why I always get the account I just modified and not a new one wit no updates for more than 150 days? What I am missing/doing wrong?

20000 points to the best answer :)

Seriously, thanks in advance for your help on this. Cheers, A
 

Hello all and thanks in advance for your replies on this. I checked similar question but I didn't find something matching my usecase.

My code is really straightforward (it works without GROUP BY): I want to take a series of fields from account when some conditions are met (the last update on an account should be higher than 150 days).

Below the working code (without GROUP BY):

    public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c FROM Account 
                       WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c = LAST_N_DAYS:150) 
                       ORDER BY Last_Update__c DESC LIMIT 1];
        return account;
    }

Adding GROUP BY Last_Update__c system says I should aggregate also Id, if I do it it asks for Name and so on until I aggregate with every possible field in the SELECT. This is already not what I want, but even doing this in the end a get a type incompability.

Is there a simple way to have this grouping having still an account at the end of the process?

And btw, is "Last_Update__c = LAST_N_DAYS:150" correct to get only accounts that have NOT been updated in the last 150 days? Using logic, it should be "Last_Update__c > LAST_N_DAYS:150" but I never get any result if I use this expression, even if many accounts in Salesforce should respect this condition.

A.

Hello all, using the below HTML-Visualforce code...
                    <td>
                        <apex:outputField value="{!account.Last_Status__c}">
                               <apex:inlineEditSupport event="onclick" rendered="true"/>
                        </apex:outputField>
                    </td>

... my outputField is formatted exactly how I want, but I don't have any control on the positioning of the related Edit window once I click on the field I want to modify: result in Salesforce1 Lightning app is a disaster!

Does anyone know how to get control on this window in order to place it in the middle of the screen?

Thanks in advance for your help on this. Cheers from Germany

Hello, I am quite new in Visualfroce so my question could be considered quite stupid by some of you. I apologize for that.

I created a custom VisualForce page listing one account and its related list of contacts. Display was done via a pageBlockTable (see code below), it worked fine but was not optimal to be displayed on a mobile device..            

<apex:pageBlockTable value="{!contacts}" var="cont_acc" columns="3">
                <apex:column value="{!cont_acc.Name}"/>
                <apex:column value="{!cont_acc.Phone}"/>
                <apex:column value="{!cont_acc.Email}"/>
</apex:pageBlockTable>

So I changed strategy, and I am using html formatting+apex:outputField function in order to enhance the layout of the page. It works, but only for the insertion of one single contact. See code extract below (part of a <table> element):

                <tr>
                    <td><apex:outputField value="{!contacts[0].Name}" /></td>                  
                    <td><apex:outputField value="{!contacts[0].Phone}" /></td>
                    <td><apex:outputField value="{!contacts[0].EMail}" /></td>   
                </tr>

Is there something which would allow me to have at the same time all data of pageBlockTable (so the whole list of contacts related to a particular account) but keeping the nice tabular HTML formatting? In other words, something like a C/C++ "for" cycle?

Thanks a lot in advance for your help on this! Cheers from Germany

Hello,
I cannot find a way to add a scrolling bar to my Salesforce1 app, changing the height (in pixels) in the Lighting Force editor is not giving any result. Page is truncated at some point on my phone even if it is not in the Lightning preview.

Any tips?

I'm trying to implement functionality that allows a user to type some information and click a button to tag a specific part of a recorded phone call.  I tried inserting a CCTIEditBox in the line display area where custom buttons go, but that doesn't seem to work.  I did verify the XML is being sent, but nothing shows up in the Softphone.  In reading the doc, it seems that perhaps only CTIButton objects can go in that section.  Is this correct?

 

If I can't put the edit box there, is there another way to collect a few words of input from the user based on a custom button click in the Softphone?