If you have any doubt in the post please post comments. I will try to solve your problem with in a day.
Example:
We want to open the project quote entity in the new window and when we click save& close, the window must be close.
Open the project quote entity in a new window and have close window when click save & close
//Open the project quote in a new window
var strURL = "main.aspx?etc=10046&pagetype=entityrecord&newWindow=true&histKey=888185290&extraqs=";
//histKey=888185290: If histkey is not available then if you click save & close window will close instead it just show the list of projectquote in grid.
// When you give histkey in the URL then click save & close button window itself close.
//Form the parameter when the form is open set the default value to fill in the form.
//Set projectstatus as draft when the form is open.
var strQuoteId = "kti_projectquotestatus=963548";
//you can also pass multiple parameter with & symbol.
var strQuoteStatus = "&Description='new value filled'";
var strExtras = strQuoteId + strQuoteStatus;
//Set features for how the window will appear.
var features = "location=no,menubar=no,status=no,toolbar=no";
window.open(strURL + encodeURIComponent(strExtras), "_blank", features, false);
Open a new account record using the default form
window.open(URL,name,feature,false);
To open the form using javascript.
Opens an entity form for a new or existing entity record using the options you set as parameters.
Xrm.Utility.openEntityForm(name,id,parameters,windowOptions)
Parameters
Name | Type | Required | Description |
---|---|---|---|
name
|
String
|
Yes
|
The logical name of the entity.
|
id
|
String
|
No
|
The string representation of a unique identifier or the record to open in the form. If not set, a form to create a new record is opened.
|
parameters
|
Object
|
No
|
A dictionary object that passes extra parameters to the form. Invalid parameters will cause an error.
Valid extra query string parameters are:
|
windowOptions
|
Object
|
No
|
For Microsoft Dynamics CRM Online 2015 Update 1 or later use this optional parameter in the web application to control how the form opens. You can choose to open a form in a new window by passing a dictionary object with a Boolean openInNewWindowproperty set to true.
This parameter is ignored in CRM for tablets and CRM for phones.
|
Xrm.Utility.openEntityForm("account");
Open an existing account record using the default form
Xrm.Utility.openEntityForm("account","A85C0252-DF8B-E111-997C-00155D8A8410");
Open a new account record with a specific form and setting default values
var parameters = {};
parameters["formid"] = "b053a39a-041a-4356-acef-ddf00182762b";
parameters["name"] = "Test";
parameters["telephone1"] = "(425) 555-1234";
Xrm.Utility.openEntityForm("account", null, parameters);
Open a new account record using the default form in a new window(Microsoft Dynamics CRM Online 2015 Update 1 or later will use function)
var windowOptions = {
openInNewWindow: true
};
Xrm.Utility.openEntityForm("account",null,null,windowOptions);
Open a new account record using the default form in a new window(before CRM online 2015 update1)
Open webResource
Xrm.Utility.openWebResource(webResourceName,webResourceData,width, height)
Parameters
Parameter | Description | ||
---|---|---|---|
etn
|
The logical name of the entity.
| ||
extraqs
|
Optional for forms. This parameter contains encoded parameters within this parameter.
Use this parameter to pass values to a form. For more information, see Set field values using parameters passed to a form.
When an entity has more than one form defined, you can use this parameter to specify which form to open by passing the encoded parameter
formid with the value equal to the ID value of the form. For example, to open a form with the ID of ‘6009c1fe-ae99-4a41-a59f-a6f1cf8b9daf’, include this value in the extraqs parameter: formid%3D6009c1fe-ae99-4a41-a59f-a6f1cf8b9daf%0D%0A . | ||
pagetype
|
The type of page. There are two possible values:
| ||
id
|
Optional for forms. Use this when you open a specific entity record. Pass in the encoded GUID identifier for the entity. The encoded version of the GUID substitutes opening and closing brackets “{“ and “}” with “%7B” and “%7D”, respectively, for example
{91330924-802A-4B0D-A900-34FD9D790829} is %7B91330924-802A-4B0D-A900-34FD9D790829%7D . | ||
viewid
|
Required for views. This is the ID of the savedquery or userquery entity record that defines the view. The easiest way to get the URL for a view is to copy it. For more information, see Copy the URL for a View.
| ||
viewtype
|
Defines the view type. Possible values are as follows:
| ||
navbar
|
Controls whether the navigation bar is displayed and whether application navigation is available using the areas and subareas defined in the sitemap.
| ||
cmdbar
|
Controls whether the command bar is displayed.
|
We want to open the project quote entity in the new window and when we click save& close, the window must be close.
Open the project quote entity in a new window and have close window when click save & close
//Open the project quote in a new window
var strURL = "main.aspx?etc=10046&pagetype=entityrecord&newWindow=true&histKey=888185290&extraqs=";
//histKey=888185290: If histkey is not available then if you click save & close window will close instead it just show the list of projectquote in grid.
// When you give histkey in the URL then click save & close button window itself close.
//Form the parameter when the form is open set the default value to fill in the form.
//Set projectstatus as draft when the form is open.
var strQuoteId = "kti_projectquotestatus=963548";
//you can also pass multiple parameter with & symbol.
var strQuoteStatus = "&Description='new value filled'";
var strExtras = strQuoteId + strQuoteStatus;
//Set features for how the window will appear.
var features = "location=no,menubar=no,status=no,toolbar=no";
window.open(strURL + encodeURIComponent(strExtras), "_blank", features, false);
Name | Type | Required | Description |
---|---|---|---|
webResourceName
|
String
|
Yes
|
The name of the HTML web resource to open.
|
webResourceData
|
String
|
No
|
Data to be passed into the data parameter.
|
width
|
Number
|
No
|
The width of the window to open in pixels.
|
height
|
Number
|
No
|
The height of the window to open in pixels.
|
window.open(URL,name,feature,false);
URL: url of the application in crm (main.aspx)
window.open(strURL + encodeURIComponent(strExtras), "_blank", features, false);
window.open(strURL + encodeURIComponent(strExtras), "_blank", features, false);
name
String that specifies the name of the window. This name is used as the value for the TARGET attribute on a formor an anchor element.
- The url is loaded into a new, unnamed window.
- The url is loaded into the current frame's parent. If the frame has no parent, this value acts as the value_self.
- The current document is replaced with the specified url.
- The loaded url replaces any framesets that might be loaded. If there are no framesets defined, this value acts as the value _self.
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is excellent.
Thanks for helping me to understand basic concepts. As a beginner in Dot Net programming your post help me a lot.Thanks for your informative article. Dot Net Training in chennai | Dot Net Training in velachery
"Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
ReplyDelete"
Thanks for helping me to understand basic concepts. As a beginner in Dot Net programming your post help me a lot.AppsAthena
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is excellent.
ReplyDeleteKik for PC
Kik Messenger for PC
Thanks for sharing such a useful information.IMO for PC
ReplyDeleteExcellent…Amazing…. I’m satisfied to find so many helpful information here within the put up,for latest php jobs in near me. we want work out extra strategies in this regard, thanks for sharing.
ReplyDeleteGreat blog you have written for us Thanks for sharing good content keep sharing... check it once through MSBI Online Training for more information on microsoft.
ReplyDelete• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingAzure Online Training HYDERABAD
ReplyDeleteReally very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…
ReplyDeleteLearn Best Microsoft Training in Bangalore from Experts. Softgen Infotech offers the Best Microsoft Training Course.100% Placement Assistance, Live Classroom Sessions, Only Technical Profiles, 24x7 Lab Infrastructure Support.
Very nice information, it is valuable and useful to so many people. It gives the beautiful knowledge especially to the technical people.
ReplyDeletemicrosoft training in bangalore
microsoft training institutes in bangalore
microsoft course content
microsoft training centres in bangalore
microsoft course syllabus
microsoft training
It was a very good experience,Faculty members are very knowledgeable and cooperative. Specially My trainer teaching more as he focused upon practical rather than theory. All together it was an enlightening and informative course.
ReplyDeletemicrosoft training and placement support in bangalore
microsoft training free demo class
microsoft placement bangalore
microsoft online training
microsoft classroom training
microsoft training with lab facilities
microsoft training with certified and experienced trainers