• tes2
  • NEWBIE
  • 44 Points
  • Member since 2011

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

 

 

Hi,

 

I have two custom object Job and Task.
They are having master detail relationship where Job(Master) --> Task(Child)

Each Job must contain multiple Tasks.

For e.g. Job Name: Prining Books

 

Task
        Task Name: Task 1
        Task Name : Task 2
       
It should not allow another record with student name as 'Task 1', because it is already available under Job.

But Task Name "Task 1" can be allowed to add under different Job (say under Job Design Graphics), simply because here Task 1 is belongs to different Job.

How to resolve this problem?

Thanks,
Devendra S    

Im trying to make both partner and Metadata API callouts from within apex jobs. but since the UserInfo.getSession() does not work within an apex job I need to authenticate.  Is there any way to use an OAuth named credential to do this,  I been try to find a way to get the access_token and/or refresh_token from a named credential but have not found a way.
  • March 10, 2015
  • Like
  • 0
Hi,

   I am trying to capture the requests when filters are being set to Custom Report Type's report, basically I want to modify the fields to add more information to the filter fields if required. So when I add a filter to a report of standard report type it looks like this :

{"templateKey":"ReportAccount","ns":"","scope":"user","topn":0,"c":["USERS.NAME","ACCOUNT.NAME","TYPE","RATING","DUE_DATE","LAST_UPDATE","ADDRESS1_STATE"],"last_modified_user_id":"","sideBySide":false,"sortdir":"up","colorRanges":[],"format":"tt","currency":"000","created_by_user_id":"005j000000Bp3mo","charts":[{"ctsize":18,"ctitle":"","bgdir":"2","l":"1","bg2":16777215,"csize":3,"bg1":16777215,"tfg":0,"ct":"none","sal":false,"chco":false,"chsp":false,"cheh":false,"cp":"b","cfsize":12,"fg":0,"chst":false,"summaries":[],"chsv":false,"Yman":false}],"v":142,"co":"yes","last_modified_date":"","last_modified_by":"","details":"yes","customAggregates":[],"rt":"1","reportParams":[{"param":"colDt_c","value":"CREATED_DATE"},{"param":"colDt_e","value":""},{"param":"colDt_q","value":"custom"},{"param":"colDt_s","value":"3/16/2015"},{"param":"function","value":"c"},{"param":"name_op","value":"co"}],"cust_owner":"005j000000Bp3no","filters":[{"pc":"ACCOUNT.NAME","pn":"eq","pv":"hello world"}]}

the "pc" value in json indicates the fieldname on which a filter is being set. This works great because I know the field being used and can check if it needs to be updated with more information at proxy. However when a filter is set on a custom report type the request looks like this :

{"templateKey":"070j0000000bGeB","ns":"","scope":"user","topn":0,"c":["072j0000009iTW0","072j0000009iTXY"],"last_modified_user_id":"","sideBySide":false,"sortdir":"up","colorRanges":[],"format":"tt","currency":"000","created_by_user_id":"005j000000Bp3mo","charts":[{"ctsize":18,"ctitle":"","bgdir":"2","l":"1","bg2":16777215,"csize":3,"bg1":16777215,"tfg":0,"ct":"none","sal":true,"chco":true,"chsp":false,"cheh":false,"cp":"b","cfsize":12,"fg":0,"chst":false,"summaries":[],"chsv":false,"Yman":false}],"v":142,"co":"yes","last_modified_date":"","last_modified_by":"","details":"yes","customAggregates":[],"rt":"070j0000000bGeB","reportParams":[{"param":"colDt_c","value":"072j0000009iTWX"},{"param":"colDt_e","value":"3/31/2015"},{"param":"colDt_q","value":"current"},{"param":"colDt_s","value":"1/1/2015"},{"param":"function","value":"c"},{"param":"name_op","value":"co"}],"cust_owner":"005j000000Bp3mo","filters":[{"pc":"072j0000009iTW0","pn":"eq","pv":"hello world"}]}

The field which was set as filter in the above json highlighted is Account.Name, when I try to browse this id I get an error stating insufficient permissions. Can you kindly let me know where can I find mapping of this id to actual field in Salesforce.

Thanks in advance

I am having trouble finding any documentation on:

 

1.  What is the difference between Abstract and Virtual classes (they seem to be the exact same to me)

 

2. What are some scenarios for using Abstract or Virtual classes (wrapper classes comes to mind but are these the right thing to use?)

 

3.  When would you use an Interface instead of an Abstract or Virtual?  I read they are only suppose to be signatures but I saw an example that had a method with code in it too..

  • July 25, 2013
  • Like
  • 0
