• Shazib Mahmood
  • NEWBIE
  • 65 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 13
    Replies
Hello,
Is there any way to query the "Approval History" related list on custom object ?
The fields I need to query are :"Actual Approver","Overall Status" and "Date".

Thanks
Hello,

In order to grab custom field IDs, I added a tooling API query. Any profile without "View All Data" gets the following response for HTTP Request.
The standard profile does have API enabled permission and full CRED access on any involved object. The Apex class has "Without Sharing" tag as well.

CALLOUT_RESPONSE|[58]|System.HttpResponse[Status=Bad Request, StatusCode=400]

Sample Code:
 
String query = 'SELECT Id From CustomObject Where DeveloperName = \'' + objectName + '\'';
        String endpoint = Url.getSalesforceBaseUrl().toExternalForm();
        endpoint += '/services/data/v29.0/tooling/query/?q=';
        endpoint += EncodingUtil.urlEncode(query, 'UTF-8');
        
        HttpRequest request = new HttpRequest();
        request.setMethod('GET');
        request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());

I need to either:

1. Adjust the non-system admin profile, so that its SessionId gets a proper response like a profile with "View All Data" e.g system admin.
2. Somehow use a sessionId that doesnt belong to current session's profile holder. Use a system admin's sessionid WITHOUT embedding their username and password anywhere.
3. Get further debugging information from the HTTP response. I am not really sure about the specifics of why its a "bad request".


Any guidance would be appreciated. Thanks
Hi,

I am looking for a function in any of the APIs (Probably Metadata API), that could help me get references on a field. E.g used in apex, another field etc.

Just like the way when you try to delete a field and it gives you the reference list.

Thanks
Hi Guys,

I am trying to think of a way to read multiple fields from a salesforce org and then write files that information.
Say, the field 1 can be name of the file and field 2 can be the content. What are the tools and integrations that I will need to do this:

1. Files are created locally and put them on cloud e.g gitub or some online code respository.
2. Files are created on cloud e.g gitub or some online code respository.




Thanks
Shazib
Hi guys,

I am trying to write a very simple trigger but running into some issues. On case I created a lookup field to Opportunity.

trigger UpdateCaseAndOppOwnerManager on Case (before update)
{
    for (Case caseselected : Trigger.new)
    {
        caseselected.Opportunity_Owner_Email__c = caseselected.Opportunity__r.Owner.Email; // Issue # 1. Brings back a null value every time.
        caseselected.Case_Owner_Manager_Email__c = caseselected.Owner.Manager.Email;    // Issue # 2. Owner.Manager reference is not valid
    }

 }

       
Issue # 3. I want these fields to be populated actively like a formula field and not just upon insert/update i.e save. What should I look into, to achieve that ? 

Thank you for all the help !

Cheers,
Shaz
Hello,

In order to grab custom field IDs, I added a tooling API query. Any profile without "View All Data" gets the following response for HTTP Request.
The standard profile does have API enabled permission and full CRED access on any involved object. The Apex class has "Without Sharing" tag as well.

CALLOUT_RESPONSE|[58]|System.HttpResponse[Status=Bad Request, StatusCode=400]

Sample Code:
 
String query = 'SELECT Id From CustomObject Where DeveloperName = \'' + objectName + '\'';
        String endpoint = Url.getSalesforceBaseUrl().toExternalForm();
        endpoint += '/services/data/v29.0/tooling/query/?q=';
        endpoint += EncodingUtil.urlEncode(query, 'UTF-8');
        
        HttpRequest request = new HttpRequest();
        request.setMethod('GET');
        request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());

I need to either:

1. Adjust the non-system admin profile, so that its SessionId gets a proper response like a profile with "View All Data" e.g system admin.
2. Somehow use a sessionId that doesnt belong to current session's profile holder. Use a system admin's sessionid WITHOUT embedding their username and password anywhere.
3. Get further debugging information from the HTTP response. I am not really sure about the specifics of why its a "bad request".


Any guidance would be appreciated. Thanks
I am looking for a way to run some apex code when a recod ( in this case an Opportunity ) which is locked by an approval process becomes unlocked. Basically I would like to post some chatter messages when someone presses the unlock button on the record.  I have tried to catch this in an Opportunity trigger, but this button appears to not modify the opportunity record, thus the trigger does not fire.  I need to let the original approver know that the record was unlocked thus what was approved may now change.  Any help would be greatly appreciated.  Thanks
Hello.
I have a question: the requirement to have a code coverage of 75% by unitTest, is this limit applicable to each Apex form control individualy, or a total for the deployed solution. I have 2 froms covered 90% and 62 respectively. So in total is 76%.
Thank you in advance.
  • April 12, 2016
  • Like
  • 0
How do I add new values to an existing picklist?
Hi All,
I have created a Custom button called "Create Notes" on Event Standard Object when user tries to create a new meeting.On click of which user is redirected to Notes Custom object edit page and on click of Save standard button on that page i want the user to be redirected to the Event object Meeting detail page...
Thanks in Advance for any help provided.
My Current COde which is not redirecting :
/a1t/e?what_id={!Event.What}&00Nf00000017Z95={!Event.Id}&retURL=/{!Event.Id}


 
Hello,
Is there any way to query the "Approval History" related list on custom object ?
The fields I need to query are :"Actual Approver","Overall Status" and "Date".

Thanks
Hello,

In order to grab custom field IDs, I added a tooling API query. Any profile without "View All Data" gets the following response for HTTP Request.
The standard profile does have API enabled permission and full CRED access on any involved object. The Apex class has "Without Sharing" tag as well.

CALLOUT_RESPONSE|[58]|System.HttpResponse[Status=Bad Request, StatusCode=400]

Sample Code:
 
String query = 'SELECT Id From CustomObject Where DeveloperName = \'' + objectName + '\'';
        String endpoint = Url.getSalesforceBaseUrl().toExternalForm();
        endpoint += '/services/data/v29.0/tooling/query/?q=';
        endpoint += EncodingUtil.urlEncode(query, 'UTF-8');
        
        HttpRequest request = new HttpRequest();
        request.setMethod('GET');
        request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());

I need to either:

1. Adjust the non-system admin profile, so that its SessionId gets a proper response like a profile with "View All Data" e.g system admin.
2. Somehow use a sessionId that doesnt belong to current session's profile holder. Use a system admin's sessionid WITHOUT embedding their username and password anywhere.
3. Get further debugging information from the HTTP response. I am not really sure about the specifics of why its a "bad request".


Any guidance would be appreciated. Thanks
Hello, 
I'm new to salesforce development , I'm wondring if I can use apex code in existing page such cases, leads and so on ? Or Apex code only for custom visulforce page ? and  if it possible how can I do this ?
I am having trouble with a few VF pages not loading under a certain profile. I get the error below. 
I have checked all object/field/page/class permissions and cannot pinpoint the issue.
Has anyone seen this error and what was the problem?

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 1489619450-33212 (1101702301)
 
Hi,

My requirement is to create a contact , by clicking a button on the account detail page. Button click will open a new vf page with contact fields onto it.Account name field on new vf page must be auto popuated, where as rest of the contact fields can be typed in.
How do I achieve this?
 
Hi Guys,

I am trying to think of a way to read multiple fields from a salesforce org and then write files that information.
Say, the field 1 can be name of the file and field 2 can be the content. What are the tools and integrations that I will need to do this:

1. Files are created locally and put them on cloud e.g gitub or some online code respository.
2. Files are created on cloud e.g gitub or some online code respository.




Thanks
Shazib
Hi guys,

I am trying to write a very simple trigger but running into some issues. On case I created a lookup field to Opportunity.

trigger UpdateCaseAndOppOwnerManager on Case (before update)
{
    for (Case caseselected : Trigger.new)
    {
        caseselected.Opportunity_Owner_Email__c = caseselected.Opportunity__r.Owner.Email; // Issue # 1. Brings back a null value every time.
        caseselected.Case_Owner_Manager_Email__c = caseselected.Owner.Manager.Email;    // Issue # 2. Owner.Manager reference is not valid
    }

 }

       
Issue # 3. I want these fields to be populated actively like a formula field and not just upon insert/update i.e save. What should I look into, to achieve that ? 

Thank you for all the help !

Cheers,
Shaz