You need to sign in to do that
Don't have an account?
SivaG
Dynamic Apex using Schema.getdescribe()
Hi,
Requirement -
Custom object A has three fields Field1(picklist),Field2(Created date),Field3(Final date)
Field1 has picklist values pickX,pickY,pickZ
I have another Custom object B with each field label matching with custom object's Field1 picklist values i.e. pickX,pickY,pickZ fields with values 10,20,30. There will be only 1 record in object B which is maintained by the end-user.
Everytime user selects Field1 picklist value then the end date should be calculated based on the value in the corresponding field in object B
i.e. if user selects Field1 pick list value pickY, then the Final Date should be calculated as Final date = Created date + 20.
There is no relation between objects A & B.
How can we achieve this using Dynamic Apex i.e. Schema.getdescribe()?
Thanks
Kumar
Requirement -
Custom object A has three fields Field1(picklist),Field2(Created date),Field3(Final date)
Field1 has picklist values pickX,pickY,pickZ
I have another Custom object B with each field label matching with custom object's Field1 picklist values i.e. pickX,pickY,pickZ fields with values 10,20,30. There will be only 1 record in object B which is maintained by the end-user.
Everytime user selects Field1 picklist value then the end date should be calculated based on the value in the corresponding field in object B
i.e. if user selects Field1 pick list value pickY, then the Final Date should be calculated as Final date = Created date + 20.
There is no relation between objects A & B.
How can we achieve this using Dynamic Apex i.e. Schema.getdescribe()?
Thanks
Kumar
If I'm understanding your question correctly, Schema.describe calls are rather useless here.
Instead, set Object B as a custom setting (sounds like a perfect candidate for a hierarchy custom setting).
Then, you have a few options:
All Answers
If I'm understanding your question correctly, Schema.describe calls are rather useless here.
Instead, set Object B as a custom setting (sounds like a perfect candidate for a hierarchy custom setting).
Then, you have a few options:
Even I agree with you on going with the custom settings part. But business users wanted to maintain it from the user interface on their own. We found a workaround for this.
Thanks
Kumar.