Forum Replies Created

Page 1 of 4
  • Paul Mulroney Mulroney

    Member
    January 21, 2025 at 1:34 am in reply to: Speed issues between Omnis and Postgres

    Indeed! You’d be surprised at how much of a difference latency makes!

    Instead of a number of small queries, if you could put them into one query and return that result together, there would only be one round-trip time lag to worry about.

    For example, you can return JSON objects from postgres, so you could have something like

    select <some query returning json in one col>

    union

    select <some query returning json in one col>

    union

    etc

    Then you receive a list with each line being the data that you’re requesting.

    Regards

    Paul.

  • Paul Mulroney Mulroney

    Member
    January 20, 2025 at 2:40 am in reply to: Speed issues between Omnis and Postgres

    That’s to be expected. If Postgres and Omnis are on different machines, then you’re transferring the data that you’ve fetched across that link. LANs are very quick, so you don’t notice the delay in transfer. WANs, VPNs etc have slower links, latency etc that results in much longer delays.

    If you are intending to deploy a setup with Postgres on VPS etc, you need to consider how to minimise the amount of data being sent in the $fetch() – for example, in our system we have a “Organisational Details” record that contains, among other things, a company logo. In the old DML days we would single file find that record whenever we open the window. Now that we’re in SQL, if the logo is large eg 6Mb image, then it takes 3 minutes to transfer that binary file… every time we open the window.

    Data optimisation means thinking about things like this:

    * caching details like this so they’re only loaded once per workstation/session,

    * returning only the absolute minimum of data in a query rather than all fields of the record,

    * fetching using an SQL worker so it can run in parallel to other operations and not block the UI controls, and

    * fetching a limited number of records at a time.

    Hope this helps!

  • Paul Mulroney Mulroney

    Member
    September 15, 2024 at 1:09 pm in reply to: REST API Client – POST file

    I’ll try this out in the morning. I suspect that your content needs to be defined as list of key/value pairs, so it will be something like

    do vlContent.$define(vsKey,vsValue)

    do vlContent.$add(‘Robby3’,<image data>)

  • Paul Mulroney Mulroney

    Member
    July 8, 2024 at 9:22 am in reply to: Compare and merging changes in VCS

    Hi Roland,

    The short answer is no – the VCS can’t handle branches and merges, because of the binary nature of the system. There are moves to use git, but this requires a radical change to the way that libraries work.

    What you can do is to export the library in JSON, then use a text comparison tool to compare the branches and merge. Then re-import the merged result. You might find that a little quicker.

    Regards,

    Paul.

  • We’re still in Studio 10.2 but about to move to 11.x. We started using Fontawsome for our icons. To use font awesome we used a technique that @andreas-pfeiffer showed us once:

    • Get an API key from Fontawesome. There are free tier levels available.
    • Update your jsctempl.htm file to include the font awesome key eg
    <script src="https://kit.fontawesome.com/<yourkeyhere>.js" crossorigin="anonymous"></script>
    • In your remote forms, in the button control, have the $text of the control be something like this (this is a “New” button with a file plus icon)
    <i class="fa-regular fa-file-plus" style="font-size:24px; vertical-align: middle;"> New 
    • Set the $textishtml property of the control to ktrue

    Enjoy a vast list of icons available to you.

  • Paul Mulroney Mulroney

    Member
    July 8, 2024 at 8:18 am in reply to: remote subforms inside objects

    Maybe refactor the code so you’re not calling code in another subform? Maybe one subform shouldn’t be calling another – can the code be put in the top level form, or in an object instead?

  • Paul Mulroney Mulroney

    Member
    July 8, 2024 at 8:14 am in reply to: Omnis in Melbourne

    HI Gary,

    I’m in Perth, WA, but I’m sure there are some Omnis devs in Victoria. They may not be on the forums, but still on the Omnis Developers list instead…

  • Yes, it’s possible to go from Omnis 7 to Omnis Studio 11, just not in one step.

    We originally started with Omnis 7 and converted some of these to Omnis Studio. It all depends on how the Omnis 7 app was built. It’s partly automatic conversion, and partly manual conversion.

    Check out this article on Omnis’ website: https://www.omnis.net/developers/omnis-7/

    If you want to contact me privately I’m happy to talk further with you about this.

    Regards,

    Paul.

  • Paul Mulroney Mulroney

    Member
    May 19, 2024 at 8:44 am in reply to: Omnis in the Cloud

    Hi Martin,

    Short answer is yes!

    The long and more complicated answer is that you can setup Omnis to run on a cloud service, and you setup a jsClient to handle login and application framework etc. You can then host your database and application “in the cloud”. If your Omnis app is setup for Desktop, then you’ll have a bit of work to convert it to a cloud-based solution. That’s the situation we find ourselves in now.

    We’re working on a solution. We’ve developed a framework for our application that works on desktop, tablet and mobile, and we’re creating jsClient forms that have the same functionality as our desktop windows.

    Happy to talk you through the process.

    Regards,

    Paul.

  • Hi Andreas,

    Thanks for your reply! Hope you are well!

  • I’ll say “Me too!” – I couldn’t make it to the conference, bad timing. If there is any video/livestream, we’d love to tune in too!

  • Paul Mulroney Mulroney

    Member
    May 14, 2024 at 11:21 pm in reply to: Picture upload via API

    Hi Martin,

    Glad it worked for you!

    Sorry I can’t make it to the conference, would’ve loved to be there but timing didn’t work for us.

    Regards,

    Paul

  • Paul Mulroney Mulroney

    Member
    May 14, 2024 at 1:47 am in reply to: Picture upload via API

    Hi Martin,

    You don’t need the first part – you just need to get the contents of the file into the variable lbinary, and then do this:

    Calculate vsImageEncoded as utf8tochar(bintobase64(lBinary))
    Calculate vsImageEncoded as con('data:image/png;base64,',vsImageEncoded)

    How you populate lbinary depends on whether you can read the file from disk, or retrieve it from a URL.

    To read it from disk, do something like:

    Do voFileOps.$openfile('path to the file')
    Do voFileOps.$readfile(lbinary)
    Do voFileOps.$closefile()

    If you need to fetch it from a website, you need something like this:

    HTTPPage ('https://www.omnis.net/wp-content/uploads/2018/11/omnis-Logo.png') Returns lbinary ## fetches header and content
    Calculate lbinary as bytemid(lbinary,binsearch(chartoutf8(chr(13,10,13,10)),lbinary)+4,binlength(lbinary)) ## strip off the header and leave the content

    Regards,

    Paul

  • Paul Mulroney Mulroney

    Member
    May 3, 2024 at 12:37 pm in reply to: Picture upload via API

    Try something like this:

    Calculate vsImageEncoded as utf8tochar(bintobase64(vrResult.delSignature)) ## bintobase64 returns UTF8 ready to send, but we need char because we're building the file ourselves.

    Then you can append this to the start

    Calculate vsImageEncoded as con(‘data:image/jpeg;base64,’,vsImageEncoded)


    Good luck!

    Regards,

    Paul.

  • Paul Mulroney Mulroney

    Member
    August 10, 2023 at 1:55 am in reply to: Retrieve current list

    #CLIST has the name of the current list. I’m sure there’s a notation-y way to do it, but I’m not sure how that works.

    Regards,

    Paul.

Page 1 of 4