Skip to main content

Hi,

Is it possible to pass a Parameter to the GI when the GI is extended via a WebService EndPoint?

 

Setup:

I have created a generic inquiry called SubcontractsByProject, it takes in 1 Parameter called ProjectID, 

I have set the ProjectID with a default value of a project and it filters to that Project, so the GI is working as it should.

 

I have extended a Webservice EndPoint to SubcontractsByProject using instructions from https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/

 

The web service works

http://localhost/entity/Subcontracts/18.200.001/SubcontractsByProject?$expand=Result

It is returning data with the default ProjectID in the GI

 

How can I pass a different value of ProjectID to the webservice?

I tried adding a parameter in the Body like so in PostMan but it does not work

 

Thanks

Mark

Hi @mwong11,

The body looks correct, I’m assuming that you have provided an invalid URL. Below is the URL format, please validate.

 

URL: http://localhost/InstanceName/entity/EndPointName/Endpointversion/EntityName?$expand=TestEntityDetails

I’m assuming that you have included the GI name but NOT the EntityName in the URL.

 

Please find the attached screenshot for reference

 

 

 

 

 


Thanks Naveen,

I used $expand=Result because I created the Results endpoint as per https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/

Setup Info:

Here is my GI, showing the ProjectID. Again, the GI works with the ProjectID

Here is my EndPoint definition

As you can see, I have Result and PUDSubcontractsDetails defined. Both return same result

Unfortunately I am still not getting the ProjectID filter in the result as shown below, even though it is defined in the body

 

I try both $expand=Result and $expand=PUDSubcontractsDetails, the ProjectID parameter still does not show and return results is not filtered by the parameter.

 

Thanks Mark

 


I was able to solve this.

For anyone looking how. In the EndPoint screen, you have to click on the EndPoint, go to Fields tab, click on Populate

Select Filter as object, then select the Filter Parameter

 


Reply