• Onttu Lindeman 12
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
I have community users in my partner community. I would like a home page component VF page that would pull the account team off their record and display the list. So all partners are related to an account so they should all link to an account team.
Flow error help
I'm getting these errors
Error element Controlled_Item_Violation (FlowAssignment).
The flow couldn't find the Violation resource

Another
Error element DIEN_Product_Violation (FlowAssignment).
The flow couldn't find the Violation resource.

and 
Error element Unregistered_Vehicle_Violation_Lookup (FlowRecordLookup).
This error occurred when the flow tried to look up records: The flow failed to access the value for OrderItem.Asset__c because it hasn't been set or assigned. For details, see API Exceptions.

These all started at the same time on Sunday and I don't see in the audit trail any changes that could have caused this. Nor do I find much on how to troubleshoot this.
I have community users in my partner community. I would like a home page component VF page that would pull the account team off their record and display the list. So all partners are related to an account so they should all link to an account team.
Hi,

I did the following tuorial:
http://ccoenraets.github.io/getting-started-lightning-components/index.html

And I wonder how to make a div scrollable in a lighning component.
 
<aura:component implements="force:appHostable">

    <div>
        <div>
            <c:AccountMap />
        </div>

        <div>
<!------------ Need to make this component scrollable --------------------->
            <c:AccountList />
        </div>
    </div>

</aura:component>


 
I'm just wondering if its possible to auto populate standard price product value from Standard price book to another custom field? I'm preparing our company app as a product configurator where ideally I would like to manage my pricese in one place in SF. Maybe Apex Code?

Thanks for any ideas and help.

Hi all, 

 

I wrote this apex trigger but it looks like it needs to be bulkified. I keep getting an error when I try to deploy and I was told that I might need to combine some of my queries while using maps. I am not yet that fluent in apex yet so please if you have any suggestions or you kow what I should do can you please look at my code and tell me where I can do that and also actualy show me what you did so that I can use that as reference. This is a trigger to grant a partner sharing access to an end user acount. Thank you.

 

 

 

trigger PartnerSharing onAccount (afterinsert, beforeupdate){

   

    set<id> account_id = new set<id>();

    set<id> account_id1 = new set<id>();

    set<id> account_to = new set<id>();

    set<id> account_to1 = new set<id>();

    set<id> account_from;

    set<id> account_from1;

    map<id,set<id>> ShareFromTo = new map<id,set<id>>();

    map<id,set<id>> ShareFromTo1 = new map<id,set<id>>();

    map<id, AccountShare> matm = new map<id, AccountShare>();

    map<id, AccountShare> matm1 = new map<id, AccountShare>();

    map<id, map<id, AccountShare>> mmatm = new map<id, map<id, AccountShare>>();

    map<id, map<id, AccountShare>> mmatm1 = new map<id, map<id, AccountShare>>();

    map<id, AccountShare> current_matm = new map<id, AccountShare>();

    map<id, AccountShare> current_matm1 = new map<id, AccountShare>();

    map<id, map<id, AccountShare>> current_mmatm = new map<id, map<id, AccountShare>>();

    map<id, map<id, AccountShare>> current_mmatm1 = new map<id, map<id, AccountShare>>();

    map<id, Group> UserRoleMapByRoleID = new map<id, Group>();

    map<id, Group> UserRoleMapByRoleID1 = new map<id, Group>();

    map<id, map<id, Group>> UserRoleMapByRoleIDbyAccountId = new map<id, map<id, Group>>();  

    map<id, map<id, Group>> UserRoleMapByRoleIDbyAccountId1 = new map<id, map<id, Group>>();  

    integer i=0; 

    UserRole urole = new UserRole();

    UserRole urole1 = new UserRole();

    set<id> UserRoleIDs = new set<id>();

    set<id> UserRoleIDs1 = new set<id>();

    // // Create a new list of sharing objects for AccountShare

    list<AccountShare> listnewAccountShare = new list<AccountShare>();

    list<AccountShare> listnewAccountShare2 = new list<AccountShare>();

    AccountShare newAccountShare;

    String roletoggle;

    list<Group> urolelist = new list<Group>();

    

 

    for (Account acc: trigger.new){

    //check trigger old map if is update trigger so this only runs if the field has been changed

            

     /*

     you can remove after insert

     because you cant create the pratner record until after the record is saved

     instead create a validation rule that you can't check the auth support button on a new record

     then do 

     in your for(trigger.new)

     */

    

    if(acc.Authorized_Support_Partner__c != trigger.oldmap.get(acc.id).Authorized_Support_Partner__c){

    if (acc.Authorized_Support_Partner__c == true)

        {

            account_Id.add(acc.id);

    }

    else

    {

        account_id1.add(acc.id);

    }  

    }

   

        }

    //System.debug(Limits.getLimitScriptStatements());   

    if(account_Id.size()>0)

    {

   list<Partner> p1 = new list<Partner>();

   list<Partner> p1_clone = new list<Partner>();

   list<Partner> plist = [Select p.Role, p.AccountToId, p.AccountFromId From Partner p where p.AccountFromId in: account_id];

   for(Partner pc1:plist)

   {

   Partner p1_new = new Partner();

   p1_new.AccountToId = pc1.AccountToId;

   p1_new.AccountFromId = pc1.AccountFromId;

  

   p1_new.Role = 'Channel Partner - Auth Support';

   roletoggle = 'Channel Partner - Auth Support';

   p1_clone.add(p1_new);

   //Apex Class with parameter as list of accountid,role variable ex:partenrsharingclass.clonerecord(account_id,togglingrole);

   

   }

   insert p1_clone; //New ID of Partner Record FOR FURTHER AccountShare you have to Query again  in Partner

   delete plist;

    }

    if(account_Id1.size()>0)

    {

   list<Partner> p1 = new list<Partner>();

   list<Partner> p1_clone1 = new list<Partner>();

   list<Partner> plist1 = [Select p.Role, p.AccountToId, p.AccountFromId From Partner p where p.AccountFromId in: account_id1];

   for(Partner pc11:plist1)

   {

   Partner p1_new1 = new Partner();

   p1_new1.AccountToId = pc11.AccountToId;

   p1_new1.AccountFromId = pc11.AccountFromId;

  

   p1_new1.Role = 'Channel Partner';

   roletoggle = 'Channel Partner';

   p1_clone1.add(p1_new1);

   //Apex Class with parameter as list of accountid,role variable ex:partenrsharingclass.clonerecord(account_id,togglingrole);

   

   }

   insert p1_clone1; 

   delete plist1;

    }

   list<Partner> p = [Select p.Role, p.AccountToId, p.AccountFromId From Partner p where p.AccountFromId in: account_id and role= :roletoggle];

   for(Partner pc: p)

    {

      if(!account_to.contains(pc.accountToId))

        {

            account_to.add(pc.accountToId);

        }

        account_from = new set<id>();

        if(!ShareFromTo.containsKey(pc.accountToId))

        {

            account_from.add(pc.accountToId);

            ShareFromTo.put(pc.accountFromId, account_from);

        }

        else

        {

            

            for(id sfi:ShareFromTo.get(pc.accountToId)){

                if(pc.accountFromId!=sfi){

                    account_from = ShareFromTo.get(pc.accountFromId);

                    account_from.add(pc.accountToId);

                    ShareFromTo.put(pc.accountFromId, account_from);

                }

            }

        }

    }

  

  

    list<Partner> p1 = [Select p.Role, p.AccountToId, p.AccountFromId From Partner p where p.AccountFromId in: account_id1 and role = :roletoggle];

    for(Partner pc1: p1)

    {

      if(!account_to1.contains(pc1.accountToId))

        {

            account_to1.add(pc1.accountToId);

        }

        account_from1 = new set<id>();

        if(!ShareFromTo1.containsKey(pc1.accountToId))

        {

            account_from1.add(pc1.accountToId);

            ShareFromTo1.put(pc1.accountFromId, account_from1);

        }

        else

        {

            

            for(id sfi:ShareFromTo1.get(pc1.accountToId)){

                if(pc1.accountFromId!=sfi){

                    account_from1 = ShareFromTo1.get(pc1.accountFromId);

                    account_from1.add(pc1.accountToId);

                    ShareFromTo1.put(pc1.accountFromId, account_from);

                    //system.debug('ShareFromTo==========> ');

                }

            }

        }

    }

    

    

     list<UserRole> ur1 = [Select u.PortalType, u.PortalRole, u.PortalAccountOwnerId, 

                            u.PortalAccountId, u.Name, u.Id, u.ContactAccessForAccountOwner, 

                            u.CaseAccessForAccountOwner 

                            From UserRole

                            where u.PortalAccountId in :account_to1];

                            

                  

    for(UserRole eur1:ur1)

    {

        UserRoleIds1.add(eur1.id);

    }

         

    list<Group> UserGroups1 = new list<Group>();

    

    UserGroups1 = [Select g.Type, g.RelatedId, g.Id, g.DeveloperName From Group g where g.relatedID in :UserRoleIds1  and g.type = 'Role'];

    map<id, Group> UserGroupsMap1 = new map<id, Group>();

    for (Group gm1: UserGroups1)

    {

        if(!UserGroupsMap1.containsKey(gm1.RelatedId))

        {

       UserGroupsMap1.put(gm1.RelatedId, gm1);

        }

    }

      

   

    for(UserRole uri1:ur1)

    {

        if(!UserRoleMapByRoleIDbyAccountId1.containsKey(uri1.PortalAccountId))

        {

            if(UserGroupsMap1.containsKey(uri1.id)){

                UserRoleMapByRoleID1.put(uri1.id, UserGroupsMap1.get(uri1.id));

                UserRoleMapByRoleIDbyAccountId1.put(uri1.PortalAccountId, UserRoleMapByRoleID1);

            }else{

                //system.debug('Group does Not Exist====================else');

            }

        }

        else

        {

            UserRoleMapByRoleID1 = UserRoleMapByRoleIDbyAccountId1.get(uri1.PortalAccountId);

            if(!UserRoleMapByRoleID1.containsKey(uri1.id))

            {

                if(UserGroupsMap1.containsKey(uri1.id))

                {

                    UserRoleMapByRoleID1.put(uri1.id, UserGroupsMap1.get(uri1.id));

                    UserRoleMapByRoleIDbyAccountId1.put(uri1.PortalAccountId, UserRoleMapByRoleID1);

                }else

                {

                //system.debug('Group does Not Exist');

                }

            }

            else

            {

                //system.debug('User role id already in Map ' + uri1.id);

            }

        }

    }

    

     //list<AccountShare> ls1 = [Select a.UserOrGroupId, a.RowCause, a.OpportunityAccessLevel, a.Id, a.CaseAccessLevel, a.AccountId, a.AccountAccessLevel From AccountShare a where a.AccountId in :account_Id1 limit 50000];

    //system.debug(ls1);

    

    for(AccountShare atm1: [Select a.UserOrGroupId, a.RowCause, a.OpportunityAccessLevel, a.Id, a.CaseAccessLevel, a.AccountId, a.AccountAccessLevel From AccountShare a where a.AccountId in :account_Id1])

    

    {

        if(mmatm1.containsKey(atm1.AccountId))

        {

            current_matm1 = mmatm1.get(atm1.AccountId);

            if(!current_matm1.containsKey(atm1.UserOrGroupId))

            {

                current_matm1.put(atm1.UserOrGroupId, atm1);

                mmatm1.put(atm1.AccountID,current_matm1);

            }

        }

        else

        {

           current_matm1.put(atm1.UserOrGroupId, atm1);

             mmatm1.put(atm1.AccountID,current_matm1);

        }

    }

    

    

    

    

    list<UserRole> ur = [Select u.PortalType, u.PortalRole, u.PortalAccountOwnerId, 

                            u.PortalAccountId, u.Name, u.Id, u.ContactAccessForAccountOwner, 

                            u.CaseAccessForAccountOwner 

                            From UserRole

                            where u.PortalAccountId in :account_to limit 50000];

    for(UserRole eur:ur)

    {

        UserRoleIds.add(eur.id);

    }

    list<Group> UserGroups = new list<Group>();

    

    UserGroups = [Select g.Type, g.RelatedId, g.Id, g.DeveloperName From Group g where g.relatedID in :UserRoleIds  and g.type = 'Role'];

    map<id, Group> UserGroupsMap = new map<id, Group>();

    for (Group gm: UserGroups)

    {

        if(!UserGroupsMap.containsKey(gm.RelatedId))

        {

            UserGroupsMap.put(gm.RelatedId, gm);

        }

    }

    System.debug(Limits.getLimitScriptStatements());

    for(UserRole uri:ur)

    {

        if(!UserRoleMapByRoleIDbyAccountId.containsKey(uri.PortalAccountId))

        {

            if(UserGroupsMap.containsKey(uri.id)){

                UserRoleMapByRoleID.put(uri.id, UserGroupsMap.get(uri.id));

                UserRoleMapByRoleIDbyAccountId.put(uri.PortalAccountId, UserRoleMapByRoleID);

            }else{

                //system.debug('Group does Not Exist');

            }

        }

        else

        {

            UserRoleMapByRoleID = UserRoleMapByRoleIDbyAccountId.get(uri.PortalAccountId);

            if(!UserRoleMapByRoleID.containsKey(uri.id))

            {

                if(UserGroupsMap.containsKey(uri.id))

                {

                    UserRoleMapByRoleID.put(uri.id, UserGroupsMap.get(uri.id));

                    UserRoleMapByRoleIDbyAccountId.put(uri.PortalAccountId, UserRoleMapByRoleID);

                }else

                {

                //system.debug('Group does Not Exist');

                }

            }

            else

            {

                //system.debug('User role id already in Map: ' + uri.id);

            }

        }

    }

    

    //list<AccountShare> ls = [Select a.UserOrGroupId, a.RowCause, a.OpportunityAccessLevel, a.Id, a.CaseAccessLevel, a.AccountId, a.AccountAccessLevel From AccountShare a where a.AccountId in :account_Id limit 50000];

    //system.debug(ls);

    

    for(AccountShare atm: [Select a.UserOrGroupId, a.RowCause, a.OpportunityAccessLevel, a.Id, a.CaseAccessLevel, a.AccountId, a.AccountAccessLevel From AccountShare a where a.AccountId in :account_Id])

    {

        if(mmatm.containsKey(atm.AccountId))

        {

            current_matm = mmatm.get(atm.AccountId);

            if(!current_matm.containsKey(atm.UserOrGroupId))

            {

                current_matm.put(atm.UserOrGroupId, atm);

                mmatm.put(atm.AccountID,current_matm);

            }

        }

        else

        {

  current_matm.put(atm.UserOrGroupId, atm);

             mmatm.put(atm.AccountID,current_matm);

        }

    }

    

       

    

}

Please help me ,

 I create new formula field ( Data type is Number ) for calculate value from text field but system not allow me to calculate it. Do you have any suggest me ?

 

  • March 29, 2011
  • Like
  • 1
I'm trying to create for a custom object type that I have created. When I go to the queue creation page, my custom object type is not showing up in the list of available objects, while other custom object types are. In my case, my object type is part of a master/detail relationship in which the Account object is the master. Is there a limitation on queues in that you cannot create a queue on custom objects that are "detail" objects in the master/detail relationships? I didn't see this mentioned anywhere in the documentation.
  • April 08, 2009
  • Like
  • 0