• Pronow
  • NEWBIE
  • 55 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 47
    Replies
Hello there,

I am facing this error on my DEV sandbox since 2 days however, the codebase is same among all my instances including Production.

Some of the pages on my sites display this error message:

Illegal assignment from LIST<User> to LIST<user>

The code to which I am getting this error message:

1. List<OAuth_Token__c> l = [SELECT OAuth_Service__r.name, isAccess__c, Owner__r.name, Owner__r.Id FROM OAuth_Token__c WHERE OAuth_Service__r.name= :serviceName AND isAccess__c = true];
2.         Set<Id> setUserIds = new Set<Id>();
3.        for(OAuth_Token__c t : l)
4.             setUserIds.add(t.owner__r.Id);
5.         if( !setUserIds.isEmpty() )
6.            List<User> result = [SELECT Id, Name FROM User WHERE Id IN: setUserIds ]; // error line
7.       else
8.            return null; 

The above error is on line no 6.

Thanks in advance.


  • September 19, 2014
  • Like
  • 0
Hello there,

I want to understand the use of these two fields on User object:

1. Start of day
2. End of day

Please advice.

Thanks in advance.
Hello there,

I have a junction-like object of two lookup fields. Now I want those two fields to be read-only on their page layouts. How can I make it?

I used all ways like Page Layout, Field level security, Profiles, etc.

Please help.

Thanks in advance.
Hello there,

Please tell me if is there any way by which I can insert Username and Password into the Visualforce Email Template?

Thanks in advance.
Hello there,

I am using Site.createPortalUser(user, accountId, password); method to create a Customer Portal User. However, it returns null everytime. And I receive an email with error: 'The default new user profile is not assigned to the portal. Registration from General_Pages is not able to create portal users.' 

I am assigning ProfileId to user. Please help me through this.

Thanks in advance.
  • February 10, 2014
  • Like
  • 1
Hello there,

I get a JSON string from Javascript remoting function like this: '{"Name":"abc", "City":"xyz", "SobjectType":"Contact", "RecordTypeId":"Ab162EqwQDS5"}';

Now, I want to create sObject according to the field values received into the above string. How can I do this?

I refered Serialize and Deserialize methods of Apex JSON, however, they need ApexType as destination Class. They does not convert values directly into sObjects.

Shall I use JSON Parser methods? If yes then how?

Thanks in advance.
  • February 07, 2014
  • Like
  • 0
Hello there,

I have a weired problem while deploying change sets to production. I am trying to deploy an updated trigger, and it gives warning that Trigger and Class Code Coverage is 0% and it should be 75% atleast. Now, previously, I deployed many classes(only classes), it didn't throw such an error.

I need proper understanding of difference between deploying Triggers and classes. Does same procidure applies for same or it differs.  

Thanks in advance.
  • January 31, 2014
  • Like
  • 0
Hello there,

I have this trigger,

trigger OnProjectUpdate on Project__c (after update, before update)
{
Triggers__c projectTrigger = Triggers__c.getInstance('OnProjectUpdate');
if( projectTrigger.Active__c )
{
     OnProjectUpdate.createFeedbackForVolunteer(Trigger.new, Trigger.old); 
     OnProjectUpdate.updateVolunteerFields(Trigger.new);   
}
}

Whenever, I do RunAll tests it gives error as follows:

System.DmlException: Insert Failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, these is already an item in this list with the name OnProjectUpdate: [name]

As I know this trigger is on UPDATE, it should not throw error on INSERT.

Please help.

Thanks in advance.
  • January 30, 2014
  • Like
  • 0

Hello guys,

 

I am trying to prepare a combined list of custom objects. For that I have created a wrapper class.

 

I want to display records in that wrapper class object on VF page using all pagincation functions that StandardSetController provides.

 

As I am trying to call StandardSetController its gives error. The Code is:

 

standardSetRelatedNPOs = new ApexPages.StandardSetController(lstNPOSchoolWrapper);

 

The error:

 

Constructor not defined.

 

Shall I need to create Custom Set Controller or something else. If yes, then how? Please help.

 

