Issues using a custom view on a Subgrid for a Lookup in Dynamics 365












2














I am working on a form where visibility of a certain section is based on a specific field on the form. The section in question also has a subgrid ("WorkingDataRequestsGrid"). The logic for displaying the field is working fine. However, it is not filtering as expected. The subgrid uses a view I set up specifically for this function. It displays records from the same entity that have a specific type and status.



Properties of the Subgrid



On top of filtering by the type and status, the results should also be filtered by the relationship to the current case. For example, there are 3,500 documents in the system. Of those 3,500 documents, only 25 of them have the proper type/status combination. Of those 25, only three are for the same case. The inline lookup should display only those three files. It is still showing all 3,500. When I hit the look up more records button, it is not filtered by the custom view I set up.



Since the filter is using a join to the case (incident), I can't use the addCustomFilter or preSearch. I am limited to the "addCustomView" functionality due to the linked entity. When I set up the custom view based on the fetch XML from an advanced find, the page produces this error:



Alert for the Exception



The status field for the document has an onChange event that fires the following javascript:



function getCustomView() {
try {
var LookupControl = Xrm.Page.getControl("WorkingDataRequestsGrid");

if (LookupControl != null) {
var CaseId = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].id;
var Casename = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].name;

var fetch = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
" <entity name='confidentialdocument'>" +
" <attribute name='documenttitle'/>" +
" <attribute name='typeofrequest'/>" +
" <attribute name='createdby'/>" +
" <attribute name='respondingparty'/>" +
" <attribute name='noofquestions'/>" +
" <attribute name='dataresponseduedate'/>" +
" <attribute name='confidentialdocumentid'/>" +
" <order descending='false' attribute='documenttitle'/>" +
" <filter type='and'>" +
" <condition attribute='documenttype' value='{33F7488F-DE7C-E511-813B-1458D04E7900}' uitype='new_documenttype' uiname='Data Request' operator='eq'/>" +
" <condition attribute='documentstatus' value='413360000' operator='eq'/>" +
" <condition attribute='confidentialdocuments' value='" + CaseId + "' uitype='incident' uiname='" + Casename + "' operator='eq'/>" +
" </filter>" +
" <link-entity name='incident' alias='a_f409103f050fe71181091458d04dd6c8' link-type='outer' visible='false' to='confidentialdocuments' from='incidentid'>" +
" <attribute name='title'/>" +
" </link-entity>" +
" </entity>" +
"</fetch>";

//columns to display in the custom view (make sure to include these in the fetch query)
var layout = "<layoutxml>" +
"<grid name='resultset' icon='1' preview='1' select='1' jump='name' object='10013'>" +
" <row id='confidentialdocumentid' name='result'>" +
" <cell name='documenttitle' width='100'/>" +
" <cell name='a_f409103f050fe71181091458d04dd6c8.title' width='100' disableSorting='1'/>" +
" <cell name='createdby' width='100'/>" +
" <cell name='typeofrequest' width='100'/>" +
" <cell name='noofquestions' width='100'/>" +
" <cell name='respondingparty' width='100'/>" +
" <cell name='dataresponseduedate' width='100'/>" +
" </row>" +
"</grid>" +
"</layoutxml>";

var viewId = "{00000000-0000-0000-0000-000000000009}";// add the randomly generated GUID for the view id
var entityName = "confidentialdocument";//add the entity name
var viewDisplayName = "Working Confidential Data Request Documents";// add the view display name

//alert(viewId + " --- " + entityName + " --- " + viewDisplayName);
Xrm.Page.getControl("WorkingDataRequestsGrid").addCustomView(viewId, entityName, viewDisplayName, fetch, layout, true);
}
}
catch (error) {
alert("Error in ConfidentialJs, Method Name: getCustomView(), Error: " + error.message);
}
}


NOTE: I updated the "layout" XML using the xml from the Solutions Customizations.xml.



I had a few alert statements in the javaScript so I could see what was happening. When the field changes to the correct status, the javaScript function is fired. It fires during the onLoad event as well but the "LookupControl" comes up as null so it doesn't set the custom view.



I think I have just been looking at this issue too long. Chances are it is a very small issue I am just missing. I need a fresh set of eyes to see something I can't.



I need help with two issues:




  1. Any ideas as to why the filter will not use the specified view?

  2. Why does the onLoad event not have access to the look up control?


    The order of execution for several of the javascript methods set in the form properties caused the "Object does not support" error. One method was hiding the section so it couldn't be found. That has been fixed.




    After further review, the order of execution didn't actually fix the issue. It was never calling the addCustomView logic because it didn't find the "LookupControl." So, back to needing help on both issues!






