• Chenna4a2
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 10
    Replies

Hi,

 

I am having 2 objects student & child

 

Student has start Date field.

 

Child object has lookup to student object & start date field.

 

IF i associate child with student it need to pull the start date on  student &  shld populate on  child. ( working fine bcoz we r performing some action i.e updatig the child record)

 

Question : IF i change start date field on Student object it shld automatically populate Start date on Child without any action performing on child record ??

 

We can't create formula field on child bcoz they will enter manually..

 

Please help ????

 

Thanks,

Chenna

Here i am trying to insert the ShiptoCompanyID by checking whether the SAP Account ID exists on account object , then if not  create new account by populating Shiptocompany ID into  SAP Account ID through integration

 

Its throwing error message:

 

Error:System.ListException: Before Insert or Upsert list must not have two identically equal elements

 

Map<String,SAP_SODO__c> SODO_Map = new Map<String,SAP_SODO__c>();
List<SODO_Line_Item__c> SODO_Lineitems = new List<SODO_Line_Item__c>();

Map<string,List<SODO_Line_Item__c>> SAP_SODO_Lines = new Map<string,List<SODO_Line_Item__c>>();
//list<Account> acclist = new list<Account>();
map<String,Account> AccountIDs = new map<String,Account>();
// map<String,String> ShipSAPCompanyID = new map<String,string>();

//Test changes begin for address fix
List<String> ListShiptoSAPCompanyId = new List<String>();
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
if(oSODOAccount.get('ShipToSAPCompanyID') != null)
{
ListShiptoSAPCompanyId.add((string)oSODOAccount.get('ShipToSAPCompanyID'));
}
}
list<Account> acclist = [SELECT Name, Id,SAP_AccountID__c,BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet,
ShippingCity,ShippingCountry,ShippingPostalCode,ShippingState,ShippingStreet
FROM Account where SAP_AccountID__c IN :ListShiptoSAPCompanyId];

//Test changes end for address fix
// to populate accounts
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
system.debug('Test SODO ITEM ShipToSAPCompanyID::->' + (string)oSODOAccount.get('ShipToSAPCompanyID'));
system.debug('Test SODO Company Name::->' + (string)oSODOAccount.get('BillToCompanyName1'));

}
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
Account oAcc;
boolean foundexistingAcc = false;
system.debug('Test before for SODO ITEM ::->' + (string)oSODOAccount.get('ShipToSAPCompanyID'));
for(Account oExistingAcc :acclist )
{
system.debug('Test inside for loop-1');
system.debug('Test INFO ::' + (string)oSODOAccount.get('ShipToSAPCompanyID')+ '<->'+ oExistingAcc.SAP_AccountID__c);
if(((string)oSODOAccount.get('ShipToSAPCompanyID') != null) && ((string)oSODOAccount.get('ShipToSAPCompanyID') == oExistingAcc.SAP_AccountID__c))
{
oAcc = oExistingAcc ;
foundexistingAcc = true;
system.debug('Test found EXISTING ACCOUNT' + oAcc.id + '<->' + oAcc.Name);
break;
}
}
if(foundexistingAcc == false)
{
system.debug('Test coould not found EXISTING ACCOUNT CREATING NEW' );
oAcc = new Account(); //could not find existing acc... create a new one.

}
else
{
foundexistingAcc = false;

}
if(oSODOAccount.get('ShipToSAPCompanyID') != null)
{
if(oSODOAccount.get('BillToCompanyName1') != null)
{

//ShipSAPCompanyID.put((string)oSODOAccount.get('ShipToSAPCompanyID'),(string)oSODOAccount.get('BillToCompanyName1'));

oAcc.Name =(string)oSODOAccount.get('BillToCompanyName1');
oAcc.SAP_AccountID__c = (string)oSODOAccount.get('ShipToSAPCompanyID');

if(oSODOAccount.get('BillToStreet') != null)
oAcc.BillingStreet = (String)oSODOAccount.get('BillToStreet');

if(oSODOAccount.get('BillToCity') != null)
oAcc.BillingCity = (String)oSODOAccount.get('BillToCity');

if(oSODOAccount.get('BillToState') != null)
oAcc.BillingState = (String)oSODOAccount.get('BillToState');

if(oSODOAccount.get('BillToZipCode') != null)
oAcc.BillingPostalCode = (String)oSODOAccount.get('BillToZipCode');

if(oSODOAccount.get('BillToCountry') != null)
oAcc.BillingCountry = (String)oSODOAccount.get('BillToCountry');

if(oSODOAccount.get('ShipToStreet') != null)
oAcc.ShippingStreet = (String)oSODOAccount.get('ShipToStreet');

if(oSODOAccount.get('ShipToCity') != null)
oAcc.ShippingCity = (String)oSODOAccount.get('ShipToCity');

if(oSODOAccount.get('ShipToState') != null)
oAcc.ShippingState = (String)oSODOAccount.get('ShipToState');

if(oSODOAccount.get('ShipToZipCode') != null)
oAcc.ShippingPostalCode = (String)oSODOAccount.get('ShipToZipCode');

if(oSODOAccount.get('ShipToCountry') != null)
oAcc.ShippingCountry = (String)oSODOAccount.get('ShipToCountry');
}

}
acclist.add(oAcc);
// Test changes ends for account address


}
system.debug('Test UPSERTING ACCOUNTS:::->' + acclist);
// upsert acclist ;//SAP_AccountID__c;
for(Account oacc : [SELECT ID,SAP_AccountID__c FROM Account WHERE ID IN: acclist])
{
AccountIDs.put(oacc.SAP_AccountID__c,oacc);
}
upsert acclist ;

Hi All,

 

Can i hide View & Edit buttons on the lookup pop up page ??

 

 

Thanks

HI All,

 

I am having two custom objects 1)  Roof Details__c  2) Electric Usage__c ( lookup to Roof)..

 

I want to put filters in the lookup on Electric usage record on below criteria

 

  • If  Electric usage record is associated with Roof Details like " Ex: ROOF A" then it shldn't show " ROOF A" if  someone wants to associate with  same "ROOF A" record.

 We just need to show the ROOF B, C, D...... in the lookup filter  that are not associated with the other ....

 

Please help me ??? Thanks in Advance ...

 

Let me know if you need more explanation or not clear about the question ??

 

Thanks,

Chenna

Hi All,

 

I need to  populate Account name as ACC + year created + 9 digits( autonumber)

 

Example: Acc- 2013 - 100000001.......

 

Can anyone help me out ???? Thanks in Advance....

HI,

 

I am getting in this format from integration

 

2013-10-22T00:00:00-07:00

 

Need to convert  like 10/30/2011( MM/DD/YY)

 

Thanks in Advance

Hi All,

 

The class got generated by parsign the .net webservice but when we are trying to send request its throwing error message. There are not multiple bindings, port & Soap12 in it

 

 

System.CalloutException: Web service callout failed: Failed to get next element: Class

 

Any Idea ????

 

Thanks

Hi,

 

Does Salesforce support  this tag while parsing </s:complexType> or it should be like </xsd:complexType> ???

 

Any difference in above tags ?????

Hi,

 

throwing exception when trying to send request .. Any idea??

 

Error message:

 

System.CalloutException: Web service callout failed: Failed to get next element: 

Hi All,

 

I need to send request from salesforce side & need to get response. Below is the class generated from WSDL. ???

 

Please help me out.. thanks in advance..............

 

 