Thanks in advance.

  • September 12, 2013
  • Like
  • 0

Hello there,

 

I am calling an <apex:actionfunction> from Javascript and it is giving error.

 

<apex:actionFunction name="showPrtnerList" action="{!ConfirmZip}" rerender="partnerOrgByZip,partnerListId" status="actionStatus">
     <apex:param name="field" value="" assignTo="{!StrZipCode}"></apex:param>
</apex:actionFunction>

<apex:inputText value="{!MailingPostalCode}" id="PostalCodeE" styleClass="textBig" onblur="javascript&colon;showPrtnrLst('{!$Component.PostalCodeE}');"/>

 

onBlur event of <apex:inputText> is causing to call Javascript function:

 

function showPrtnrLst(field)
            {
                var StrZipCode = '';
                StrZipCode = document.getElementById(field).value;
                showPrtnerList(StrZipCode);
                alert(1);
            }

 

The above method is getting called. The actionFunction "showPrtnerList" is also getting called. Coz, alert(1); is also getting executed.

 

The method related to <apex:actionFunction> is not working fine.

 

Please help.

 

Thank you in advance.

 

  • August 13, 2013
  • Like
  • 0

Hello there,

 

I am using Javascript remoting in my Project.

 

Apex code:

 

@RemoteAction
    public static String ConfirmZip(String strZipCode)
    {
          List<Partner_Postal_Code__c> lstPostalCode = Partner_Postal_Code__c.getall().values();
          Boolean bIsNrToPrtnr = false;
          Integer iPartnerCount = 0;
          Set<Partner_Postal_Code__c> lstPrtnrPostalCode;
          String strUrl;
          for( Partner_Postal_Code__c postalCode : lstPostalCode )
          {
              if( strZipCode == postalCode.Postal__c )
              {
                  lstPrtnrPostalCode.add(postalCode);
                  bIsNrToPrtnr = true;
              }
              else
                  bIsNrToPrtnr = false;
              if( bIsNrToPrtnr )
                  iPartnerCount += 1;
          }    
          if( lstPrtnrPostalCode != null && lstPrtnrPostalCode.size() > 1 )
              return 'SelectPartnerOnRegPopUp?id=strZipCode';
          else
              return null;
    }

 

Visualforce Code:

 

<script type="text/javascript">

        function partnerPopUpForZip(field)
        {
            var StrZipCode = '';
            StrZipCode = document.getElementById(field).value;
            alert(StrZipCode);
            Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.VolunteerRegistration.ConfirmZip}', '411016',
                function(result, event)
                {
                    if(event.status)
                    {
                        var = result;
                        alert(result);
                        prtnrPopUp = window.open(url,'wndAddItems','scrollbars=1,width=480,height=360,resizable=1');
                        prtnrPopUp.moveTo(iTop,iLeft);
                    }
                   },
                   {escape: true}
            );
        }

</script>

 

Code to call javascript method:

 

<td>
        <apex:inputText value="{!Volunteer.MailingPostalCode}" id="zipe" styleClass="textSmall" onblur="javascript&colon;partnerPopUpForZip('{!$Component.zipe}');" />                                               
</td>

 

The page loads properly. But, whenever I call that Javascrpt method through OnBlur event it says 'partnerPopUpForZip is not defined'.

 

Please help.

 

Thanks in Advance.

Hello there,

 

I want to know whether I can change the 'Manage External User' functionality on the Contact object. Actually this functionality allows us to login to Customer Portal using Username and Password of that Contact's associated User.

 

I am using Sites intead of customer portal. And I want to login to my sites using a this functionality.

 

Please guide me for this. Thanks in advance.

Hello there,

 

I have a test method that is using following code:

 

01.    protected virtual HttpResponse executeLinkedInRequest(HttpRequest req)
02.    {
03.        HttpResponse res;
04.        res = new Http().send(req);
05.            
06.            if (req.getMethod() == 'POST' && res.getStatusCode() != 201)
07.            {
08.                System.debug('OAuth header:'+res.getHeader('oauth_problem'));
09.                throw new TwitterApiException (res.getBody());
10.            }
11.            else if (req.getMethod() == 'GET' && res.getStatusCode() != 200)
12.                throw new TwitterApiException (res.getBody());
13.        return res;
14.    }

 

