fields { table 50701 "KanbanizeCard" ..... field(1; "ID"; Integer) { Caption = 'ID'; DataClassification = ToBeClassified; } field(2; "Nombre"; Text[200]) { Caption = 'Nombre'; DataClassification = ToBeClassified; } }I've published a page for this table as a WebService, and created this function:
} [ServiceEnabled] procedure AddCard(var actionContext: WebServiceActionContext) var card: Record KanbanizeCard; ODataActionManagement: Codeunit "OData Action Management"; begin ODataActionManagement.AddKey(Rec.FieldNo(ID), Rec.Nombre); card.Get(Rec.ID); card.Nombre := 'clip'; card.Modify(); end;And I'm calling with post, to this URL:
https://api.businesscentral.dynamics.com/v2.0/xxxxxx-e780-4167-8bff-xxxxxx/SandboxKANBANIZE/ODataV4/Company('CRONUS ES')/KanbanCard(33888)/NAV.AddCard()
Answers
Read about the possibilities for passing filters here.
https://docs.microsoft.com/en-us/odata/concepts/queryoptions-usage
'Misusing' a filter value can give you the possibility to pass 'clip' as a variable.
But normally you would use soap or API services for manipulating data, and odata for
just querying it.
I understand what you say about better using SOAP, but I think is one of the requisites of the external app using REST.
What do you mena with "misusing" the filter to pass clip as variable?
Put the filter in a text variable using getfilter on your dataitem.
Reset all filters, and execute your own logic with the text string.
Filtering issue seems to be solved. The thing is to send a text for modifying the record. And not just a text, probably in a near future must receive a jSon, and process it.
Glad to ear that you solved this issue, I understand what you say about not recommending it, it should be better SOAP...
Ypu solved it sending the fields and filters by URL??
added fields to the table just for the purpose.
Misused getfilter to get my parameters/data. Resetted all filters after the call, and
continued my own way through c/al coding.
But it whas to create a link with a call log for ip phone server.
Nothing shocking.
This is what was added to the url
When you pass that paremeter from a IRL, you are using directly the oData URL of a page, or you are refering to a boundary action, and calling it as a funtion, like for exameple, tthis:
https://api.businesscentral.dynamics.com/v2.0/xxxxx-e780-4167-8bff-xxxxxx/SandboxKANBANIZE/ODataV4/Company('CRONUS ES')/KanbanCard(33888)/NAV.AddCard()
How do you get or process those parameters into the page?
Sorry for all this question, but I'm trying to integrate with a 3rd partner software, and using REST is mandatory,,,,
http://localhost:9323/BC150/OData/Company('CRONUS Nederland BV')/Cust
http://localhost:9323/BC150/OData/Company('CRONUS Nederland BV')/Cust?$filter=Item_No eq '1968-S'
With that URL you are "atacking" customer pageno? What is the goal of that URL? And in the page how did you proceess the parameters?
The way I went about for the phone link was calling the page through a direct call to the webclient created a page especially for the purpose (forgot about that, sorry). This way I could enter the filters the same way I did it in my example of the published query Cust. So Odata querying works for direct calls to a specific page in the web client too.
This week I will have a development meeting with the externela application developer, we'll see if we can achieve something interesting...