public class hyderabadcom {
public class GUGUWSSoap {
public String endpoint_x = 'http://ws.est.com/GUGUWS.asmx';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'http://ws.test.com/', 'hyderabadcom'};
public String getgugudata() {
hyderabadcom.getgugudata_element request_x = new hyderabadcom.getgugudata_element();
hyderabadcom.getgugudataResponse_element response_x;
Map<String, hyderabadcom.getgugudataResponse_element> response_map_x = new Map<String, hyderabadcom.getgugudataResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://ws.test.com/getgugudata',
'http://ws.test.com/',
'getgugudata',
'http://ws.test.com/',
'getgugudataResponse',
'hyderabadcom.getgugudataResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.getgugudataResult;
}
}
public class getgugudata_element {
private String[] apex_schema_type_info = new String[]{'http://ws.test.com/','true','false'};
private String[] field_order_type_info = new String[]{};
}
public class getgugudataResponse_element {
public String getgugudataResult;
private String[] getgugudataResult_type_info = new String[]{'getgugudataResult','http://ws.test.com/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://ws.test.com/','true','false'};
private String[] field_order_type_info = new String[]{'getgugudataResult'};
}
}

Hi All,

 

Can someone post the example of apex class like how to send request  by using the webservice class generated in salesforce ????

Hi All,

 

I am trying to pull term(days) from entilement template but it says use the right APi Name. Used term as API name still throwing same error message

Hi All,

When i click on this link it should open in new window or tab......

 

<apex:column >
<apex:outputLink value="/{!service.serviceContract.Service_Asset__c}">{!service.sodo.Products__r.Name}</apex:outputLink>
</apex:column>

 

 

HI All,

 

can anybody help me in this class. Its throwing error message as " Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [PricebookEntryId, Quantity, UnitPrice]: [PricebookEntryId, Quantity, UnitPrice] " when trying to insert service contract lineitems

 

Apex class :

 

public static void createContractLineItems(Set<Id> serviceContacts){
set<ID> assetIDs = new set<ID>();
map<ID,String> ProductsMap = new map<Id,String>();
list<ContractLineItem> contLineitems = new list<ContractLineItem>();
Map<Id,PricebookEntry> priceBookIds = new Map<Id,PricebookEntry>();
Set<Id> priceBooks = new Set<Id>();
List<ServiceContract> serviceCons = [select id ,Asset__c,Pricebook2Id from ServiceContract where id in :serviceContacts];
for(ServiceContract oContract : serviceCons)
{
if(oContract.Asset__c != null)
{
assetIDs.add(oContract.Asset__c);
}
if(oContract.Pricebook2Id != null)
priceBooks.add(oContract.Pricebook2Id);
}
if(assetIDs != null && assetIDs.size() > 0){
map<Id,List<Id>> assetMap = new map<Id,List<Id>>();
Set<Id> productIds = new Set<Id>();
List<id> procutsList ;
Map<Id,Asset__c> assetsMap = new Map<Id,Asset__c>([SELECT ID,SAP_SODO__c,SAP_SODO__r.Service_Product__c FROM Asset__c WHERE ID IN: assetIDs]);
for(ServiceContract oContract : serviceCons){
if(oContract.Asset__c != null && assetsMap.containsKey(oContract.Asset__c) && assetsMap.get(oContract.Asset__c) != null){
Asset__c asset = assetsMap.get(oContract.Asset__c) ;
ContractLineItem lineItem = new ContractLineItem(ServiceContractId = oContract.id);
// lineItem.PricebookEntryId = priceBookIds.get(oContract.Pricebook2Id).id ;
// lineItem.Quantity = 1 ;
// lineItem.UnitPrice = priceBookIds.get(serviceProdId).UnitPrice ;
contLineitems.add(lineItem);
system.debug ( '***********' + contLineitems);

}
}
if(contLineitems != null && contLineitems.size() > 0)
insert contLineitems ;
}
}

}

Here i am trying to insert the ShiptoCompanyID by checking whether the SAP Account ID exists on account object , then if not  create new account by populating Shiptocompany ID into  SAP Account ID through integration

 

Its throwing error message:

 

Error:System.ListException: Before Insert or Upsert list must not have two identically equal elements

 

Map<String,SAP_SODO__c> SODO_Map = new Map<String,SAP_SODO__c>();
List<SODO_Line_Item__c> SODO_Lineitems = new List<SODO_Line_Item__c>();

