• crm123
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I am struggling with logging the input that come in via a webservice call. The method is something like this

 

 webservice boolean runTransaction(Account wAccount){

   logAccount(wAccount);

   processAccount(); 

 

 

with logAccount(Account lAccount) being something like this:

 

String strAccount = "Incoming Account Transaction\n";

strAccount = strAccount + "FieldName1" + lAccount.fieldName1 + "\n";

strAccount = strAccount + "FieldName2" + lAccount.fieldName2 + "\n"; 

...

strAccount = strAccount + "FieldNameN" + lAccount.fieldNameN + "\n";  

logAccountValues(strAccount);

 

where logAccountValues creates a record in a custom object and records the values. The problem with this approach is that our schema is very dynamic and extensive. We have 200 fields in our object, and its a pain to keep them all in synch. We want to make it more dynamic, by leveraging the schema definition. Given a field name, how do I find the value? I am looking for something like this:

 

 String fieldValue = Account.getFieldValue(fieldName);

 

Its impractical to query the database because we don't want to log what is stored in the database, but rather what are the values in the incoming webservice calls. Any help/pointers appreciated. 

 

 

  • February 03, 2010
  • Like
  • 0

Typically, we specify a user to monitor via Setup->Monitoring->Debug Logs. Is there a way to do it via apex code?

 

Use Case:

Custom WebService to update opportunities and other custom objects.

One of the parameters we want on the call is DebugLevel. If DebugLevel is not equal to zero, we want to enable the useraccount for debugging and be able to view the Debug Logs. How can we do this?

 

Thanks.

  • December 29, 2010
  • Like
  • 0

Hi

 

How can the results of an external webservice be displayed in Salesforce? We've got to the point where we can see the response in our apex classes. How do I now show them on the user interface?

 

Thanks.

  • October 22, 2009
  • Like
  • 0

Our browsers are configured to reach the internet via a proxy server, there is no direct connection to the internet. Is there something that should be configured on the flex/salesforce toolkit to allow the requests to go in via the proxy? The application itself is very simple, follows the demo seen on the salesforceflex toolkit video.

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication applicationComplete="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:salesforce="http://www.salesforce.com/" xmlns:local="*">
<salesforce:AIRConnection id="sandbox" />
<mx:DataGrid id="contactgrid" left="0" right="0" top="0" bottom="0">
</mx:DataGrid>
<mx:Script>
<![CDATA[
import com.salesforce.results.QueryResult;
import com.salesforce.results.LoginResult;
import com.salesforce.AsyncResponder;
import com.salesforce.objects.LoginRequest;
private function init():void{

var lr:LoginRequest = new LoginRequest();
lr.username = "flextest@sandbox.com";
lr.password = "flextest123";
lr.callback = new AsyncResponder(loadGrid);
sandbox.login(lr);

}

private function loadGrid(lr:LoginResult):void {

sandbox.query("SELECT Id, FirstName, LastName FROM Contact",
new AsyncResponder(querySuccess));
}

private function querySuccess(qr:QueryResult): void{
contactgrid.dataProvider = qr.records;
}
]]>
</mx:Script>


</mx:WindowedApplication>

 

 This is what I see in the logs:

 

[SWF] Demo.swf - 1,549,686 bytes after decompression
offline but we will succeed at logging in anyways
query - offline
SQLError: 'Error #3115: SQL Error.', details:'no such table: 'Contact'', operation:'execute', detailID:'2013'
SELECT Id, FirstName, LastName FROM `Contact`;
SQLError: 'Error #3115: SQL Error.', details:'no such table: 'Contact'', operation:'execute', detailID:'2013'
SELECT Id, FirstName, LastName FROM `Contact`;

 

 

 

  • September 22, 2009
  • Like
  • 0

Our browsers are configured to reach the internet via a proxy server, there is no direct connection to the internet. Is there something that should be configured on the flex/salesforce toolkit to allow the requests to go in via the proxy? The application itself is very simple, follows the demo seen on the salesforceflex toolkit video.

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication applicationComplete="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:salesforce="http://www.salesforce.com/" xmlns:local="*">
<salesforce:AIRConnection id="sandbox" />
<mx:DataGrid id="contactgrid" left="0" right="0" top="0" bottom="0">
</mx:DataGrid>
<mx:Script>
<![CDATA[
import com.salesforce.results.QueryResult;
import com.salesforce.results.LoginResult;
import com.salesforce.AsyncResponder;
import com.salesforce.objects.LoginRequest;
private function init():void{

var lr:LoginRequest = new LoginRequest();
lr.username = "flextest@sandbox.com";
lr.password = "flextest123";
lr.callback = new AsyncResponder(loadGrid);
sandbox.login(lr);

}

private function loadGrid(lr:LoginResult):void {

sandbox.query("SELECT Id, FirstName, LastName FROM Contact",
new AsyncResponder(querySuccess));
}

private function querySuccess(qr:QueryResult): void{
contactgrid.dataProvider = qr.records;
}
]]>
</mx:Script>


</mx:WindowedApplication>

 

 This is what I see in the logs:

 

[SWF] Demo.swf - 1,549,686 bytes after decompression
offline but we will succeed at logging in anyways
query - offline
SQLError: 'Error #3115: SQL Error.', details:'no such table: 'Contact'', operation:'execute', detailID:'2013'
SELECT Id, FirstName, LastName FROM `Contact`;
SQLError: 'Error #3115: SQL Error.', details:'no such table: 'Contact'', operation:'execute', detailID:'2013'
SELECT Id, FirstName, LastName FROM `Contact`;

 

 

 

  • September 22, 2009
  • Like
  • 0

Can someone please help me?? I'm trying to run the supposedly simple application in one of the flex tutorials only it DOES NOT WORK!!!!!! I TRIED EVERYTHING AND THE SALESFORCE DOCMENTATION IS 2247 PAGES LONG!!! HOW DO I GET STARTED WITH FLEX??? WHO DO I HAVE TO TALK TO???????? DOES ANYONE KNOW???

HERE IS THE CODE I'M TRYING TO RUN. I copied the toolkit SWC's  into my lib folder in the project in FLEX and this is the exact code that is in the tutorial that is floating around YOUTUBE??? SO WHY IN THE HELL DOES IT NOT WORK WHAT AM I MISSING????? 

 

 

 

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:salesforce="http://www.salesforce.com/"
    applicationComplete="doLogin()">

    <mx:Script>
        <![CDATA[
            import com.salesforce.results.LoginResult;
            import com.salesforce.results.QueryResult;
            import com.salesforce.AsyncResponder;
            import com.salesforce.objects.LoginRequest;
            
            private function doLogin():void
            {
                var lr:LoginRequest = new LoginRequest();
                lr.username = "MY FREAKING USERNAME";
                lr.password = "MY FREAKING PASSWORD";
                lr.callback = new AsyncResponder(loginSuccess);
                force.login(lr);
            }    
            
            private function loginSuccess(result:LoginResult):void
            {
                force.query("SELECT Id, LastName FROM Contact", new AsyncResponder(querySuccess));
            }
            
            private function querySuccess(result:QueryResult):void
            {
                grid.dataProvider = result.records;
            }
        ]]>
    </mx:Script>
    
    <salesforce:Connection id="force"/>
    
    <mx:DataGrid id="grid" width="400" height="300"/>
    
</mx:Application>