When I am running the Test Class which contains this code, it is running till line number 04. Rest of the code comes in Red lines i.e. they are not getting executed. I know the root of the problem is HTTP().send(req) method. But, I am not able to understand why is that causing problem and how to make it work. Please help.

 

Thanks in advance.

Hello there,

 

I have created a new Profile in my portal. I have created its users. I have a forgot password functionality implemented on my project. That functionality works for old profiles, however not working now for newly created profile.

 

Please, help with this issue.

 

The page display default erro message : " Your username was not found. ", when I enter username and press "Submit" button.

 

Thank you in advance.

  • April 19, 2013
  • Like
  • 0

Hello there,

 

I have a strange problem with <apex:outputPanel>, rendered="" attribute. In my controller, I have an Integer variable. On first load of the VF page, the value is non-negative. I have a search functionality, that causes to call {!onLoad} method. This method makes the value to 0(zero).  Now, when I try to rerender that outputPanel, its does't re-render even though the value of the variable is zero or negative.

 

Please help.

 

Thank you in advance.

 

This is VF <apex:outputPanel> :

 

<apex:outputpanel rendered="{!IF(volResultSide > 0, false, true)}">
<tr class="EvenRow" height="40px" style="padding-top:16px;padding-left: 15px;padding-right: 4px">
<td class="column">No Volunteers found!</td>
</tr>
</apex:outputpanel>

  • April 03, 2013
  • Like
  • 0

Hello there,

 

I have used Campaign and CampaignMembers objects in my project. I want to use StandardSetController to paginate them on Portal. However, it is allowing me to do so using General Site User Profile, not allowing me using Customer Portal User Profile.

 

Please tell me a way or a way around to do this. Help will be really appreciated.

 

Thank you in advance.

  • March 12, 2013
  • Like
  • 0

Hello there,

 

Following code is giving me unknown error:

 

String strFetchMatchesQuery = 'Select m.Project__r.Project_Title__c,m.Project__r.Template__r.Max_Estimated_Hours_for_Volunteer__c,m.Project__r.Projected_Hours__c, m.Volunteer__r.AccountId, m.Project__r.Organization__r.Name, m.Project__r.Volunteer__r.Name, m.Volunteer__r.Name, m.Project__r.Status__c,m.Project__r.Actual_Hours__c,m.Project__r.ProjectNickname__c,m.Project__r.Volunteer_Projected_Hours__c, m.Project__r.Name From Match__c m where m.Volunteer__c IN ('+ strVolunteerId + ') AND ( m.Project__r.Status__c = \'Active\' OR m.Project__r.Status__c = \'Closed\' OR m.Project__r.Status__c = \'Incomeplete\')';

 

lstMatch = Database.Query(strFetchMatchesQuery);

 

ApexPages.StandardSetController matchActivityStandardSet = new ApexPages.StandardSetController(lstMatch);

 

Well, I am tracking the the corresponding Customer User Portal in developer console. Loading the page causes above code to fire. And code execution status is coming as "Success". But, I am not able to track the problem.

 

Please help.

 

Thanks in advance.

  • March 06, 2013
  • Like
  • 0

Hello there,

 

I want to display a string variable of Page Controller on its corresponding Visualforce Page. I can do it using forllowing code:

 

<apex:outputText style="font-style:italic" value="{!strOperationStatus}"/>

 

However, {!strOperationStatus} is a string variable. That variable contains some HTML code. But, visualforce page displays that content with Tags like this:

 

<HTML><P>....some contents....</p></HTML>

 

I want to display contents only.

 

Please tell me a way t do this. I want to do this in this perticular way only as this string will be dynamic.

 

Thank you.

 

  • February 07, 2013
  • Like
  • 0

Hello there,

 