Map<string,List<SODO_Line_Item__c>> SAP_SODO_Lines = new Map<string,List<SODO_Line_Item__c>>();
//list<Account> acclist = new list<Account>();
map<String,Account> AccountIDs = new map<String,Account>();
// map<String,String> ShipSAPCompanyID = new map<String,string>();

//Test changes begin for address fix
List<String> ListShiptoSAPCompanyId = new List<String>();
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
if(oSODOAccount.get('ShipToSAPCompanyID') != null)
{
ListShiptoSAPCompanyId.add((string)oSODOAccount.get('ShipToSAPCompanyID'));
}
}
list<Account> acclist = [SELECT Name, Id,SAP_AccountID__c,BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet,
ShippingCity,ShippingCountry,ShippingPostalCode,ShippingState,ShippingStreet
FROM Account where SAP_AccountID__c IN :ListShiptoSAPCompanyId];

//Test changes end for address fix
// to populate accounts
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
system.debug('Test SODO ITEM ShipToSAPCompanyID::->' + (string)oSODOAccount.get('ShipToSAPCompanyID'));
system.debug('Test SODO Company Name::->' + (string)oSODOAccount.get('BillToCompanyName1'));

}
for(Object olineAccount : SODOLine)
{
map<String,Object> oSODOAccount = (map<string,Object>)olineAccount;
Account oAcc;
boolean foundexistingAcc = false;
system.debug('Test before for SODO ITEM ::->' + (string)oSODOAccount.get('ShipToSAPCompanyID'));
for(Account oExistingAcc :acclist )
{
system.debug('Test inside for loop-1');
system.debug('Test INFO ::' + (string)oSODOAccount.get('ShipToSAPCompanyID')+ '<->'+ oExistingAcc.SAP_AccountID__c);
if(((string)oSODOAccount.get('ShipToSAPCompanyID') != null) && ((string)oSODOAccount.get('ShipToSAPCompanyID') == oExistingAcc.SAP_AccountID__c))
{
oAcc = oExistingAcc ;
foundexistingAcc = true;
system.debug('Test found EXISTING ACCOUNT' + oAcc.id + '<->' + oAcc.Name);
break;
}
}
if(foundexistingAcc == false)
{
system.debug('Test coould not found EXISTING ACCOUNT CREATING NEW' );
oAcc = new Account(); //could not find existing acc... create a new one.

}
else
{
foundexistingAcc = false;

}
if(oSODOAccount.get('ShipToSAPCompanyID') != null)
{
if(oSODOAccount.get('BillToCompanyName1') != null)
{

//ShipSAPCompanyID.put((string)oSODOAccount.get('ShipToSAPCompanyID'),(string)oSODOAccount.get('BillToCompanyName1'));

oAcc.Name =(string)oSODOAccount.get('BillToCompanyName1');
oAcc.SAP_AccountID__c = (string)oSODOAccount.get('ShipToSAPCompanyID');

if(oSODOAccount.get('BillToStreet') != null)
oAcc.BillingStreet = (String)oSODOAccount.get('BillToStreet');

if(oSODOAccount.get('BillToCity') != null)
oAcc.BillingCity = (String)oSODOAccount.get('BillToCity');

if(oSODOAccount.get('BillToState') != null)
oAcc.BillingState = (String)oSODOAccount.get('BillToState');

if(oSODOAccount.get('BillToZipCode') != null)
oAcc.BillingPostalCode = (String)oSODOAccount.get('BillToZipCode');

if(oSODOAccount.get('BillToCountry') != null)
oAcc.BillingCountry = (String)oSODOAccount.get('BillToCountry');

if(oSODOAccount.get('ShipToStreet') != null)
oAcc.ShippingStreet = (String)oSODOAccount.get('ShipToStreet');

if(oSODOAccount.get('ShipToCity') != null)
oAcc.ShippingCity = (String)oSODOAccount.get('ShipToCity');

if(oSODOAccount.get('ShipToState') != null)
oAcc.ShippingState = (String)oSODOAccount.get('ShipToState');

if(oSODOAccount.get('ShipToZipCode') != null)
oAcc.ShippingPostalCode = (String)oSODOAccount.get('ShipToZipCode');

if(oSODOAccount.get('ShipToCountry') != null)
oAcc.ShippingCountry = (String)oSODOAccount.get('ShipToCountry');
}

}
acclist.add(oAcc);
// Test changes ends for account address


}
system.debug('Test UPSERTING ACCOUNTS:::->' + acclist);
// upsert acclist ;//SAP_AccountID__c;
for(Account oacc : [SELECT ID,SAP_AccountID__c FROM Account WHERE ID IN: acclist])
{
AccountIDs.put(oacc.SAP_AccountID__c,oacc);
}
upsert acclist ;