Hi, All - I have a few apex:commandButton on the page and one apex:outputPanel where I want to display some text onClick action by toggling between those apex:commandButton; I created an extension controller. Question: How can I access value property of apex:outputText from Apex. I placed 1 apex:outputText for each apex:commandButton Please suggest, thank you.

Hi Everyone

 

Can we create custom fields using apex code ?? if anybody have any code sample or link then do let me know....

 

 

 

Thanx in advance

Vishal

hi,

 

I have displayed all the object names in a select list and while an object is selected, i am retrieving the object name and i have to select the field names for it. For this i found that the syntax as given below,

 

Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields;

 

The Account object is hardcoded here, but, in my scenario, object name is dynamically changing, how to modify this syntax into dynamically changing one. any ideas or any other syntax's available to get field names?? 

Or is there any soql query to retrieve the field for the requested object? please provide any ideas or suggestions to retrieve the field names...

 

thanks,

abivenkat,

SFDC Learner

 

 

Hi,

 

I have two custom object Job and Task.
They are having master detail relationship where Job(Master) --> Task(Child)

Each Job must contain multiple Tasks.

For e.g. Job Name: Prining Books

 

Task
        Task Name: Task 1
        Task Name : Task 2
       
It should not allow another record with student name as 'Task 1', because it is already available under Job.

But Task Name "Task 1" can be allowed to add under different Job (say under Job Design Graphics), simply because here Task 1 is belongs to different Job.

How to resolve this problem?

Thanks,
Devendra S    

Hi,

     I have a problem regarding saving the quotelineitem. I have entered a product and also an unitprice hardcoded in the apex code and make UseStandardPrice=true. Then entered a pricebook name as well. The product is saved but the problem came in saving quotelineitem. I have assigned product2id and pricebook2id in the pricebookentry object. I have also assigned pricibookentryid and quoteid in quotelineitem object,but while saving an error is displaying. the error is like this

   System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The pricebook entry is in a different pricebook than the one assigned to the Quote, or Quote has no pricebook assigned.: [PricebookEntryId]

 

                        Please help me out in this problem.

                                                                                    Thanks,

                                                                                                   Souvik

I am working with an integration between Salesforce and another third party software.  Needless to say the third party software has a bad database design that causes issues with sending over multiple API calls at once time.  Because of this I need a way to delay triggers so they fire asynchronous.  Is there anyway to do this within the Trigger?  If not, is there anyway to do this with the save method within an extension/controller?

I'm not very well versed with webservices and I had a question about integrating (pulling data from an external system and pushing into Salesforce).

 

There is an external .NET application that retrieves data from an Accounting system real time.  My question is if it is possible to create a Salesforce webservice that the external .NET application can call whenever it gets new data from the accounting system and then push that data into Salesforce.

 

I know there are tools like Informatica, DBAmp that can do this type of thing as well.  The requirements are looking for a different route to handle this process.

 

Is there a way to accomplish this?  What are the options?  Any Salesforce articles discussing how to do this?

 

Thanks for any help!

I'm pulling data from another system on a regular basis and wrote a method to match existing field values with the new field values.

 

If none of the fields are changed and I try to update in Apex, will that update actually do anything such as fire triggers, create chatter posts, etc?

 

Example to illustrate the question:

Campaign c=[select Id, Name from Campaign where Name = 'name'];
Campaign c2=new Campaign();

c2.Name='name';

        if(c.Name!=JSONCampaign.NAME&&c2.NAME!=NULL){
    		c.Name=c2.Name;
    	}//if 1

update c; // does this actually do anything?

 

Ran the following via an anonymous block. Said:Unrecognized base64 character: � (actually a diamond shaped thing)

The returned value that is anticipated as being a png file is not in a format that can be converted into a b64 file accurately. Does anyone know any methods that might be able to produce a correct b64 string/blob?

If anyone knew how to fix this or had sample code for getting images from google chart api, i would appreciate it.

thank you

 

HttpRequest req = new HttpRequest();

req.setEndpoint('https://chart.googleapis.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Hello|World');

req.setMethod('GET');

Http http = new Http();

HTTPResponse res = http.send(req);

blob body;

 //body = blob.valueof(res.getBody());//produces corrupted body

 body = EncodingUtil.base64Decode(res.getBody()); //crashes

 

 

Does Apex have Reflection / Introspection sort of support?

Does anyone know how to remove a line break from a field?
I am trying to use MailingAddress in a hyperlink formula but it breaks every time there is a contact with a two line mailing address.

I have tried the following and they did not work:
substitute(MailingAddress,BR(),"")
substitute(MailingAddress,"\n","")
substitute(MailingAddress,\n,"")
trim(MailingAddress)

For reference my formula looks something like this:
hyperlink("http://linklocation.com?address="&MailingAddress,"Link Text", "_blank")