Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
JJE
New Member
Posts: 13
Registered: ‎09-24-2009

EntityFactory.GetById

Hi,

 

I'm new in SLX web and I tried to create a new UI web site.

On the default page load I used the following instruction to get a ticket object :

ITicket _ticket = Sage.Platform.EntityFactory.GetById<ITicket>(_TicketID);

 

_TicketID is a valid ID

but I get a 'null' in _ticket

 

What's wrong?

 

Thanks,

Moderator
Posts: 440
Registered: ‎05-07-2008

Re: EntityFactory.GetById

EntityFactory depends on a number of services to be available, what is the actual page event you are accessing the data?  Is this and Application Page or EntityPage

John Perona

Director, Infor CRM Development

Infor CRM

Infor CRM

JJE
New Member
Posts: 13
Registered: ‎09-24-2009

Re: EntityFactory.GetById

Hi,

 

In fact there a Default page like in the Lead Capture Portal. 

 

Here's what I did:
I copied the Web.config and connection.config from the lead capture site and this is now working...
but I also created an extension entity called TicketSurvey for tickets and I have the following problem:
I use this instruction to check if data exists in the extension table correponding to the current ticket
   ITicketSurvey _survey = Sage.Platform.EntityFactory.GetById<ITicketSurvey>(_TicketID);
it works bur if I get a null objct, I try to create a survey like this:
   ITicketSurvey _newsurvey = Sage.Platform.EntityFactory.Create<ITicketSurvey>();
and get the following error:
Exception Details: System.ArgumentException: Could not find the dynamic method TicketSurvey.OnCreate.  Check you method configuration to ensure that this method exists.

Source Error:
Line 628:                            lib.Execute("TicketSurvey.OnCreate", methodArgs);

When I compile my platform everything went well, I sometimes get the following when I go to my portal configuration advanced tab:
WARN  - Could not load type 'Sage.Entity.Interfaces.ITicketSurvey' from assembly 'Sage.Entity.Interfaces, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

What is the problem?

Moderator
Posts: 440
Registered: ‎05-07-2008

Re: EntityFactory.GetById

Check the method signature of your OnCreate method for TicketSurvey.  The compiler will not catch this error currently. 

John Perona

Director, Infor CRM Development

Infor CRM

Infor CRM

JJE
New Member
Posts: 13
Registered: ‎09-24-2009

Re: EntityFactory.GetById

But where should I check that?
JJE
New Member
Posts: 13
Registered: ‎09-24-2009

Re: EntityFactory.GetById

Hi,

 

I have also used another method:

In place of the Create Instruction, as TicketSurvey is an Extension to Ticket, I tried the following:

ITicketSurvey _new = _ticket.TicketSurvey;

I get an object to work with but when I try a Save I get the following error:

Exception Details: System.ArgumentException: Could not find the dynamic method TicketSurvey.OnBeforeInsert.  Check you method configuration to ensure that this method exists.
Source Error:
Line 659:                    lib.Execute("TicketSurvey.OnBeforeInsert", methodArgs);

What should I do now?

 

THanks,

JJE
New Member
Posts: 13
Registered: ‎09-24-2009

Re: EntityFactory.GetById

It seems that this is happening on every new Interfaces that I create.

 

I just created the interface on an existing table and compiled.

Is there anything else required?

 

Any ideas?

 

Thanks,