Hi All,

 

I need to  populate Account name as ACC + year created + 9 digits( autonumber)

 

Example: Acc- 2013 - 100000001.......

 

Can anyone help me out ???? Thanks in Advance....

HI,

 

I am getting in this format from integration

 

2013-10-22T00:00:00-07:00

 

Need to convert  like 10/30/2011( MM/DD/YY)

 

Thanks in Advance

Hi,

 

throwing exception when trying to send request .. Any idea??

 

Error message:

 

System.CalloutException: Web service callout failed: Failed to get next element: 

Hi All,

 

Can someone post the example of apex class like how to send request  by using the webservice class generated in salesforce ????

Hi All,

 

I am trying to pull term(days) from entilement template but it says use the right APi Name. Used term as API name still throwing same error message

HI All,

 

can anybody help me in this class. Its throwing error message as " Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [PricebookEntryId, Quantity, UnitPrice]: [PricebookEntryId, Quantity, UnitPrice] " when trying to insert service contract lineitems

 

Apex class :

 

public static void createContractLineItems(Set<Id> serviceContacts){
set<ID> assetIDs = new set<ID>();
map<ID,String> ProductsMap = new map<Id,String>();
list<ContractLineItem> contLineitems = new list<ContractLineItem>();
Map<Id,PricebookEntry> priceBookIds = new Map<Id,PricebookEntry>();
Set<Id> priceBooks = new Set<Id>();
List<ServiceContract> serviceCons = [select id ,Asset__c,Pricebook2Id from ServiceContract where id in :serviceContacts];
for(ServiceContract oContract : serviceCons)
{
if(oContract.Asset__c != null)
{
assetIDs.add(oContract.Asset__c);
}
if(oContract.Pricebook2Id != null)
priceBooks.add(oContract.Pricebook2Id);
}
if(assetIDs != null && assetIDs.size() > 0){
map<Id,List<Id>> assetMap = new map<Id,List<Id>>();
Set<Id> productIds = new Set<Id>();
List<id> procutsList ;
Map<Id,Asset__c> assetsMap = new Map<Id,Asset__c>([SELECT ID,SAP_SODO__c,SAP_SODO__r.Service_Product__c FROM Asset__c WHERE ID IN: assetIDs]);
for(ServiceContract oContract : serviceCons){
if(oContract.Asset__c != null && assetsMap.containsKey(oContract.Asset__c) && assetsMap.get(oContract.Asset__c) != null){
Asset__c asset = assetsMap.get(oContract.Asset__c) ;
ContractLineItem lineItem = new ContractLineItem(ServiceContractId = oContract.id);
// lineItem.PricebookEntryId = priceBookIds.get(oContract.Pricebook2Id).id ;
// lineItem.Quantity = 1 ;
// lineItem.UnitPrice = priceBookIds.get(serviceProdId).UnitPrice ;
contLineitems.add(lineItem);
system.debug ( '***********' + contLineitems);

}
}
if(contLineitems != null && contLineitems.size() > 0)
insert contLineitems ;
}
}

}

Hi All,

 

Salesforce has nice popup feature as in followin link.

 

http://www.4shared.com/photo/FfIWpT_i/popup.html

 

Can we use this feature in our own visualforce page?

 

Thanks in Advance