Jump to content

This topic is 2922 days old. Please don't post here. Open a new topic instead.

Recommended Posts

OK, two more questions as I try to re-tackle this:

 

1.  Is it somehow possible to use the "perform script on server" step in 13 instead of ExecuteSQL?

2.  How do I implement with the separation model, where the data and the UI are separate files?

 

Thanks all!

Link to comment
Share on other sites

  • 1 year later...
  • Newbies

Hi There,

I am trying to apply the solution from Mr_Vodka, but it just doesn't work. I am having a relationship to the same table based on a name field. Maybe this is the reason it is not working?

My Scenario: 
I have an InvoiceRegister and whenever a new Invoice is entered I am showing in a portal all invoices that were previously entered for the same company.  So Table A "InvoiceRegister" is joint by the field "Company" with Table B "InvoiceCompany"  (Table B is just another occurrence of "InvoiceRegister") 

I created a sort field and applied it to the table occurrence "InvoiceCompany" since this is what the portal is using.

Sortfield:

Let ( [
   idList = ¶ & $$gIDs & ¶ ;     // substitute your global var or field - I don't understand this bit? What do I need to change here?
   id = ¶ & ID & ¶ ;             // substitute your ID field    - my field is also called ID
   result = Position ( idList ; id ; 1; 1 )
       ];
   result )

The Portal is then sorted by the sort field created above.

I copied the script "sortPortal [field]" without any changes

I copied the script "setPortal_refresh" and changed the SQL statement to this

ExecuteSQL( "SELECT ID from InvoiceCompany WHERE Company = ? ORDER BY " & $$field & Case ( $$sort_desc; " DESC" ); ""; ""; InvoiceRegister::Company )

I applied the button to the header of the portal field, selected the script "sortPortal [field]" and added the script parameter Let ( $$sort_icon = 1; GetFieldName ( InvoiceCompany::Property ) )

I also copied the variable "Declare Variables" onto the layout, even though I have no idea what it does.

What am I missing or where am I going wrong? I have looked for this now for so many hours, but I just can't get it to work.

Thanking you in advance.

Regine

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.