• Himanshu Sharma 241
  • NEWBIE
  • 0 Points
  • Member since 2019

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

I awant to validate the data in a editable data table cell change event

<lightning-datatable                                                
        key-field="id"
        data={data}
        show-row-number-column
        row-number-offset={rowOffset}   
        onrowaction={handleRowAction}
        onsave={handleSave}
        columns={columns}
        oncellchange={validatecelldataset}
        draft-values={draftValues}
        errors={error}
>

In JS file 
validatecelldataset(event){ 
        console.log('Cell Data  : ' +JSON.stringify( event.detail.draftValues[0]));        
    }

How to validate the above data and send an error message.
In the columns array i do have the column name type, lenght, so the validations that I am looking for is to check against the data type and length in the JS method.

Tahnk you

 
Hi all,

We need to implement the following pattern at my org:
  • callout to external data source
  • if that callout takes too long (according to some configurable threshold), log an error (ie do some DML)
  • if that callout timed out on the remote server, try it again
Recognizing the potential for the dreaded "You have uncommitted work pending. Please commit or rollback before calling out." error, I put the error logging code in a future method, thus isolating the DML from the callouts. However, the error is still being thrown. I reduced the issue down to this pattern:
public static void foo() {
    Http http = new Http();
    HttpRequest req = new Httprequest();
    req.setEndpoint('https://test.salesforce.com'); //whatever endpoint
    req.setMethod('GET');
    http.send(req); //works fine
    bar();
    http.send(req); //throws calloutexception
}

@future public static void bar() {

}
Am I correct to assume that calling a future method counts as a DML operation? Is there any documentation I'm missing somewhere?

 
I am trying to setup the OAuth process to get the access_token, specifically in PHP using this example (http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php). However, I don't know how to avoid the "Allow Access" page that shows up, I would like to be autimatically allowed so the application can continue and get the access_token... It would be a pain to have to manually allow access on every system I am planning on implementing this integration.. What am I missing?