• aditya rawat
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I am trying to use an IDE to modify lightning apps, Can we pull metadata of the lightning apps built using lightning builder ?
I am trying to find a better way to create TransactionSecurity.Event e instances.

The below is based on transaction security trailhead but it requires an empty map and entering values which are not needed at all times.
TxnSecurity.Event e = new TxnSecurity.Event(
						      orgID, /* organizationId */
						      u.Id, /* userId */
						      'Account', /* entityName */
						      'DataExport', /* action */
						      'Account', /* resourceName */
						      '', /* entityId */
						      Datetime.now(), /* timeStamp */
						      eventData ); /* data - Map with info about this event. why ? src: https://trailhead.salesforce.com/modules/transaction_security/units/transaction_security_custom_policy#Tdxn4tBK-heading4 */

I tried creating an Event e using below line but it failed with mesage.
TxnSecurity.Event e2 = new TxnSecurity.Event();

Result: [OPERATION FAILED]: classes/Test_CL_TxService.cls: Constructor not defined: [TxnSecurity.Event].<Constructor>() (Line: 16, Column: 29)

Is there any better way to create Event e variable for unit testing purposes ?
 
The ability to build custom lightning connect adapter is one the most exciting features in recent release, however I am trying to find a solution to able to provide externalId for the custom adapter.

You see the api that I had been trying to connect for pulling data has no unique identifier in the resultset, so now I am in a difficult position of not being able to provide ExternalID for building custom adapters.

I had been thinking of being of using integer for loop counter, but that way it wont be an identifier of the record in any way, any thoughts for providing externalId in custom adapters when there in such situation ?

"Each external object has an External ID standard field. Its values uniquely identify each external object record in an organization. When the external object is the parent in an external lookup relationship, the External ID standard field is used to identify the child records.....
The custom adapter’s Apex code must declare the DataSource.Column named ExternalId and provide its values. "

from: https://help.salesforce.com/apex/HTViewHelpDoc?id=apex_external_id.htm&language=en_US