Any help is greatly appreciated!










share|improve this question




















  • 1




    Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
    – jasonscript
    Nov 12 '18 at 5:59










  • @Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
    – Paul Haan
    Nov 12 '18 at 13:52










  • You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
    – jasonscript
    Nov 13 '18 at 4:01










  • @jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
    – Paul Haan
    Nov 13 '18 at 16:32








  • 1




    Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
    – Paul Haan
    Nov 14 '18 at 14:07
















2














I am working on a form where visibility of a certain section is based on a specific field on the form. The section in question also has a subgrid ("WorkingDataRequestsGrid"). The logic for displaying the field is working fine. However, it is not filtering as expected. The subgrid uses a view I set up specifically for this function. It displays records from the same entity that have a specific type and status.



Properties of the Subgrid



On top of filtering by the type and status, the results should also be filtered by the relationship to the current case. For example, there are 3,500 documents in the system. Of those 3,500 documents, only 25 of them have the proper type/status combination. Of those 25, only three are for the same case. The inline lookup should display only those three files. It is still showing all 3,500. When I hit the look up more records button, it is not filtered by the custom view I set up.



Since the filter is using a join to the case (incident), I can't use the addCustomFilter or preSearch. I am limited to the "addCustomView" functionality due to the linked entity. When I set up the custom view based on the fetch XML from an advanced find, the page produces this error:



Alert for the Exception



The status field for the document has an onChange event that fires the following javascript:



function getCustomView() {
try {
var LookupControl = Xrm.Page.getControl("WorkingDataRequestsGrid");

if (LookupControl != null) {
var CaseId = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].id;
var Casename = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].name;

var fetch = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
" <entity name='confidentialdocument'>" +
" <attribute name='documenttitle'/>" +
" <attribute name='typeofrequest'/>" +
" <attribute name='createdby'/>" +
" <attribute name='respondingparty'/>" +
" <attribute name='noofquestions'/>" +
" <attribute name='dataresponseduedate'/>" +
" <attribute name='confidentialdocumentid'/>" +
" <order descending='false' attribute='documenttitle'/>" +
" <filter type='and'>" +
" <condition attribute='documenttype' value='{33F7488F-DE7C-E511-813B-1458D04E7900}' uitype='new_documenttype' uiname='Data Request' operator='eq'/>" +
" <condition attribute='documentstatus' value='413360000' operator='eq'/>" +
" <condition attribute='confidentialdocuments' value='" + CaseId + "' uitype='incident' uiname='" + Casename + "' operator='eq'/>" +
" </filter>" +
" <link-entity name='incident' alias='a_f409103f050fe71181091458d04dd6c8' link-type='outer' visible='false' to='confidentialdocuments' from='incidentid'>" +
" <attribute name='title'/>" +
" </link-entity>" +
" </entity>" +
"</fetch>";

//columns to display in the custom view (make sure to include these in the fetch query)
var layout = "<layoutxml>" +
"<grid name='resultset' icon='1' preview='1' select='1' jump='name' object='10013'>" +
" <row id='confidentialdocumentid' name='result'>" +
" <cell name='documenttitle' width='100'/>" +
" <cell name='a_f409103f050fe71181091458d04dd6c8.title' width='100' disableSorting='1'/>" +
" <cell name='createdby' width='100'/>" +
" <cell name='typeofrequest' width='100'/>" +
" <cell name='noofquestions' width='100'/>" +
" <cell name='respondingparty' width='100'/>" +
" <cell name='dataresponseduedate' width='100'/>" +
" </row>" +
"</grid>" +
"</layoutxml>";

var viewId = "{00000000-0000-0000-0000-000000000009}";// add the randomly generated GUID for the view id
var entityName = "confidentialdocument";//add the entity name
var viewDisplayName = "Working Confidential Data Request Documents";// add the view display name

//alert(viewId + " --- " + entityName + " --- " + viewDisplayName);
Xrm.Page.getControl("WorkingDataRequestsGrid").addCustomView(viewId, entityName, viewDisplayName, fetch, layout, true);
}
}
catch (error) {
alert("Error in ConfidentialJs, Method Name: getCustomView(), Error: " + error.message);
}
}


NOTE: I updated the "layout" XML using the xml from the Solutions Customizations.xml.



