• sfdcbynite
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 34
    Replies

Hi

Tell me what is inputField and what is the use of the field.

Thanks

Anuraj

  • August 31, 2011
  • Like
  • 0

Hi All,

          I have to write a validation rule on when a user is created with first Name as Open TMID , Delegated approver should 

          be same as Manager.But how should i get  Delegated approver and Manager.Can anybody help me out.

 

  With Regards

  Prabhash Mishra

Is there any way to capture when a user has been idle (not done any work) for 15 min? SFDC has a way of checking this internally to initiate automatic logout. We would like, instead of setting the logout at 15 min, to capture that data for reports to management. Any suggestions?

Thanks,
Dovid
When our users log into SFDC they are sent to a "Time Card" page to "punch in." Ideally they are supposed to "punch out" before logging out, but of course they sometimes forget.

What we would like is for them to be reminded or redirected to the time card when trying to log out (or closing the tab/browser). I thought to try this via javascript with the beforeunload event but that triggers the event every time they change pages and it seems that you can\t capture a window close event. So does anyone have an idea how to do this?

Another acceptable solution would be server-side to automatically record into the time card when the session ends. Is there any way to trigger an event on logout/end of session?

Thanks,
Dovid

I have a controller extension which takes a StandardSetController. I have a list button on the Account list view.

And I am using person accounts. 

 

One of the fields in my view filter is based on a Contact field. But since it's a PersonAccount it shows up under the Account filters, as it should.

 

However when I call the getSelected() method in my controller I get the following error:

 

"core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and make sure the object is not in development mode: and (Level__r.Name = 'Intermediate'))) ^ ERROR at Row:2:Column:6 Didn't understand relationship 'Level__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names." 

 

This makes perfect sense as the relationship should be Level__pr and not Level__r. But all this is happening in the getSelected() method which is a Standard method on the StandardSetController, So I have no access in order to properly format the query. This seems like a bug in SFDC to me.

 

Any suggestions? Preferably from somebody in SFDC tech support?

 

Here's a snippet of the code

 

public with sharing class StudentCourseBuilderController {

    private ApexPages.StandardSetController setcontroller;


    public PageReference bulkLoad() {
        List<Account> asts = setController.getSelected(); // FAILING HERE
        if(asts == null || asts.isEmpty())
            return null; //asts = [select id from Account limit 3];
        List<Contact> csts = [select id, accountId, internal_id__c, firstName, lastName, 
                    (select course_id__c from Course_Details__r order by course_id__c desc limit 1)
                    from Contact where accountId in :asts];

 

Until recently, whenever I would hit ctrl-S, not only would eclipse save my code locally, but it would also save to SFDC. A few days ago, for no reason I can see, it stopped. Now it just saves locally and I have to right-click - force.com - save to server which is a pain as it runs in the foreground, not the background, and it's more typing and clicks.

Anybody experienced such a problem? Solution? thanks.
Hey developerforce Admins, when I create a new post or reply, nothing appear in the rich text tab aside from the basic text area. No buttons, no formatting, no way to show code. I have to put in br's just to get line breaks. This is happening in both Chromium and Firefox. Any suggestions?
Obj A has a m-d to child Obj B. On Obj A there is a roll-up summary field bSUM which sums up all field b's in all Obj B children. When the r.u.s filed bSUM updates (recalculates) a trigger is fired on Obj A. Now, this all works when I do actual record creation. But in my unit tests, the SOQL and asserts are getting called before the bSUM has updated, which means no trigger was fired yet and therefore the asserts fail. Anybody know what I can do to delay the assertions until the trigger has fired? My apologies if this post is not formatted properly. For some odd reason I no longer get the rich text editor.
Has anybody tried using the new social contact layout with Person Accounts? If so, how did it work out? Thanks, Dovid
I am making an attempt at using server-side validation for a VF form. I have my validation rules set up. But the problem, as we all know, is that only the first error is displayed. Not good if there are a number of errors. So there is this solution from Bob Buzzard: http://bobbuzzard.blogspot.com/2011/04/field-level-error-messages-with.html But it requires hard coding the fields. Also not ideal as fields, and their validation may change. So I want to use some dynamic apex for this. I saw that DMLException has a getDMLFields() which returns a list of SObjectField tokens for the fields in error. But I haven't yet figured out how to get a handle to the actual instance of the field in order to call the .addError() method. So anybody know how to get a handle to the instance of the field? Or a better solution to the problem? Thanks, Dovid
Does anybody know why sometimes the heap dumps tab and breakpoints are not available when running in a sandbox? Is there some switch I have to flip? Also, unrelated, but has anyone else been having css issues with the forums? I just get all images and text in a centered vertical column with no layout at all. I am running chromium on ubuntu 11.4. strange.
Is it possible to (and if so how) to add apex methods to a custom Sobject? standard Sobject? Or do I need to create a child/wrapper class or utility class? Thanks, Dovid

I am really not sure which way to go on this, so I figured I pose the question to the wonderful force.com dev community.

 

I have a client who is looking to build a SaaS product to help customers manage certain tax records. We anticipate a very large volume of users who will be accessing the system if not every day, then every few days and will enter in their data either via a wizard or directly into a form. They will have the ability to view what they have entered as well as create a pdf to give to their tax preparer and, of course, change their personal settings.

 

So my basic inclination as a force.com developer is to use Authenticated User licenses (this is a custom cloud - no CRM - solution) using visualforce and apex (perhaps with flows) for the wizard and entry forms. But maybe heroku is a better way to go, using database.com on the backend to store the data and force.com for the admins. However, at this point, my ruby on rails knowledge is fairly introductory.

 

Also regarding authentication if going to heroku route, is the best thing to create database.com light user accounts for all customers and handle the authentication with Oauth2 or create the users accounts on the front end with a common database.com user accessing and serving up the records? Or just use the id/password flow to gain access to their records?

 

I understand the virtue of the Oauth2 opt-in model, but it does seem like not such a great user experience. If they are coming to my site and logging in, it then looks a little strange to ask then to confirm that the site can access their information. Wasn't that what the login was supposed accomplish (from their point of view)?

 

So any ideas or advise would be much appreciated.

 

Thanks,

Dovid

We are creating a wizard that leads a user through a number of steps and based on their answer to each question will determine the next question.

 

Assuming I have created VF components to render each question and its only a matter of the logical flow (although this might be a good use case for Dynamic Visualforce Components) and I don't want to hard code the logic, what is the best way to store, parse and assemble the logical flow?

 

Should I create a custom object storing question answer, pointer to next question, or some sort of XML static resource or JSON, or something else?

 

Thanks for any suggestions people have,

Dovid

I asked an Account Exec at SFDC, but she was clueless about database.com pricing.

 

I have 2 questions about the pricing based on the Pricing Page, perhaps someone out there has the answer.

 

1) The base installation includes 3 Standard Users according to the slider. But in the sidebar on the right side, it says 3 Standard Users and 3 Administrators. Does that mean 6 users all together? Or, 3 Standard Users who can have Admin rights?

 

2) What's the difference, practically, between a Standard (access) User and a Lightweight (functional) User? Is it that Standard users can log in to the back end force.com interface that we all love so much and change sharing, security and direct data entry, pull whereas Lightweight Users can only access/write data via the api? Or is there some other difference?

 

