[Solved] Cannot call method 'Init' of undefined

Moderator: crythias

Locked
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

[Solved] Cannot call method 'Init' of undefined

Post by crons »

in my custom.dtl , i am getting the JavaScript error "Cannot call method 'Init' of undefined " because of below code.

Code: Select all

<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
//]]></script>
<!--dtl:js_on_document_complete-->
Regards
Crons
Last edited by crons on 09 Jul 2013, 09:32, edited 2 times in total.
OTRS 3.3.x, Ubuntu, MySql 5.5
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Cannot call method 'Init' of undefined

Post by crythias »

"TicketAction" is undefined.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: Cannot call method 'Init' of undefined

Post by crons »

Thanks,

i tried including the file core.Ticket.Action.js in the dtl.
Still i am facing the same issue.
OTRS 3.3.x, Ubuntu, MySql 5.5
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Cannot call method 'Init' of undefined

Post by crythias »

considering that's not Core.Agent.TicketAction.js I could see how you'd face the same issue.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: Cannot call method 'Init' of undefined

Post by crons »

If i remove the script it works fine. will have plain text field for customer and no auto complete works.

I wanted customer field similar to AgentPhoneTicket.

At beginning i added

Code: Select all

$Include{"AgentCustomerSearch"}
<div class="MainBox ARIARoleMain">

Code: Select all

<label class="Mandatory"><span class="Marker">*</span> $Text{"Customer"}:</label>
                   <div class="Field">
                       <input id="FromCustomer" type="text" name="FromCustomer" value="" class="CustomerAutoComplete W50pc $QData{"FromInvalid"}"/>
						<span>eg:customer@organisation.com</span>
                        <div id="CustomerError" class="TooltipErrorMessage">
                            <p>$Text{"This field is required."}</p>
                         </div>
                        <div id="CustomerServerError" class="TooltipErrorMessage">
                            <p>$Text{"This field is required."}</p>
                        </div>
                    </div>
                    <div class="Clear"></div>
end of the form

Code: Select all

<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
//]]></script>
<!--dtl:js_on_document_complete-->
Last edited by crons on 08 Jul 2013, 09:12, edited 1 time in total.
OTRS 3.3.x, Ubuntu, MySql 5.5
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: Cannot call method 'Init' of undefined

Post by crons »

Any one who has can help on this?
OTRS 3.3.x, Ubuntu, MySql 5.5
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Cannot call method 'Init' of undefined

Post by crythias »

Maybe if you told us what you were trying to do and how we could replicate your experience we'd be able to assist.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: Cannot call method 'Init' of undefined

Post by crons »

Am in trying to create "QuickTicket" where i need "From Customer" field as similar to "AgentTicketPhone".
Agent starts entering first characters of Customer, it should list the customers names.
OTRS 3.3.x, Ubuntu, MySql 5.5
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: Cannot call method 'Init' of undefined

Post by crons »

Had not included Loaders "Core.Agent.CustomerSearch.js" and" Core.Agent.TicketAction.js" under sysconfig Area.
After including it worked Perfectly.
OTRS 3.3.x, Ubuntu, MySql 5.5
Locked