I had a few alert statements in the javaScript so I could see what was happening. When the field changes to the correct status, the javaScript function is fired. It fires during the onLoad event as well but the "LookupControl" comes up as null so it doesn't set the custom view.



I think I have just been looking at this issue too long. Chances are it is a very small issue I am just missing. I need a fresh set of eyes to see something I can't.



I need help with two issues:




  1. Any ideas as to why the filter will not use the specified view?

  2. Why does the onLoad event not have access to the look up control?


    The order of execution for several of the javascript methods set in the form properties caused the "Object does not support" error. One method was hiding the section so it couldn't be found. That has been fixed.




    After further review, the order of execution didn't actually fix the issue. It was never calling the addCustomView logic because it didn't find the "LookupControl." So, back to needing help on both issues!






Any help is greatly appreciated!










share|improve this question




















  • 1




    Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
    – jasonscript
    Nov 12 '18 at 5:59










  • @Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
    – Paul Haan
    Nov 12 '18 at 13:52










  • You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
    – jasonscript
    Nov 13 '18 at 4:01










  • @jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
    – Paul Haan
    Nov 13 '18 at 16:32








  • 1




    Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
    – Paul Haan
    Nov 14 '18 at 14:07














2












2








2







I am working on a form where visibility of a certain section is based on a specific field on the form. The section in question also has a subgrid ("WorkingDataRequestsGrid"). The logic for displaying the field is working fine. However, it is not filtering as expected. The subgrid uses a view I set up specifically for this function. It displays records from the same entity that have a specific type and status.



Properties of the Subgrid



On top of filtering by the type and status, the results should also be filtered by the relationship to the current case. For example, there are 3,500 documents in the system. Of those 3,500 documents, only 25 of them have the proper type/status combination. Of those 25, only three are for the same case. The inline lookup should display only those three files. It is still showing all 3,500. When I hit the look up more records button, it is not filtered by the custom view I set up.



Since the filter is using a join to the case (incident), I can't use the addCustomFilter or preSearch. I am limited to the "addCustomView" functionality due to the linked entity. When I set up the custom view based on the fetch XML from an advanced find, the page produces this error:



Alert for the Exception



The status field for the document has an onChange event that fires the following javascript:



function getCustomView() {
try {
var LookupControl = Xrm.Page.getControl("WorkingDataRequestsGrid");

if (LookupControl != null) {
var CaseId = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].id;
var Casename = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].name;

var fetch = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
" <entity name='confidentialdocument'>" +
" <attribute name='documenttitle'/>" +
" <attribute name='typeofrequest'/>" +
" <attribute name='createdby'/>" +
" <attribute name='respondingparty'/>" +
" <attribute name='noofquestions'/>" +
" <attribute name='dataresponseduedate'/>" +
" <attribute name='confidentialdocumentid'/>" +
" <order descending='false' attribute='documenttitle'/>" +
" <filter type='and'>" +
" <condition attribute='documenttype' value='{33F7488F-DE7C-E511-813B-1458D04E7900}' uitype='new_documenttype' uiname='Data Request' operator='eq'/>" +
" <condition attribute='documentstatus' value='413360000' operator='eq'/>" +
" <condition attribute='confidentialdocuments' value='" + CaseId + "' uitype='incident' uiname='" + Casename + "' operator='eq'/>" +
" </filter>" +
" <link-entity name='incident' alias='a_f409103f050fe71181091458d04dd6c8' link-type='outer' visible='false' to='confidentialdocuments' from='incidentid'>" +
" <attribute name='title'/>" +
" </link-entity>" +
" </entity>" +
"</fetch>";

//columns to display in the custom view (make sure to include these in the fetch query)
var layout = "<layoutxml>" +
"<grid name='resultset' icon='1' preview='1' select='1' jump='name' object='10013'>" +
" <row id='confidentialdocumentid' name='result'>" +
" <cell name='documenttitle' width='100'/>" +
" <cell name='a_f409103f050fe71181091458d04dd6c8.title' width='100' disableSorting='1'/>" +
" <cell name='createdby' width='100'/>" +
" <cell name='typeofrequest' width='100'/>" +
" <cell name='noofquestions' width='100'/>" +
" <cell name='respondingparty' width='100'/>" +
" <cell name='dataresponseduedate' width='100'/>" +
" </row>" +
"</grid>" +
"</layoutxml>";

var viewId = "{00000000-0000-0000-0000-000000000009}";// add the randomly generated GUID for the view id
var entityName = "confidentialdocument";//add the entity name
var viewDisplayName = "Working Confidential Data Request Documents";// add the view display name

//alert(viewId + " --- " + entityName + " --- " + viewDisplayName);
Xrm.Page.getControl("WorkingDataRequestsGrid").addCustomView(viewId, entityName, viewDisplayName, fetch, layout, true);
}
}
catch (error) {
alert("Error in ConfidentialJs, Method Name: getCustomView(), Error: " + error.message);
}
}


