Got a (hopefully quick one) I need to route my form if it is opened via a dialogue, directly from the form, but if the Invoice form is a dialouge and then my form is open from there, it doesn't route. This is my code
Now I know this doesn't work because if the 1st check fails, the whole thing fails and it routes to the default form.
I have tried a try and catch, but this fails aswell...
try {
if (window.top.fd.control('Invoice_Items')) {
return '81e81431-185e-42e8-b9df-a6a9337e3fb8'
}
}catch (e){
if (window[0].fd.control('Invoice_Items')){
return '81e81431-185e-42e8-b9df-a6a9337e3fb8'
}
}
even though window[0].fd.control... has a value:
do you know how I can route the form is opened in a dialogue more than 1 window deep?
thanks @Margo but i need to know if it is being opened from a particular parent. And route based on that.
IE. I have 4 lists called clients, sales orders, invoices and line items.
If the line items form is opened from an invoice form I need a particlar version of line items to be displayed and a different version of the form if lines items is opened from a sales order form (this is the default form)
That works at the moment, but it breaks if a client form is opened, then the invoice form in a dialog then line items from the invoice form, it shows the default line items form intead of the one for the invoice.
So I need to check what the parent form is and route to the correct line item form.