Skip to main content

Posts

Showing posts from September, 2017

Salesforce Validation Error: Value is not valid error

 When the Visualforce page is submitted, sometimes we can see the error " Error: Validation Error: Value is not valid "   This is because when the form is submitted to salesforce server, The picklist value that is being submitted, will be checked with the list of available values in the server at that time. If there is no matching entries, This error can be thrown. If you are using picklist in the page, Make sure that 1. The list of available picklist values always include the picklist value that is selected. 2. If you are using the getter to populate the picklist values, The getter will be always called before form submission which could bring the different set of list values than the values that were available at the time picklist value selection. So instead of using getter, you can use constructor or action method to get the list of values. 3. If the picklist value contains multiple consequtive spaces (ex. Internal   User), When it is rendered as HTML, The html supres

How to change date field format from US format to dd/mm/yyyy in Einstein analytics dashboard

 There are few ways to change the format of the date fields   1. Using External Data Metadata Change The date format when you load the date field using External Data Metadata (ie when loading CSV file and along with metadata json). Define the date field and its format like below "type": "Date",  "format": "MM/dd/yyyy",  https://developer.salesforce.com/docs/atlas.en-us.198.0.bi_dev_guide_ext_data_format.meta/bi_dev_guide_ext_data_format/bi_ext_data_schema_overview.htm 2. Using Data flow json file If the datasets are created via data flow job, Add computed expression in the data flow json file to create a date filed with the required format. "computedFields": [  {  "name": "Mod_CreatedDate",  "type": "Date",  "saqlExpression" : "toDate(CreatedDate_sec_epoch)",  "format" : "dd-MM-yyyy"  }  ]  Mod_CreatedDate is just the name of newly created Computed fie

Salesforce Row Locking and how to avoid it (UNABLE_TO_LOCK_ROW)

Error : UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or N records   When a record is updated or created, A lock will be placed on that record and its related record to prevent another operation from updating  the records at the same time and causing inconsistencies on the data. These locks normally last for a few seconds and when the lock is released, other operations can resume processing they are supposed to do on the record in question. However, a given transaction can only wait a maximum of 10 seconds for a lock to be released, otherwise it will time out. Common Reasons When record update happens, that record and its related records will be locked to allow roll back incase of exception Ownership change on Parent will trigger sharing recalculation on every child. Due to Dataskew,  This recalculation can take a lot of time.  Also When the child records are updated as part of multiple parallel batches, Each batch will try to lock the parent records and causi