NOTE: I updated the "layout" XML using the xml from the Solutions Customizations.xml.



I had a few alert statements in the javaScript so I could see what was happening. When the field changes to the correct status, the javaScript function is fired. It fires during the onLoad event as well but the "LookupControl" comes up as null so it doesn't set the custom view.



I think I have just been looking at this issue too long. Chances are it is a very small issue I am just missing. I need a fresh set of eyes to see something I can't.



I need help with two issues:




  1. Any ideas as to why the filter will not use the specified view?

  2. Why does the onLoad event not have access to the look up control?


    The order of execution for several of the javascript methods set in the form properties caused the "Object does not support" error. One method was hiding the section so it couldn't be found. That has been fixed.




    After further review, the order of execution didn't actually fix the issue. It was never calling the addCustomView logic because it didn't find the "LookupControl." So, back to needing help on both issues!






Any help is greatly appreciated!










share|improve this question















I am working on a form where visibility of a certain section is based on a specific field on the form. The section in question also has a subgrid ("WorkingDataRequestsGrid"). The logic for displaying the field is working fine. However, it is not filtering as expected. The subgrid uses a view I set up specifically for this function. It displays records from the same entity that have a specific type and status.



Properties of the Subgrid



On top of filtering by the type and status, the results should also be filtered by the relationship to the current case. For example, there are 3,500 documents in the system. Of those 3,500 documents, only 25 of them have the proper type/status combination. Of those 25, only three are for the same case. The inline lookup should display only those three files. It is still showing all 3,500. When I hit the look up more records button, it is not filtered by the custom view I set up.



Since the filter is using a join to the case (incident), I can't use the addCustomFilter or preSearch. I am limited to the "addCustomView" functionality due to the linked entity. When I set up the custom view based on the fetch XML from an advanced find, the page produces this error:



Alert for the Exception



The status field for the document has an onChange event that fires the following javascript:



function getCustomView() {
try {
var LookupControl = Xrm.Page.getControl("WorkingDataRequestsGrid");

if (LookupControl != null) {
var CaseId = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].id;
var Casename = Xrm.Page.getAttribute("confidentialdocuments").getValue()[0].name;

var fetch = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
" <entity name='confidentialdocument'>" +
" <attribute name='documenttitle'/>" +
" <attribute name='typeofrequest'/>" +
" <attribute name='createdby'/>" +
" <attribute name='respondingparty'/>" +
" <attribute name='noofquestions'/>" +
" <attribute name='dataresponseduedate'/>" +
" <attribute name='confidentialdocumentid'/>" +
" <order descending='false' attribute='documenttitle'/>" +
" <filter type='and'>" +
" <condition attribute='documenttype' value='{33F7488F-DE7C-E511-813B-1458D04E7900}' uitype='new_documenttype' uiname='Data Request' operator='eq'/>" +
" <condition attribute='documentstatus' value='413360000' operator='eq'/>" +
" <condition attribute='confidentialdocuments' value='" + CaseId + "' uitype='incident' uiname='" + Casename + "' operator='eq'/>" +
" </filter>" +
" <link-entity name='incident' alias='a_f409103f050fe71181091458d04dd6c8' link-type='outer' visible='false' to='confidentialdocuments' from='incidentid'>" +
" <attribute name='title'/>" +
" </link-entity>" +
" </entity>" +
"</fetch>";

//columns to display in the custom view (make sure to include these in the fetch query)
var layout = "<layoutxml>" +
"<grid name='resultset' icon='1' preview='1' select='1' jump='name' object='10013'>" +
" <row id='confidentialdocumentid' name='result'>" +
" <cell name='documenttitle' width='100'/>" +
" <cell name='a_f409103f050fe71181091458d04dd6c8.title' width='100' disableSorting='1'/>" +
" <cell name='createdby' width='100'/>" +
" <cell name='typeofrequest' width='100'/>" +
" <cell name='noofquestions' width='100'/>" +
" <cell name='respondingparty' width='100'/>" +
" <cell name='dataresponseduedate' width='100'/>" +
" </row>" +
"</grid>" +
"</layoutxml>";

var viewId = "{00000000-0000-0000-0000-000000000009}";// add the randomly generated GUID for the view id
var entityName = "confidentialdocument";//add the entity name
var viewDisplayName = "Working Confidential Data Request Documents";// add the view display name

//alert(viewId + " --- " + entityName + " --- " + viewDisplayName);
Xrm.Page.getControl("WorkingDataRequestsGrid").addCustomView(viewId, entityName, viewDisplayName, fetch, layout, true);
}
}
catch (error) {
alert("Error in ConfidentialJs, Method Name: getCustomView(), Error: " + error.message);
}
}


