• Shishir VK
  • NEWBIE
  • 0 Points
  • Member since 2010
  • Sr Consultant
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
Hi ,

I am trying to do the follwoing :
  • Get data into apex class in Json format
  • Serialize the Json to a list of Aexp bean**  class (List<MyApexBeanClass> )
I am able to execute the above 2 steps successfully , Next
  • In the constructor of the Bean Class, validate the values being assigned to fields
I tried writting the validation in the constructor (Both Args and NO-Args constructor) , but both these constructor were not invoked when Json class serialize the data to the List of apex class  .

This pattern will allow us to not loop through the instances in the list.

Has anyone come across this kind of apex pattern ? Or has anyone solved anything simillar to this one?

Kindly suggest


 

Hi All,

 

Iam trying to delete the dashboard-components using a Client API application developed in Java.

 

But I can see that the Class DashboardComponent doesn't extend the Class Metadata, hence I am not able to delete them from the Environment. The Class DashboardComponent just implements the interface: "Serializable".

 

Can you please suggest how can I delete these dashboard components using the Java API?

 

Its quite urgent.

 

Thanks in advance.

Shishir

Hi,


My main aim is to add some addition info to the data base after all the batchs are complete.. hence I need to invoke a database insert in the "final()" method of the Apex-batch job.


But I can see that the insert method is not called inside the finish() method. In fact i cannot even see the Syste.debug() messages added inside the finish() method.


Am sure that there is no exception been thrown inside the finish, as the status of the batch job is shown as completed (Also I have added an try catch block to doubl-check).


Please find below the sample code for your kind reference:


global class BatchAccountData implements Database.Batchable<SObject>{

// define a global variable:

List<My_CusObj__c> mylst = new List<MyCusObj__c>()

global Database.QueryLocator start(Database.BatchableContext bc) {
         Database.QueryLocator queryLocator = Database.getQueryLocator("select name,id from account");
         return queryLocator ;
   }

global void execute(Database.BatchableContext BC,
                              List<Account> accountListParam){

    for(Account acc: accountListParam ){
        MyCusObj__c obj = new MyCusObj__c();
      obj.Name = acc.Name+Bc.getJobId();
       mylst.add(obj);
    }
}

global void finish(Database.BatchableContext BC){
  insert mylst;    
}

}

Please provide me with your inputs, so that I can accomplish the aim.


Thanks in advance

Hi All,

 

Using MetaData API (ver 18), I am trying to create Custom-Reports under a given Report-Folder. example : Create Report : "Account Report - Test" , under the ReportFolder : "Sample Reports Folder" .

 

So far I am able to create report-folders and custom-reports seperately...

 

But when i try to associatate a report with a report-folder using the MetaData API classes,  Iam not able to find any options/fucntions/methods to do so.

 

Please note: To create custom-reports Iam using Report class provided in the MetaDat API pack, and to create the report-folder I am using the class: "ReportFolder" provided in the MetaData API pack.

 

 

Please help me resolve this trick!!!

 

Thanks in advance,

 

Regards

Shishir

 

Hi everyone,

 

I am  currrently working on following setup.
1.Pingfederate-6.6.0
2.Windows-IWA-Integration-Kit-2-6
3.Salesforce-Connector-4-1
3.RHEL 5.3 x86_64

i am trying to integrate pingfedearte-6.6.0 with salesforce.

 

I have created the Digital signing certificate in Ping federate. In Salesforce enabled the SSO settings and fill the details of SSO settings. Imported the Digital signed certificate in SSO settings. When i access the SSO endpoint url https://idp-url:9031/idp/startSSO.ping?PartnerSpId=https://saml.salesforce.com  through browser im getting the issue like,

 

Login Error Your login attempt using single sign-on with an identity provider certificate has failed. Please contact your salesforce.com administrator for more information.”

 

Am i doing anything wrong while creating certificate or want to  do any modifications?

 

Please suggest me on this. Im in very critical Position.

 

 

Regards,

Karthick.

I hate dead code.  And I hate dead reports.  I'd like to be able to query against the Custom Report Types in our instance and return whether or not there are active reports authored against those Custom Reports.  Is there any way to do this?  I can't find any report types in the DataLoader nor in the salesforce.schema
  • September 29, 2009
  • Like
  • 0

Hi, I am trying to get names of all the reports in a particular folder using Metadata API. ListMetadata only gives the Full name of the report which looks like "Custom_Folder/custom_sample_report" where as i want "custom sample report".

 

The only place where i can find a report name is in the Custom_Folder/custom_sample_report.report XML file. But if i have 1000 reports in a folder i have to parse all the 1000 files and get the report name, which does not looks like a good idea.

 

Is there any other easy way, please advise.

 

/G

I'm attempting to query the service using the ListMetadataQuery and the ListMetadata() method for:

Documents, Email Templates, Reports, and Dashboards.

 

These items require a value in the ListMetadataQuery.folder value. But I'm unable to determine (via the API) the names of the folders.

 

When I initially call the describeMetadata(), it returns these components in the DescribeMetadataResult.metadataObjects. It also shows that these are in a folder

(DescribeMetadataObject.inFolder = true), but I cannot find a clue as to the names of the folders.

 

/// <summary> /// BuildMetadata queries the server for all the names of components (types) /// in the org. /// </summary> /// <returns>A Package object containing information for each type</returns> public Package BuildMetadata() { Package package = new Package(); package.version = apiVersion.ToString(); try { SortedDictionary<string, PackageTypeMembers> alltypes = new SortedDictionary<string, PackageTypeMembers>(); // Assuming that the SOAP binding has already been established. DescribeMetadataResult res = metaService.describeMetadata(apiVersion); if (res != null && res.metadataObjects.Count() > 0) { foreach (DescribeMetadataObject obj in res.metadataObjects) { if (obj.childXmlNames != null) { foreach (string name in obj.childXmlNames) { if (name != string.Empty) { PackageTypeMembers childcomponent = new PackageTypeMembers(); //childcomponent.name = obj.xmlName + "." + name; childcomponent.name = name; alltypes.Add(childcomponent.name, childcomponent); } } if (!alltypes.ContainsKey(obj.xmlName)) { PackageTypeMembers parentcomponent = new PackageTypeMembers(); parentcomponent.name = obj.xmlName; alltypes.Add(parentcomponent.name, parentcomponent); } } else { if (!alltypes.ContainsKey(obj.xmlName)) { PackageTypeMembers component = new PackageTypeMembers(); component.name = obj.xmlName; alltypes.Add(component.name, component); } } } } package.types = alltypes.Values.ToArray(); } catch (Exception ex) { Console.WriteLine("\nFailed to describe metadata, error message was: \n" + ex.Message); throw ex; } return package; } /// <summary> /// listMetadata retrives all the members of the requested component (type) /// </summary> /// <param name="component">Name of component (Report, CustomObject, ApexClass)</param> /// <returns>A list of names of the objects of that type</returns> public List<string> listMetadata(string component) { SortedList<string, string> results = new SortedList<string, string>(); FileProperties[] lmr = null; try { string optionalFolder = ""; string comp = component; if (component.Contains(".")) { string[] path = component.Split('.'); optionalFolder = path[0]; comp = path[1]; } // <=== These are hard coded folder names, because I don't know how to // find the names of the folders to request else if (component == "Dashboard") optionalFolder = "My Personal Dashboards"; else if (component == "Document") optionalFolder = "My Personal Documents"; else if (component == "EmailTemplate") optionalFolder = "My Personal Email Templates"; else if (component == "Report") optionalFolder = "My Personal Custom Reports"; ListMetadataQuery query = new ListMetadataQuery(); query.folder = optionalFolder; query.type = comp; try { lmr = metaService.listMetadata( new ListMetadataQuery[] { query }); } catch (Exception ex) { Console.WriteLine("\nFailed to list metadata, error message was: \n" + ex.Message); } if (lmr != null) { foreach (FileProperties n in lmr) { if (!results.ContainsKey(n.fullName)) results.Add(n.fullName, n.fullName); Console.WriteLine("Component fullName: " + n.fullName); Console.WriteLine("Component type: " + n.type); } } } catch (Exception ex) { Console.WriteLine("\nFailed to list metadata, error message was: \n" + ex.Message); throw ex; } return results.Values.ToList(); }

 

 
I am having problems getting the EmailAgent60 working.  It runs, and my config is correct as it connects to the mail server, but I am receiving a java.lang.NullPointerException any time it tries to process an email.  I've tried sending from different mail clients and it makes no difference.  I know people are using this application, so I'm not sure what the problem is.  It's an Exchange 2003 server.

I'm a developer, but not a Java developer, so I've been struggling with Eclipse trying to get the app built and running.  I've been able to build the app and resolved an issue with the j2sdk version (1.4.2_12) it was building with.  However, when running  SalesforceAgent, I get an error from the Java VM "Could not find the main class".  The Console in Eclipse shows "java.lang.UnsupportedClassVersionError: com/sforce/SalesforceAgent (Unsupported major.minor version 49.0)"

Can anyone help?

Thanks