Who ever can answer these questions deserves a cookie.

 

Dovid

I have a client that really needs Partner and Customer Portals but is on a shoestring budget and can't afford them. Any suggestions on how to replicate authentication on Sites?

 

Thanks,

Dovid

Maybe this is a silly question, but I have noticed many people have links to their twitter account or blog or images of their SFDC certifications.

 

How do you add that? I don't see any options under Preferences except for a text area for signature and when I tried to add HTML (for links) I got an invalid HTML and it wiped it out. Am I missing something?

 

Also, does anybody know what exactly is the criteria to change s person's status from "Visitor" to "Regular Contributor" to "Trusted Contributor"? I thought it was just a certain number of posts, but then I'll someone with more posts and a status of Visitor and somebody with less posts and a status of Regular Contributor? Just curious.

 

Thanks.

So, I have a trigger that retrieves a bunch of data from other objects and based on that updates a field on the record to be inserted, so I need a before insert trigger, right? right. But then I also need to create some junction objects between the inserted record and some other objects, so I need an after insert trigger. Now the idea of having to duplicate all of that code to do the fetching twice (I am talking performance here) does not give a warm fuzzy feeling. So anyone know a way I can generate the list of junction objects in the before trigger and store that list until the after trigger, add the missing ids, and insert? Or am I doomed to running through all this code twice? Thanks, Dovid

I have a controller extension which takes a StandardSetController. I have a list button on the Account list view.

And I am using person accounts. 

 

One of the fields in my view filter is based on a Contact field. But since it's a PersonAccount it shows up under the Account filters, as it should.

 

However when I call the getSelected() method in my controller I get the following error:

 

"core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and make sure the object is not in development mode: and (Level__r.Name = 'Intermediate'))) ^ ERROR at Row:2:Column:6 Didn't understand relationship 'Level__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names." 

 

This makes perfect sense as the relationship should be Level__pr and not Level__r. But all this is happening in the getSelected() method which is a Standard method on the StandardSetController, So I have no access in order to properly format the query. This seems like a bug in SFDC to me.

 

Any suggestions? Preferably from somebody in SFDC tech support?

 

Here's a snippet of the code

 

public with sharing class StudentCourseBuilderController {

    private ApexPages.StandardSetController setcontroller;


    public PageReference bulkLoad() {
        List<Account> asts = setController.getSelected(); // FAILING HERE
        if(asts == null || asts.isEmpty())
            return null; //asts = [select id from Account limit 3];
        List<Contact> csts = [select id, accountId, internal_id__c, firstName, lastName, 
                    (select course_id__c from Course_Details__r order by course_id__c desc limit 1)
                    from Contact where accountId in :asts];

 

Until recently, whenever I would hit ctrl-S, not only would eclipse save my code locally, but it would also save to SFDC. A few days ago, for no reason I can see, it stopped. Now it just saves locally and I have to right-click - force.com - save to server which is a pain as it runs in the foreground, not the background, and it's more typing and clicks.

Anybody experienced such a problem? Solution? thanks.
Obj A has a m-d to child Obj B. On Obj A there is a roll-up summary field bSUM which sums up all field b's in all Obj B children. When the r.u.s filed bSUM updates (recalculates) a trigger is fired on Obj A. Now, this all works when I do actual record creation. But in my unit tests, the SOQL and asserts are getting called before the bSUM has updated, which means no trigger was fired yet and therefore the asserts fail. Anybody know what I can do to delay the assertions until the trigger has fired? My apologies if this post is not formatted properly. For some odd reason I no longer get the rich text editor.

 

I have a problem with my command link in the code below. Everytime I click on it just refreshes the page and does not go to the next page.

 

<apex:pageBlocktitle="Possible Personal Customer(s)"rendered="{!DisplayPosPersonalRecords == true && checkCustomer = 'No'}">

<apex:pageBlockTablevalue="{!ListPossiblePersonalRecords}"var="per"columnsWidth="5px, 5px"border="1">

 

<apex:columnheaderValue="Options">

  <apex:commandLinkvalue="Selectd"style="font-weight:bold;"action="{!SubmitNewContactMoveToOpp}">

    <apex:paramname="paccId"value="{!per.Id}"assignTo="{!SelectedId}"/>

    <apex:paramname="paccType"value="Ppersonal"assignTo="{!SelectedType}"/>

   </apex:commandLink>

</apex:column>

<apex:columnheaderValue="Customer Name"value="{!per.aName}"width="14.285%"/>

<apex:columnheaderValue="Equation No"value="{!per.EQ}"width="10%"/>

<apex:columnheaderValue="Email"value="{!per.Email}"width="14.285%"/>

<apex:columnheaderValue="Date of Bith"value="{!day(per.DoB)}/{!month(per.DoB)}/{!year(per.DoB)}"width="14.285%"/>

<apex:columnheaderValue="Address"value="{!per.Address}"width="14.285%"/>

<apex:columnheaderValue="Account Officer"value="{!per.AccountOfficer}"width="19.65%"/>

<apex:columnheaderValue="Created Date"value="{!per.CreDate}"width="14.285%"/>

</apex:pageBlockTable>

</apex:pageBlock>

 

 

I have even simplified my apex code so that it only returns the page and still no joy.

 

 

 

public PageReference SubmitNewContactMoveToOpp(){

 

return page.NewLoanOpp_Page_02;

 

}

 

 

Help...pulling my hair out!!

  • January 31, 2012
  • Like
  • 0

Hi All,

 

 Is it possible to update records on  force.com sites?

 

Thanks

Is it possible to (and if so how) to add apex methods to a custom Sobject? standard Sobject? Or do I need to create a child/wrapper class or utility class? Thanks, Dovid

We are creating a wizard that leads a user through a number of steps and based on their answer to each question will determine the next question.

 

Assuming I have created VF components to render each question and its only a matter of the logical flow (although this might be a good use case for Dynamic Visualforce Components) and I don't want to hard code the logic, what is the best way to store, parse and assemble the logical flow?

 

Should I create a custom object storing question answer, pointer to next question, or some sort of XML static resource or JSON, or something else?

 

Thanks for any suggestions people have,

Dovid

Hi

Tell me what is inputField and what is the use of the field.

Thanks

Anuraj

  • August 31, 2011
  • Like
  • 0

Hi,

 

How to integrate the google analytics with salesforce. Any one help me how to solve these.

 

Thanks,

Yamini.

  • August 31, 2011
  • Like
  • 0

one error is null id after insert

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PopAccounttoPayment: execution of AfterInsert caused by: System.StringException: Invalid id: Trigger.PopAccounttoPayment: line 16, column 42: 

 

trigger PopAccounttoPayment on Payment_Line__c (after insert) {
set<ID> setInvID = new set<ID>();

        for(Payment_Line__c Pml : trigger.new){
                if(Pml.Invoice_BC__c != null || Pml.Invoice_BC__c != ''){
                        setInvID.Add(Pml.Invoice_BC__c);
                }
        }   
        
        Invoice_BC__c InvBC = new Invoice_BC__c();
        List<Invoice_BC__c> lstInvBC = [Select id,AccountID__c from Invoice_BC__c Where id in : setInvID];
            if(lstInvBC.size() != 0){
                InvBC = lstInvBC[0];
            }   
        if(InvBC.AccountID__c != null && InvBC.AccountID__c != ''){  
            Payment_Line__c pml = Trigger.new[0];   
            List<Payments__c> lstPm = new List<Payments__c>();
            Payments__c Pm = new Payments__c(id = pml.DocNo__c);
            Pm.AccountID__c = InvBC.AccountID__c;
            lstPm.Add(Pm);
        
            Update lstPm;
        }
}

 Test class

@isTest 
private class TestPopAccounttoPayment{
    static testMethod void myTest() {
    
      Account objAcc = new Account();
      objAcc.Name = 'test';
      insert objAcc;
        
      Opportunities__c objOpp = new Opportunities__c();
      objOpp.Account_Name__c = objAcc.Id;
      insert objOpp;
           
      Quotes__c objQuo = new Quotes__c();
      objQuo.Account_Name__c = objAcc.Id;
      objQuo.OpportunitiesID__c = objOpp.Id;
      insert objQuo;
                
      Sales_Order__c  objSOD = new Sales_Order__c();
      objSOD.Name = 'test4';
      objSOD.OpportunitiesID__c = objOpp.Id;
      objSOD.Quotes__c = objQuo.Id;
      insert objSOD;
      
      Invoice_BC__c  objInvBc = new Invoice_BC__c();
      objInvBc.Name = 'Test5';
      objInvBc.Sales_OrderID__c = objSOD.id;
      objInvBc.AccountID__c = objAcc.id;
      insert objInvBc;
      
      Payments__c objPay = new Payments__c();
      objPay.Name = 'Test2';
      objPay.Due_Date__c = System.Today();
      objPay.AccountID__c = objInvBc.AccountID__c;
      insert objPay;
      
      Test.StartTest();
      Payment_Line__c objPayLine = new Payment_Line__c();
      ApexPages.currentPage().getParameters().put('id', objPay.id);
      objPayLine.Name = 'Test3';
      objPayLine.DocNo__c = objPay.id;
      objPayLine.Invoice_BC__c = objInvBc.id;
      insert objPayLine;
           
      Payments__c objPay2 = new Payments__c();
      ApexPages.currentPage().getParameters().put('id', objPayLine.DocNo__c);
      objPay2.Name = 'Test2';
      objPay2.Due_Date__c = System.Today();
      objPay2.AccountID__c = objInvBc.AccountID__c;
      insert objPay2;
      update objPay2;
      Test.StopTest();
    
    }
}

 thank you so much

On a button click I want to call a method,perform some logic, and then call a pagereference (used elsewhere on the page as well) that then generates a redirect. Is it possible to call a PageReference from apex? If so what is the syntax to do so?

 

Thanks!

Maybe this is a silly question, but I have noticed many people have links to their twitter account or blog or images of their SFDC certifications.

 

How do you add that? I don't see any options under Preferences except for a text area for signature and when I tried to add HTML (for links) I got an invalid HTML and it wiped it out. Am I missing something?

 

Also, does anybody know what exactly is the criteria to change s person's status from "Visitor" to "Regular Contributor" to "Trusted Contributor"? I thought it was just a certain number of posts, but then I'll someone with more posts and a status of Visitor and somebody with less posts and a status of Regular Contributor? Just curious.

 

Thanks.

So, I have a trigger that retrieves a bunch of data from other objects and based on that updates a field on the record to be inserted, so I need a before insert trigger, right? right. But then I also need to create some junction objects between the inserted record and some other objects, so I need an after insert trigger. Now the idea of having to duplicate all of that code to do the fetching twice (I am talking performance here) does not give a warm fuzzy feeling. So anyone know a way I can generate the list of junction objects in the before trigger and store that list until the after trigger, add the missing ids, and insert? Or am I doomed to running through all this code twice? Thanks, Dovid

Hi, I imported 3059 records to a customer object I had created, after first importing a test set of data.  Both imports show as completed successfully in Monitoring Imports Queue, with the full set of reocrds listed, i.e. 180 for first test import then 3059 for second import.  However, when I go to the tab for the custom object created only 183 records are visible. 

 

I have tried adjusting the view to show all records but to no avail.  Does anyone have any ideas.  I initially had this in developmennt but have now deployed the C/Obj as I am happy with it.  But still no additional records.  Help anyone?