• Bramha1
  • NEWBIE
  • 24 Points
  • Member since 2011

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

Hello,

 

   I have a custom Object Test__c and a User "Test User" with profile "Test Profile" which doesn't have access to this Object.

 

  I want to check if isQueryable() will work on this object.

 

 So i have done,

 

 

SObjectType objectType = Test__c.getSObjectType();

Schema.DescribeSObjectResult objectDescription = objectType.getDescribe();

System.debug('******OBJ ACC'+objectDescription.isQueryable());

 

if(objectDescription.isQueryable()) {

 

// If true Do some processing

 

}

 

Even though i dont have access to this object i am able to query it. Can any one let me know if i need to make any changes in the permissions or any thing else i am missing.

 

Thanks

Reddy

Hi,

 

     I know how to compare strings and Integers, but i am looking for something like below:

  I have 3 strings :

 

 String str1 =  ' abcd' ;

String  str2 = ' cded' ;

String str3 = ' ==' ; ( This is a oparator and can be any != OR > OR < OR any operator) 

 

Now i need a method or any way to check the above three so that i get a boolean value back based on these three arguments.

 

 

Thanks

Bramha

 

 

Hello,

 

  I am using Apex Sharing rules and i want to find out the Type( if the UserGroupid is a User or a Group) of the UserGroupId. Is there any way to get the Type along with the Sharing Query ?

 

Object__Share == [Select Id, UserOrGroupId, Type from Object__Share  where ParentId = 'xxxx' and UserOrGroupId = 'yyyy'];

 

is there a way to identofy the Type. I know i can do the query search and find out if it is Usre or Type.

 

Cheers

 

Bramha

Hi,

 

    I have a doubt to get the MarkUp of ApexPages by Querying the markup of the ApexPage. But is there any way to include the markup of the component if at all a Page has 1 or more components.

 

Eg: Page1 has 2 components Comp1 and Comp2.

 

When i get the markup of Page1 (like ApexPage page = [select markup from apexpage where Name = 'Page1']; ) ,  is it possible to identify the components in that page and also get their markup as well?

 

 

Thanks

 

Bramha

  • September 13, 2011
  • Like
  • 0

Hi,

 

  Is there a way to have diffenet page layouts for diffenet views in salesforce. Eg: I want to have a page layout for NEW and a different page layout for EDIT & VIEW.

 

Is there any option i can do?

 

 

Cheers

Bramha

  • September 08, 2011
  • Like
  • 0

Hi,

  I have a Inline VF Page from an Object. when i want to view a record(detail page), i want to update a field in other Object. Is this possible? becoz i have been trying and if i have a update statemnet in the method the InLine Vf Page content is not displaying. The error is Content cannot be displayed: DML currently not allowed . Any idea about this?

 

 

Cheers

 

Bramha

 

Hi,

 

   I have a problem where i need to swap the field type in VF Page. The senario is as below:

 

 1) I have a contact Creation Page where i have a Lookup for Account. If i have a matching account present i will create a contact wiht that Acocunt.  

2) If i dont have the Account I need to create the Account first and then create the contact on the same page. 

 

For first case i will be having the Account Filed as Id(since it is a lookup). I am not able to create an account with this as the second case requires the field to be a String to create the account.

 

Note: I am calling an Ajax Call( using an apex:actionSupport on the account field on onchange event) to get some other information and display.

 

 

Is there any way to tackel with this?

 

Cheers

 

Bramha

Hi,

 

    I have a Object called download__c and a field agg__c. I have lots of records(e.g 100) in download__c which has agg__c(this is not a picklist) will be having  values like Value1, Value2, Valu3 and Value4. So all 100 records will have any value from the four.  I can get the these values by doing a query on download__c and iterate through all the records and store the agg__c values in a Set.  Is there any other way i could the Set of values. is there any other possibility doing anything in the query ?

 

 

Cheers

 

Bramha

Hi,

 

I would like to know if we can sort a Map by Value. I have a Map like below.

 

Map<Id, Integer> accMap = new Map<Id, Integer>();

 

e.g I have values in the Map like below

 

accMap.put('Id1' , 2);

accMap.put('Id2' , 1);

accMap.put('Id3' , 4);

accMap.put('Id4' , 3);

accMap.put('Id5' , 5);

 

Now i want the Map to be sorted by the Integer value and my output should be like below

 

accMap.put('Id5' , 5);

accMap.put('Id3' , 4);

accMap.put('Id4' , 3);

accMap.put('Id1' , 2);

accMap.put('Id2' , 1);

 

 

Any help will be appriciated.

 

Thanks

 

Bramha

Hi,

 

I would like to know if we can sort a Map by Value. I have a Map like below.

 

Map<Id, Integer> accMap = new Map<Id, Integer>();

 

e.g I have values in the Map like below

 

accMap.put('Id1' , 2);

accMap.put('Id2' , 1);

accMap.put('Id3' , 4);

accMap.put('Id4' , 3);

accMap.put('Id5' , 5);

 

Now i want the Map to be sorted by the Integer value and my output should be like below

 

accMap.put('Id5' , 5);

accMap.put('Id3' , 4);

accMap.put('Id4' , 3);

accMap.put('Id1' , 2);

accMap.put('Id2' , 1);

 

 

Any help will be appriciated.

 

Thanks

 

Bramha

Hello,

 

   I have a custom Object Test__c and a User "Test User" with profile "Test Profile" which doesn't have access to this Object.

 

  I want to check if isQueryable() will work on this object.

 

 So i have done,

 

 

SObjectType objectType = Test__c.getSObjectType();

Schema.DescribeSObjectResult objectDescription = objectType.getDescribe();

System.debug('******OBJ ACC'+objectDescription.isQueryable());

 

if(objectDescription.isQueryable()) {

 

// If true Do some processing

 

}

 

Even though i dont have access to this object i am able to query it. Can any one let me know if i need to make any changes in the permissions or any thing else i am missing.

 

Thanks

Reddy

Hi,

 

    I have a doubt to get the MarkUp of ApexPages by Querying the markup of the ApexPage. But is there any way to include the markup of the component if at all a Page has 1 or more components.

 

Eg: Page1 has 2 components Comp1 and Comp2.

 

When i get the markup of Page1 (like ApexPage page = [select markup from apexpage where Name = 'Page1']; ) ,  is it possible to identify the components in that page and also get their markup as well?

 

 

Thanks

 

Bramha

  • September 13, 2011
  • Like
  • 0

Hi,

 

  Is there a way to have diffenet page layouts for diffenet views in salesforce. Eg: I want to have a page layout for NEW and a different page layout for EDIT & VIEW.

 

Is there any option i can do?

 

 

Cheers

Bramha

  • September 08, 2011
  • Like
  • 0

Can any one explain me about sforce.connection in API calls.

Please send sample example to understand this?

I saw the document but not getting whole knowledge.

 

Thanks


Hi,

 

   I have a problem where i need to swap the field type in VF Page. The senario is as below:

 

 1) I have a contact Creation Page where i have a Lookup for Account. If i have a matching account present i will create a contact wiht that Acocunt.  

2) If i dont have the Account I need to create the Account first and then create the contact on the same page. 

 

For first case i will be having the Account Filed as Id(since it is a lookup). I am not able to create an account with this as the second case requires the field to be a String to create the account.

 

Note: I am calling an Ajax Call( using an apex:actionSupport on the account field on onchange event) to get some other information and display.

 

 

Is there any way to tackel with this?

 

Cheers

 

Bramha

I have used demo of Fusioncharts but please tell me that hw can i use fusioncharts with visualforce page ?

How to use fusioncharts in visual force page ?

Is it necessary to use fusioncharts applicaiton or just need to write code to create charts ?

Hi,

 

I need to count the TOTAL Record of Account Object using SOQL and display the record count in the Visualforce page, I am already having more than 50,000 records. How can I get the record count and display the total record count in VF Page? Is there is any other way to get the count in Vf page?

 

Thanks,

Arunraj

Hi all,

 

I am trying to get a list of all of the products that a given account owns. I read the page on relationship queries but I can quite figure out how to get this working.

 

public list<account> Accounts = [SELECT Account.Name, (SELECT (SELECT Product__c.Name FROM Asset__c.Product__c) FROM Account.Asset__c) FROM Account];

 

That's the query ive been working on. Any help would be appreciated.

 

Thanks,

-Sam

Hello everyone, I've been working on a little product catalog application using the REST api. I've got my authentication going with OAuth2, and can query my custom object just fine. I'm working on the update method. I've gotten to the point where I get an HTTP 415 error, which is unsupported media type. I have an update_hash that I'm trying to pass. I've tried these various forms of the hash:

 

update_hash

  = speed3.25 mph

update_hash.to_json

  = {"speed":"455 mph"}

update_hash.dump

 = "{\"speed\":\"455 mph\"}"

 

 

Now this last one looks like how it should be sent. When using the OAuth2 Gem, and this:

 

resp = @access_token.post("#{@resturl}/sobjects/StarkT1__Terminator__c/#{id}?_HttpMethod=PATCH", update_hash, {"ContentType" => "application/json"})

 

I receive this error:

 

undefined method `merge' for "\"{\\\"speed\\\":\\\"455 mph\\\"}\"":String

 

So it looks like the @access_token.post() is doing it's own conversion. Just passing in the hash gives me the 415 error though. So I thought I'd try a RestClient.post and see what happens:

 

resp = RestClient.post("#{@resturl}/sobjects/StarkT1__Terminator__c/#{id}?_HttpMethod=PATCH", update_hash, :content_type => :json, :authorization => "OAuth #{@saccess_token}")

 

This gives me an http 400, bad request. Trying different versions of the update_hash seems to always give me an http 400 error, so something else is wrong with my RestClient post.

 

Any of you gurus out there can tell at a glance what I'm doing wrong?

 

Thanks,

Jed

  • March 23, 2011
  • Like
  • 0