• Aniket Kushwaha
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
    Questions
  • 3
    Replies
trying to create orderpaymentsummary using connectApi gives this error
 ConnectApi.CreateOrderPaymentSummaryOutputRepresentation output = connectApi.OrderPaymentSummary.createOrderPaymentSummaryOutputRepresentation(inpRepresentation);
            
trying to create orderpaymentsummary using connectApi gives this error
 ConnectApi.CreateOrderPaymentSummaryOutputRepresentation output = connectApi.OrderPaymentSummary.createOrderPaymentSummaryOutputRepresentation(inpRepresentation);
            
Hi ,

I created a edit page using visualforce using custom controller but lookup fields are not visible.
How can i get over this.

Thank You.

I have a site for self-registration which calls Site.createPortalUser()  to create a new portal user if it is a new user. It works perfectly on site registration page. The problem now is that I have to capture facebook login and create portal user for facebook users. Current code has callout function to get facebook user's email, userid and username, etc. And then, pass those info to the same function used for site registration page. All parameters are correct, just don't know why Site.createPortalUser()  always give me null userId? Anyone has any idea about this?

  • November 29, 2011
  • Like
  • 0
Hi ,

I created a edit page using visualforce using custom controller but lookup fields are not visible.
How can i get over this.

Thank You.

Greetings,

 

I wrote this little loop while trying to get a list of ALL accounts within a Hierachy regardless of there in the hierachy you start from.

 

For example

A

-----b

-----------b1

-----c

-----------c1

---------------c1.2

-----d

 

So if I start at b1, it will return all accounts up to A and back down thus including c1.2 as well.

 

Maybe someone will find it useful. You could refactor it to work with roles or only go up 1 level to find parent and siblings, etc...

 

 

Account theAccount = //Your SOQL Here
Set<ID> AllParents = new Set<ID>();
Boolean allDone;

AllParents.add(theAccount.ID);
      //If the account we are starting at has a Parent ID, add it
      //to the set of IDs
      if(theAccount.ParentID != Null){
        AllParents.add(theAccount.ParentID);
      }
      
      //Main loop to traverse through the Hierarchy
      do{
         //Set the flag to indicate loop should stop
         allDone = true;
        //Get a list of accounts with IDs or Parent IDs in the AllParents Set
        //This will produce 1 SOQL for each level in the Hierachy 
        //Max is then 99 levels deep which I believe no one will  have
        //You could add a check though
        for(Account a : [Select ID, ParentID From Account Where ID IN :AllParents OR ParentID IN :AllParents]){

          if(!AllParents.contains(a.ID) || ( !AllParents.contains(a.parentID) && a.parentID != null)){

            if(a.parentID != null)
              AllParents.add(a.parentID);

            AllParents.add(a.id);
            //Reset flag to find more parents / children
            allDone = false;

          }
          
        }
        
      } while(allDone == false);