Reputation: 183
In CRM 4.0, how can I, upon double-clicking on a record in the view grid (when it opens in edit form), check the record's Type attribute and redirect to another entity's edit page (depending on type) by passing a shared ID attribute called Document ID?
This is what I'm trying to accomplish - I have a main entity called Transaction, but it's the abstract type and by itself it is not editable - like Activities in CRM. There are specific types of Transaction entities such as Customer Pricing - these entities ARE editable (like the entity named Fax or Email in Activities). The entity called Transaction shares a number of common attributes with its sub types, including one called Document ID. When double-clicking on a Transaction record, I need to redirect the user to the corresponding entity's edit page.
Upvotes: 0
Views: 1993
Reputation: 6715
If I understand this correctly you could do this via some javascript that runs on the form's OnLoad event.
My understanding:
My CRM4 is a bit hazy as I have been working with CRM2011 recently but something like this would work.
function OnLoad {
//let's look for the type field
var typeValue = crmForm.all.new_documentid.Value;
var typeObjectTypeCode = crmForm.all.new_documentidtypecode.Value;
var url = window.location.protocol + '//' + window.location.host + '/';
url = url + 'userdefined/edit.aspx?etc=' + typeObjectTypecode + '&id=' + typeValue;
var newWindowHandle = window.open(url);
//optionally close this window
window.top.close();
}
URLs to open custom entities taken from here
Upvotes: 1