+ Start a Discussion
alchemyalchemy 

code

           I have come accross the following code in a controller class.

                   String parentId=Apexpages.currentPage().getParameters().get('entityId');

String childId=Apexpages.currentPage().getParameters().get('fentityId');

     I am trying to figure out why is der two Id? I what case can a page have two different entityId

  The code is using this entityId to fetch values from the database but the entity id is not getting fteched how can i fetch the same.......

Shashikant SharmaShashikant Sharma

String parentId=Apexpages.currentPage().getParameters().get('entityId');

String childId=Apexpages.currentPage().getParameters().get('fentityId');

 

This is the syatax to fetch query stiring parameters, query string parameters are those which are being passed in the URL.

 

Like this

 

https://DoaminName/apex/PageName?entityId='016834000095IKH'&fentityId='018803400009IVH'

alchemyalchemy

 Do one reocrd that is being created have two ID like these on URL.

sfdcfoxsfdcfox

No, each record has exactly one unique ID value. The variable names suggest that the second ID is a record that is somehow related to the first ID (a child record, as would be defined by a lookup field on the child record).

Shashikant SharmaShashikant Sharma

No one record has one id that is unique throughout the org.