Thursday 9 June 2011

Small URL Trick to fill data into standard user interface of an object.

While we are inserting data for an object from it's standard page, we can do one trick to fill data into page from URL.Actually for this trick we need sales force.com id's for the fields in an object.But we can't get ids for the fields in an object like object id.For this i am taking java script id's for the fields from view source. This trick executes for Names of the standard fields directly,but in case of custom fields we can go for java script id's from view source for that page.
                     i am giving the screen shot just follow the instructions,

        This is standard user interface of an object " Address"  to create new record.Here you need to observe the URL in address bar of the window.
         i.e https://ap1.salesforce.com/a01/e?retURL=%2Fa01%2Fo .     
In the above object NAME is the standard field so just observe the below URL,
        https://ap1.salesforce.com/a01/e?retURL=%2Fa01%2Fo&Name=FLEXANDSALESFORCE
click enter. Then you can observe in the following screen,
       In this way you can pass values to fields from URL.In case of Custom fields this is not works ,but with java script  id for that field from view source of that page we can get same result.

                  1 .  Right click on page,click on View source.
                  2.   Get the java script id for that field in view source.
       
 Copy that id for the field country and use that id in URL as follows
 https://ap1.salesforce.com/a01/e?retURL=%2Fa01%2Fo&Name=FLEXANDSALESFORCE&00N90000002IoEJ=INDIA
     
Then u can see,

In this way you can fill data into all fields for an object using this URL trick.

No comments:

Post a Comment