In my project, on an object I have two fields. One is an auto-update and other is a formula field. Auto-update field contains 'Current Date' value ( 'TODAY()' ). Formula field is number type, calculating difference in days between a custom DATE field and above auto-update DATE field.

 

I am trying to trigger, a workflow rule that will fire when value of formula field would be 30 or 60.

 

Please help me out as the workflow is not getting triggered when the above formula evaluates to true.

 

Thank you in advance.

  • January 17, 2013
  • Like
  • 1

Hello there,

 

I have two visualforce pages. From one visualforce page, I am passing two parameters to other page. Inside, first page's controller, I am logging in using Site.login(username, password, startUrl) method. Inside the "startURL" (string), I am including target URL with two parameters. But on landing to target page, I am receiving only first parameter. Second parameter is missing.

 

The target URL: "../WithdrawProject?ProjectId=a0KJ0000001UNLJMA4&toBeWithdrawn=no". On the landing page, I am getting this URL: "../WithdrawProject?ProjectId=a0KJ0000001UNLJMA4"

 

Please help.

 

Thank you in advance.

 

 

 

  • January 09, 2013
  • Like
  • 0
Hello there,

I have a junction-like object of two lookup fields. Now I want those two fields to be read-only on their page layouts. How can I make it?

I used all ways like Page Layout, Field level security, Profiles, etc.

Please help.

Thanks in advance.
Hello there,

I am using Site.createPortalUser(user, accountId, password); method to create a Customer Portal User. However, it returns null everytime. And I receive an email with error: 'The default new user profile is not assigned to the portal. Registration from General_Pages is not able to create portal users.' 

I am assigning ProfileId to user. Please help me through this.

Thanks in advance.
  • February 10, 2014
  • Like
  • 1

Hello there,

 

In my project, on an object I have two fields. One is an auto-update and other is a formula field. Auto-update field contains 'Current Date' value ( 'TODAY()' ). Formula field is number type, calculating difference in days between a custom DATE field and above auto-update DATE field.

 

I am trying to trigger, a workflow rule that will fire when value of formula field would be 30 or 60.

 

Please help me out as the workflow is not getting triggered when the above formula evaluates to true.

 

Thank you in advance.

  • January 17, 2013
  • Like
  • 1
Hello there,

I am facing this error on my DEV sandbox since 2 days however, the codebase is same among all my instances including Production.

Some of the pages on my sites display this error message:

Illegal assignment from LIST<User> to LIST<user>

The code to which I am getting this error message:

1. List<OAuth_Token__c> l = [SELECT OAuth_Service__r.name, isAccess__c, Owner__r.name, Owner__r.Id FROM OAuth_Token__c WHERE OAuth_Service__r.name= :serviceName AND isAccess__c = true];
2.         Set<Id> setUserIds = new Set<Id>();
3.        for(OAuth_Token__c t : l)
4.             setUserIds.add(t.owner__r.Id);
5.         if( !setUserIds.isEmpty() )
6.            List<User> result = [SELECT Id, Name FROM User WHERE Id IN: setUserIds ]; // error line
7.       else
8.            return null; 

The above error is on line no 6.

Thanks in advance.


  • September 19, 2014
  • Like
  • 0
Hello there,

I am using Site.createPortalUser(user, accountId, password); method to create a Customer Portal User. However, it returns null everytime. And I receive an email with error: 'The default new user profile is not assigned to the portal. Registration from General_Pages is not able to create portal users.' 

I am assigning ProfileId to user. Please help me through this.

Thanks in advance.
  • February 10, 2014
  • Like
  • 1
Hello there,

I get a JSON string from Javascript remoting function like this: '{"Name":"abc", "City":"xyz", "SobjectType":"Contact", "RecordTypeId":"Ab162EqwQDS5"}';

Now, I want to create sObject according to the field values received into the above string. How can I do this?

I refered Serialize and Deserialize methods of Apex JSON, however, they need ApexType as destination Class. They does not convert values directly into sObjects.

Shall I use JSON Parser methods? If yes then how?

Thanks in advance.
  • February 07, 2014
  • Like
  • 0