You need to sign in to do that
Don't have an account?
canonw
Look up custom field id in form at runtime
I wonder if this is doable.
I have the following code snippet in scontrol
Is there a function to lookup a particular custom field in a form?
Here's my siutation. I create a custom field in sandbox. Obviously I have to create the same field in production server. The problem is this new custom field having different id.
And I don't want to have source code just to keep track the id difference.
Code:
<script language="JavaScript">
function refresh() {
// How to replace hard-code value with a lookup function?
var someCustomField = '00N60000001Wksv';
window.opener.location="/001/e—retURL=%2F001%2Fo&RecordType=0123000000007cT&" + someCustomField + "=2";
}
refresh();
</script>
Is there a function to lookup a particular custom field in a form?
Here's my siutation. I create a custom field in sandbox. Obviously I have to create the same field in production server. The problem is this new custom field having different id.
And I don't want to have source code just to keep track the id difference.
Based on POC that I made:
If an s-control is packaged and then installed into the destination org, custom fields' Ids are automatically replaced by SFDC.
However, custom fields should be created before s-control is imported.
Werewolf,
I could try this, but wondering - Will the packaging code recoginze "CF" prefix?
As a background, in my VF page, I want to provide a link with a URLFOR($Action.CustomObject__c.New) page. I want to pass these lookup field as parameters. I can write CF00N70000002eKBS in the VF page, but I am not sure if they will get replaced in installing org. I cannot write 'CF' & '00N70000002eKBS' in a VF page as a left side of the parameter - VF parser does not seem to like it.
Or do I have to write Apex code and use references and hope that this will get replaced in Apex code?: