Skip to main content

Control procedure effect on API

  • March 25, 2022
  • 1 reply
  • 47 views

Forum|alt.badge.img+4

Hi,

Recently I have been encountering some problems with the OData api because of some code written in the stored procedures. Up till now I noticed that the layout and default CP have effect on the api.
 

For instance: I had once written in my layout CP to set some fields on Read-Only if a certain condition is met. Turns out that these fields are also set on read-only for the api, which results in not being able to update the field via a mobile app and getting a 403 error. 
 

Now I have this piece of code (as show below) which I thought would only effect the gui because I specifically added the ‘@cursor_from_col_id’.

But now when I use the api to update a record, the status is always set to ‘RGS’ because I have a service type that is not equal to ‘OTH’. Removing the field from the request still doesn’t seem to help this issue.

How can I tackle this issue? Is there something that need to be aware of?
Thanks

Did this topic help you find an answer to your question?
This topic has been closed for comments

Forum|alt.badge.img+17

The default is called for each column you modify in order of entry. So if your input is column1 and column2 the default is called in this order:

default with @cursor_from_col_id = null
default with @cursor_from_col_id = column1
default with @cursor_from_col_id = column2

I assume you also update the job_status? 
If you amend both the job_service_type and job_status in the postman post then you probably want to enter the parameters in this order: job_service_type, job_status


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings