• Olavo Zapata 14
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hi guys,

I'm trying to use the SOAP API to make an account change owner passing the value to KeepAccountTeam via Apex.

But even after installing the WSDL and executing the account update it's not working.

Someone has made it before and could share a sample code?

 

String username = 'xxx';
String password = 'xxx';

partnerSoapSforceCom.Soap soapObj = new partnerSoapSforceCom.Soap();
partnerSoapSforceCom.LoginResult logResObj = soapObj.Login(username,password);
System.debug('Log results:'+logResObj);

partnerSoapSforceCom.SessionHeader_element sessionObj = new partnerSoapSforceCom.SessionHeader_element();
sessionObj.SessionId = logResObj.SessionId;
soapObj.SessionHeader = sessionObj;


Account acc = new Account(
            Id = '0016g00000c14y8AAA',
            OwnerId = '0056g000005BpIpAAK'
        );

List<String> fields = new List<String>();

sobjectPartnerSoapSforceCom.sObject_x sobj = new sobjectPartnerSoapSforceCom.sObject_x();
sobj.Id = acc.Id;
sobj.fieldsToNull = fields;
sobj.type_x = 'Account';
sobj.OwnerId = acc.OwnerId;
List<sobjectPartnerSoapSforceCom.sObject_x> sobjs = new List<sobjectPartnerSoapSforceCom.sObject_x>();
sobjs.add(sobj);

Enum optsTypes {KeepAccountTeam}
optsTypes keepAcc = optsTypes.KeepAccountTeam;


soapSforceComSchemasClassSoapupdate.SessionHeader_element sessionObj2 = new soapSforceComSchemasClassSoapupdate.SessionHeader_element();
sessionObj2.sessionId = logResObj.SessionId;
soapSforceComSchemasClassSoapupdate.SoapUpdateAccount updateAcc = new soapSforceComSchemasClassSoapupdate.SoapUpdateAccount();
updateAcc.sessionHeader = sessionObj2;

soapSforceComSchemasClassSoapupdate.OwnerChangeOption opt1 = new soapSforceComSchemasClassSoapupdate.OwnerChangeOption();
opt1.execute = true;
opt1.type_x = 'KeepAccountTeam'; // here should be a enum

soapSforceComSchemasClassSoapupdate.OwnerChangeOptions_element changeOptions = new soapSforceComSchemasClassSoapupdate.OwnerChangeOptions_element();
changeOptions.options = (new soapSforceComSchemasClassSoapupdate.OwnerChangeOption[] {opt1});

updateAcc.OwnerChangeOptions = changeOptions;
updateAcc.SoapUpdateAccount('0016g00000c14y8AAA','0056g000005BpIpAAK');

Hi guys,

I'm trying to use the SOAP API to make an account change owner passing the value to KeepAccountTeam via Apex.

But even after installing the WSDL and executing the account update it's not working.

Someone has made it before and could share a sample code?

 

String username = 'xxx';
String password = 'xxx';

partnerSoapSforceCom.Soap soapObj = new partnerSoapSforceCom.Soap();
partnerSoapSforceCom.LoginResult logResObj = soapObj.Login(username,password);
System.debug('Log results:'+logResObj);

partnerSoapSforceCom.SessionHeader_element sessionObj = new partnerSoapSforceCom.SessionHeader_element();
sessionObj.SessionId = logResObj.SessionId;
soapObj.SessionHeader = sessionObj;


Account acc = new Account(
            Id = '0016g00000c14y8AAA',
            OwnerId = '0056g000005BpIpAAK'
        );

List<String> fields = new List<String>();

sobjectPartnerSoapSforceCom.sObject_x sobj = new sobjectPartnerSoapSforceCom.sObject_x();
sobj.Id = acc.Id;
sobj.fieldsToNull = fields;
sobj.type_x = 'Account';
sobj.OwnerId = acc.OwnerId;
List<sobjectPartnerSoapSforceCom.sObject_x> sobjs = new List<sobjectPartnerSoapSforceCom.sObject_x>();
sobjs.add(sobj);

Enum optsTypes {KeepAccountTeam}
optsTypes keepAcc = optsTypes.KeepAccountTeam;


soapSforceComSchemasClassSoapupdate.SessionHeader_element sessionObj2 = new soapSforceComSchemasClassSoapupdate.SessionHeader_element();
sessionObj2.sessionId = logResObj.SessionId;
soapSforceComSchemasClassSoapupdate.SoapUpdateAccount updateAcc = new soapSforceComSchemasClassSoapupdate.SoapUpdateAccount();
updateAcc.sessionHeader = sessionObj2;

soapSforceComSchemasClassSoapupdate.OwnerChangeOption opt1 = new soapSforceComSchemasClassSoapupdate.OwnerChangeOption();
opt1.execute = true;
opt1.type_x = 'KeepAccountTeam'; // here should be a enum

soapSforceComSchemasClassSoapupdate.OwnerChangeOptions_element changeOptions = new soapSforceComSchemasClassSoapupdate.OwnerChangeOptions_element();
changeOptions.options = (new soapSforceComSchemasClassSoapupdate.OwnerChangeOption[] {opt1});

updateAcc.OwnerChangeOptions = changeOptions;
updateAcc.SoapUpdateAccount('0016g00000c14y8AAA','0056g000005BpIpAAK');
Hi,

Does any one know how to display Chatter feeds based on particular record(Account Record) using <forceChatter:feed>?

Here is the code :
<aura:component implements="force:appHostable">

    <forceChatter:feed type="Record" subjectId="001XXXXXXX"/>	   
 
</aura:component>

Here we are populating the parameters as mentioned in the lightning documentation.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_forceChatter_feed.htm
The subjectId is hardcoded with sample account Id.

But the result shows no feeds.

If we change the type to "News", then It shows all the feeds from current user.

We want it to be specific to the Account Id given.

Please help.

Regards,
Sagar Madkaikar