NOTE: I updated the "layout" XML using the xml from the Solutions Customizations.xml.



I had a few alert statements in the javaScript so I could see what was happening. When the field changes to the correct status, the javaScript function is fired. It fires during the onLoad event as well but the "LookupControl" comes up as null so it doesn't set the custom view.



I think I have just been looking at this issue too long. Chances are it is a very small issue I am just missing. I need a fresh set of eyes to see something I can't.



I need help with two issues:




  1. Any ideas as to why the filter will not use the specified view?

  2. Why does the onLoad event not have access to the look up control?


    The order of execution for several of the javascript methods set in the form properties caused the "Object does not support" error. One method was hiding the section so it couldn't be found. That has been fixed.




    After further review, the order of execution didn't actually fix the issue. It was never calling the addCustomView logic because it didn't find the "LookupControl." So, back to needing help on both issues!






Any help is greatly appreciated!







javascript dynamics-crm dynamics-365 subgrid lookupfield






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 17:19

























asked Nov 9 '18 at 21:57









Paul Haan

438




438








  • 1




    Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
    – jasonscript
    Nov 12 '18 at 5:59










  • @Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
    – Paul Haan
    Nov 12 '18 at 13:52










  • You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
    – jasonscript
    Nov 13 '18 at 4:01










  • @jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
    – Paul Haan
    Nov 13 '18 at 16:32








  • 1




    Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
    – Paul Haan
    Nov 14 '18 at 14:07














  • 1




    Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
    – jasonscript
    Nov 12 '18 at 5:59










  • @Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
    – Paul Haan
    Nov 12 '18 at 13:52










  • You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
    – jasonscript
    Nov 13 '18 at 4:01










  • @jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
    – Paul Haan
    Nov 13 '18 at 16:32








  • 1




    Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
    – Paul Haan
    Nov 14 '18 at 14:07








1




1




Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
– jasonscript
Nov 12 '18 at 5:59




Is the tab collapsed by default? I remember reading somewhere that collapsed tabs are not rendered onload
– jasonscript
Nov 12 '18 at 5:59












@Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
– Paul Haan
Nov 12 '18 at 13:52




@Jasonscript - I verified this morning that the section is visible by default. However, there was another method called by onLoad hiding that section in certain cases. I changed the order of execution so the getCustomView always fires first. The good news is the "addCustomView" error does go away! Unfortunately, the custom view is still not being used. It still shows all of the documents without the filters. One problem down, one to go!
– Paul Haan
Nov 12 '18 at 13:52












You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
– jasonscript
Nov 13 '18 at 4:01




You have columns in your layoutXml that are not included in your fetchXml (e.g. "name", "createdon", "submittingparty"). Not sure if this is necessary but the comment in your code ("make sure to include these in the fetch query") suggests that it is :)
– jasonscript
Nov 13 '18 at 4:01












@jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
– Paul Haan
Nov 13 '18 at 16:32






@jasonscript - Good catch. I updated the question accordingly. I inherited most of this code from the previous developer. I redid the FetchXml for my new view but didn't redo the layout. I removed one of the columns from the layout and updated the other two to match the FetchXml. It still has the same behavior.
– Paul Haan
Nov 13 '18 at 16:32






1




1




Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
– Paul Haan
Nov 14 '18 at 14:07




Most of the names do indeed have a XXX_ prefix but I was preserving client anonymity. I removed the XXX_ as to not divulge the client information. The FetchXml in the actual javascript files was pulled directly from the customizations.xml in the exported solution file.
– Paul Haan
Nov 14 '18 at 14:07












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233753%2fissues-using-a-custom-view-on-a-subgrid-for-a-lookup-in-dynamics-365%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233753%2fissues-using-a-custom-view-on-a-subgrid-for-a-lookup-in-dynamics-365%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma